def compute_recall(y, tp):
    """
    Computes the recall for the binary classification.

    Parameters
    ----------
    y : Variable
        Targets for the binary classifications.
    tp : Variable
        True positives.

    Returns
    -------
    recall : Variable
        Recall for the binary classification.
    """
    recall = tp / T.maximum(1., y.sum())
    return recall
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/expr/nnet.py/compute_recall/original