Function autograd::ops::sigmoid_cross_entropy [] [src]

pub fn sigmoid_cross_entropy(y: &Tensor, t: &Tensor) -> Tensor

Computes binary_cross_entropy(sigmoid(y)).

This function is better than that combination in that it can prevent underflow of log(sigmoid).

Arguments

  • y - Tensor with arbitrary shape
  • t - Tensor with arbitrary shape

Returns

Loss tensor with shape (batch_size, 1)