d533214900cea56a4ec0be87577e97d3807b6bc5,keras_ssd_loss.py,SSD_Loss,smooth_L1_loss,#SSD_Loss#Any#Any#,41

Before Change


        // In order to normalize the localization loss, we perform element-wise division by the default box widths and heights.
        // Deviations in xmin and xmax are divided by their respective default box widths, deviations in ymin and ymax are divided
        // by their respective default box heights.
        absolute_loss = tf.abs(y_true - y_pred) / self.loc_norm
        square_loss = 0.5 * (y_true - y_pred)**2 / self.loc_norm
        l1_loss = tf.where(tf.less(absolute_loss, 1.0), square_loss, absolute_loss - 0.5)
        return tf.reduce_sum(l1_loss, axis=-1)

After Change


        References:
            https://arxiv.org/abs/1504.08083
        """
        absolute_loss = tf.abs(y_true - y_pred)
        square_loss = 0.5 * (y_true - y_pred)**2
        l1_loss = tf.where(tf.less(absolute_loss, 1.0), square_loss, absolute_loss - 0.5)
        return tf.reduce_sum(l1_loss, axis=-1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pierluigiferrari/ssd_keras
Commit Name: d533214900cea56a4ec0be87577e97d3807b6bc5
Time: 2017-04-06
Author: pierluigi.ferrari@gmx.com
File Name: keras_ssd_loss.py
Class Name: SSD_Loss
Method Name: smooth_L1_loss


Project Name: microsoft/nni
Commit Name: c7d58033db0e25736d33406ed262cb5232d366e8
Time: 2020-02-09
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: src/sdk/pynni/nni/compression/torch/pruners.py
Class Name: AGP_Pruner
Method Name: calc_mask


Project Name: tsurumeso/waifu2x-chainer
Commit Name: 055c61d73514d471158ee36b83762802c8d4e3d4
Time: 2018-07-14
Author: tsurumeso@gmail.com
File Name: lib/loss/clipped_weighted_huber_loss.py
Class Name: ClippedWeightedHuberLoss
Method Name: forward