83fab6b0a19ea12f40ceb77a16b71bf5130ddc27,spotlight/losses.py,,pointwise_loss,#Any#Any#Any#,18

Before Change


    loss = (positives_loss + negatives_loss)

    if mask is not None:
        loss = loss * mask.float()

    return loss.mean()

After Change


    loss = (positives_loss + negatives_loss)

    if mask is not None:
        mask = mask.float()
        loss = loss * mask
        return loss.sum() / mask.sum()

    return loss.mean()

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: maciejkula/spotlight
Commit Name: 83fab6b0a19ea12f40ceb77a16b71bf5130ddc27
Time: 2017-07-13
Author: maciej.kula@gmail.com
File Name: spotlight/losses.py
Class Name:
Method Name: pointwise_loss


Project Name: maciejkula/spotlight
Commit Name: 83fab6b0a19ea12f40ceb77a16b71bf5130ddc27
Time: 2017-07-13
Author: maciej.kula@gmail.com
File Name: spotlight/losses.py
Class Name:
Method Name: bpr_loss


Project Name: maciejkula/spotlight
Commit Name: 83fab6b0a19ea12f40ceb77a16b71bf5130ddc27
Time: 2017-07-13
Author: maciej.kula@gmail.com
File Name: spotlight/losses.py
Class Name:
Method Name: hinge_loss