cross_entropy_sigmoid

cross_entropy_sigmoid#

class brainpy.losses.cross_entropy_sigmoid(predicts, targets)[source]#

Computes the sigmoid cross-entropy loss.

Parameters:
  • predicts – (batch, …, #class) tensor of logits.

  • targets – (batch, …, #class) tensor of label probabilities (e.g. labels.sum(axis=-1) must be 1)

Returns:

(batch, …) tensor of the cross-entropies for each entry.