b6f83ab5a36233c57b19aa38f28d58a80b19c3ba,ludwig/modules/metric_modules.py,R2Score,update_state,#R2Score#Any#Any#,62
Before Change
self._reset_states()
def update_state(self, y, y_hat):
self.sum_y += np.sum(y)
self.sum_y_squared += np.sum(y ** 2)
self.sum_y_hat += np.sum(y_hat)
self.sum_y_hat_squared += np.sum(y_hat ** 2)
self.sum_y_y_hat += np.sum(y * y_hat)
After Change
)
def update_state(self, y, y_hat):
y = tf.cast(y, dtype=tf.float32)
y_hat = tf.cast(y_hat, dtype=tf.float32)
self.sum_y.assign_add(tf.reduce_sum(y))
self.sum_y_squared.assign_add(tf.reduce_sum(y ** 2))
self.sum_y_hat.assign_add(tf.reduce_sum(y_hat))
self.sum_y_hat_squared.assign_add(tf.reduce_sum(y_hat ** 2))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: uber/ludwig
Commit Name: b6f83ab5a36233c57b19aa38f28d58a80b19c3ba
Time: 2020-08-14
Author: jimthompson5802@gmail.com
File Name: ludwig/modules/metric_modules.py
Class Name: R2Score
Method Name: update_state
Project Name: Kamnitsask/deepmedic
Commit Name: 70cf20f6cf5e21c3b6165067483b925db61c161c
Time: 2018-06-17
Author: konstantinos.kamnitsas12@imperial.ac.uk
File Name: deepmedic/neuralnet/layers.py
Class Name: SoftmaxLayer
Method Name: getRpRnTpTnForTrain0OrVal1
Project Name: Microsoft/nni
Commit Name: 4e2d8cd89163c0fd4b4e14e4f3d13b58d7e3b29f
Time: 2020-10-18
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: examples/nas/naive-tf/train.py
Class Name:
Method Name: accuracy