This also failed :
import theano.tensor as T
def weighted_crossentropy(predictions, targets):
weights_per_label = theano.shared(lasagne.utils.floatX([0.2, 0.4]))
weights = weights_per_label[targets] # returns a targets-shaped weight
matrix
loss =
lasagne.objectives.aggregate(T.nnet.categorical_crossentropy(predictions,
targets), weights=weights)
return loss
loss_or_grads = weighted_crossentropy(prediction, self.target_var)
//
TypeError: index must be integers
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.