Calculates the binary cross entropy loss, given probabilities x and ground truth y. Returns a tensor of the same shape as x. To use for a loss, you have to sum over the result:
const loss = bce(x,y).sum();
Probabilities in [0,1]
Ground truth labels of the same shape as x.
Generated using TypeDoc
Calculates the binary cross entropy loss, given probabilities x and ground truth y. Returns a tensor of the same shape as x. To use for a loss, you have to sum over the result: