This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binary_jaccard_index(predictions,targets): | |
"""Computes the binary (generalized) Jaccard index between predictions and targets. | |
.. math:: L_i = \\sum_i{\\min(p_i,t_i} / \\sum_i{\\max(p_i,t_i} | |
Parameters | |
---------- | |
predictions : Theano tensor | |
Predictions in [0, 1], such as a sigmoidal output of a neural network, | |
giving the probability of the positive class | |
targets : Theano tensor | |
Targets in {0, 1}, such as ground truth labels. |