c18fada581afec3f6febb981c6ff26522dab39d0,keras_rcnn/layers/losses/_rcnn.py,RCNNRegressionLoss,compute_loss,#Any#Any#,50
Before Change
smooth_l1_sign = tensorflow.cast(tensorflow.less(tensorflow.abs(inside_mul), 1.0 / sigma2), tensorflow.float32)
smooth_l1_option1 = tensorflow.multiply(tensorflow.multiply(inside_mul, inside_mul), 0.5 * sigma2)
smooth_l1_option2 = tensorflow.subtract(tensorflow.abs(inside_mul), 0.5 / sigma2)
smooth_l1_result = tensorflow.add(tensorflow.multiply(smooth_l1_option1, smooth_l1_sign), tensorflow.multiply(smooth_l1_option2, tensorflow.abs(tensorflow.subtract(smooth_l1_sign, 1.0))))
loss = tensorflow.multiply(outside_weights, smooth_l1_result)
loss = tensorflow.reduce_mean(tensorflow.reduce_sum(loss, reduction_indices=[1]))
return loss
After Change
inside_weights = 1.0
outside_weights = 1.0
sigma = 1.0
sigma2 = keras.backend.square(sigma)
inside_mul = inside_weights * (output - target)
smooth_l1_sign = tensorflow.cast(keras.backend.less(keras.backend.abs(inside_mul), 1.0 / sigma2), tensorflow.float32)
smooth_l1_option1 = (inside_mul * inside_mul) * (0.5 * sigma2)
smooth_l1_option2 = keras.backend.abs(inside_mul) - (0.5 / sigma2)
smooth_l1_result = (smooth_l1_option1 * smooth_l1_sign) + (smooth_l1_option2 * keras.backend.abs((smooth_l1_sign - 1.0)))
loss = outside_weights * smooth_l1_result
loss = tensorflow.reduce_mean(tensorflow.reduce_sum(loss, reduction_indices=[1]))
return loss
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: broadinstitute/keras-rcnn
Commit Name: c18fada581afec3f6febb981c6ff26522dab39d0
Time: 2017-08-17
Author: allen.goodman@icloud.com
File Name: keras_rcnn/layers/losses/_rcnn.py
Class Name: RCNNRegressionLoss
Method Name: compute_loss
Project Name: deepfakes/faceswap
Commit Name: b7b1bd5c6f7892061a9915cd27d19360482d1fd8
Time: 2019-08-03
Author: vrooman.kyle@gmail.com
File Name: lib/model/losses.py
Class Name:
Method Name: gmsd_loss
Project Name: NifTK/NiftyNet
Commit Name: 7d9d506e77585e5600b45dc41da1a731a4b30722
Time: 2017-04-27
Author: z.eaton-rosen@ucl.ac.uk
File Name: nn/loss.py
Class Name:
Method Name: sensitivity_specificity_loss