Joint learning log linear models


I want to implement a custom loss function that is a sum of log linear loss (for binary classification).

I tried digging in the forum and in general for a solution but I can’t seem to find how to do it. Could you maybe point me towards a source for this?