6bf3f51cd0a312da842157665663c2dad9983248,tensorflow_ranking/python/losses_impl.py,ClickEMLoss,_compute_latent_prob,#ClickEMLoss#Any#Any#Any#,914

Before Change


              tf.compat.v1.where(is_clicked, tf.ones_like(prob), prob))
          for prob in [exam_prob_given_non_clicks, rel_prob_given_non_clicks]
      ]
      return exam_prob_given_non_clicks, rel_prob_given_non_clicks

  def compute_unreduced_loss(self, labels, logits):
    Computes the loss for each element.

After Change


    
    with tf.compat.v1.name_scope(name="compute_latent_prob"):
      is_clicked = tf.greater_equal(tf.cast(clicks, tf.float32), 1.0)
      exam_logits_posterior = exam_logits - tf.math.softplus(rel_logits)
      rel_logits_posterior = rel_logits - tf.math.softplus(exam_logits)
      exam_prob_posterior = tf.compat.v1.where(
          is_clicked, tf.ones_like(exam_logits_posterior),
          tf.sigmoid(exam_logits_posterior))
      rel_prob_posterior = tf.compat.v1.where(
          is_clicked, tf.ones_like(rel_logits_posterior),
          tf.sigmoid(rel_logits_posterior))
      return tf.stop_gradient(exam_prob_posterior), tf.stop_gradient(
          rel_prob_posterior)

  def compute_unreduced_loss(self, labels, logits):
    Computes the loss for each element.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/ranking
Commit Name: 6bf3f51cd0a312da842157665663c2dad9983248
Time: 2021-01-29
Author: xuanhui@google.com
File Name: tensorflow_ranking/python/losses_impl.py
Class Name: ClickEMLoss
Method Name: _compute_latent_prob


Project Name: rail-berkeley/softlearning
Commit Name: a55f9be217b2320cec7c7dc44a8245496f851af5
Time: 2019-06-01
Author: hartikainen@berkeley.edu
File Name: softlearning/algorithms/sac.py
Class Name: SAC
Method Name: _get_Q_target


Project Name: IndicoDataSolutions/finetune
Commit Name: b896c42aef9ce8a93b2d396edab3f6dff234777e
Time: 2019-05-14
Author: benlt@hotmail.co.uk
File Name: finetune/base_models/bert/featurizer.py
Class Name:
Method Name: bert_featurizer


Project Name: NifTK/NiftyNet
Commit Name: c5023bafe075db2d1deb891816212f5bf297316e
Time: 2018-07-21
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/crf.py
Class Name:
Method Name: permutohedral_gen