chainer.functions.binary_accuracy

chainer.functions.binary_accuracy(y, t)[source]

Computes binary classification accuracy of the minibatch.

Parameters:
  • y (Variable) – Variable holding a matrix whose i-th element indicates the score of positive at the i-th example.
  • t (Variable) – Variable holding an int32 vector of ground truth labels. If t[i] == -1, corresponding x[i] is ignored. Accuracy is zero if all ground truth labels are -1.
Returns:

A variable holding a scalar array of the accuracy.

Return type:

Variable

Note

This function is non-differentiable.