ea60242913a0ce53f4e033fee3be1f55e2ceb7b0,basenji/metrics.py,R2,update_state,#R2#Any#Any#Any#,249

Before Change


    y_true = tf.cast(y_true, "float32")
    y_pred = tf.cast(y_pred, "float32")

    true_sum = tf.reduce_sum(y_true, axis=[0,1])
    self._true_sum.assign_add(true_sum)

    true_sumsq = tf.reduce_sum(tf.math.square(y_true), axis=[0,1])
    self._true_sumsq.assign_add(true_sumsq)

After Change


    y_true = tf.cast(y_true, "float32")
    y_pred = tf.cast(y_pred, "float32")

    if len(y_true.shape) == 2:
      reduce_axes = 0
    else:
      reduce_axes = [0,1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: calico/basenji
Commit Name: ea60242913a0ce53f4e033fee3be1f55e2ceb7b0
Time: 2021-02-14
Author: drk@calicolabs.com
File Name: basenji/metrics.py
Class Name: R2
Method Name: update_state


Project Name: calico/basenji
Commit Name: ea60242913a0ce53f4e033fee3be1f55e2ceb7b0
Time: 2021-02-14
Author: drk@calicolabs.com
File Name: basenji/metrics.py
Class Name: PearsonR
Method Name: update_state


Project Name: GPflow/GPflow
Commit Name: 48270681afc13081094f7f398a1e194c6b07ba9b
Time: 2018-01-03
Author: dutordoirv@gmail.com
File Name: gpflow/models/gplvm.py
Class Name: BayesianGPLVM
Method Name: _build_likelihood