5ba781c281d60ad03d0c8088400a73802dd82d03,basenji/ops.py,,per_target_r2,#Any#Any#Any#,199

Before Change


    r2: idempotent [preds.shape[-1]] tensor of r2 values for each target.
    update_op: op for updating the value given new data
  
  preds_split = tf.unstack(preds, axis=-1)
  targets_split = tf.unstack(targets, axis=-1)
  weights_split = tf.unstack(weights, axis=-1)

  r2_metrics = [
      r2_metric(p, t, w)
      for p, t, w in zip(preds_split, targets_split, weights_split)
  ]

  r2_values = [r[0] for r in r2_metrics]
  stacked_r2 = tf.stack(r2_values)
  update_ops = tf.group(*[r[1] for r in r2_metrics])
  return stacked_r2, update_ops



def r2_averaged_over_all_prediction_tasks(preds, targets, weights):

After Change


  r2 = 1. - res_ss / tot_ss

  update_op = tf.group(res_ss_update, tot_ss_update)
  return r2, update_op


def r2_averaged_over_all_prediction_tasks(preds, targets, weights):
  Returns ops for multi-task R2 statistic following the tf.metrics API.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: calico/basenji
Commit Name: 5ba781c281d60ad03d0c8088400a73802dd82d03
Time: 2018-05-11
Author: noreply@google.com
File Name: basenji/ops.py
Class Name:
Method Name: per_target_r2


Project Name: arogozhnikov/einops
Commit Name: f700314b855b2c1bb1bb3b8930289b6db62dca91
Time: 2019-05-10
Author: stefan.saftescu@gmail.com
File Name: einops/_backends.py
Class Name: TensorflowBackend
Method Name: shape


Project Name: mathics/Mathics
Commit Name: b24e62805f1f8c42351dfa64faaeda8707955e06
Time: 2016-08-23
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/colors.py
Class Name:
Method Name: grayscale_to_rgb