How to implement weighted binary cross-entropy on anano?
My convolutional neural network only predicts 0 ~~ 1 (sigmoid).
I want to punish my predictions this way:

Basically, I want to punish MORE when the model predicts 0, but the truth was 1.
Question: How to create this weighted binary cross-entropy function using theano and lasagne?
I tried this below
prediction = lasagne.layers.get_output(model) import theano.tensor as T def weighted_crossentropy(predictions, targets):
But I get this error below:
TypeError: The new form in reshape must be a vector or scalar list / tuple. Got subtenser {int64} .0 after conversion to vector.
Link: https://github.com/fchollet/keras/issues/2115
Link: https://groups.google.com/forum/#!topic/theano-users/R_Q4uG9BXp8
python theano keras lasagne
KenobiShan
source share