2767c948afa434f863df3b5eb1946a032dfba588,spotlight/losses.py,,hinge_loss,#,86

Before Change


        The mean value of the loss function.
    

    return torch.mean(torch.clamp(negative_predictions -
                                  positive_predictions +
                                  1.0, 0.0))


def regression_loss(observed_ratings, predicted_ratings):
    

After Change


                       positive_predictions +
                       1.0, 0.0)

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

    return loss.mean()


def regression_loss(observed_ratings, predicted_ratings):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


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


Project Name: pytorch/audio
Commit Name: 4e97213b48e152344b7429c7d1067e7525bfa4b9
Time: 2020-10-13
Author: 855818+mthrok@users.noreply.github.com
File Name: examples/source_separation/utils/metrics.py
Class Name:
Method Name: sdr


Project Name: fgnt/nara_wpe
Commit Name: 9c86a02d038dba72cd95ddce112d2492b5a5cb5c
Time: 2018-05-16
Author: cbj@mail.uni-paderborn.de
File Name: nara_wpe/wpe.py
Class Name:
Method Name: get_power_inverse


Project Name: HyperGAN/HyperGAN
Commit Name: 1b199c1e7f3cf4cf7066ffbd3db407b7aa151742
Time: 2020-12-24
Author: martyn@255bits.com
File Name: hypergan/train_hooks/adversarial_norm_train_hook.py
Class Name: AdversarialNormTrainHook
Method Name: forward