sigmoid_cross_entropy_loss

dragon.losses.sigmoid_cross_entropy_loss(
  inputs,
  reduction='valid',
  **kwargs
)[source]

Compute the loss of sigmoid cross entropy.

Examples:

x = dragon.constant([0.1, 0.2, 0.3, 0.4])
y = dragon.constant([0., 0., 1., 1.])
print(dragon.losses.sigmoid_cross_entropy_loss([x, y]))  # 0.65247655
Parameters:
  • inputs (Sequence[dragon.Tensor]) – The tensor input and target.
  • reduction ({'none', 'sum', 'mean', 'valid'}, optional) – The reduction method.
Returns:

dragon.Tensor – The output tensor.