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
After Change
tot_ss, tot_ss_update = _per_target_variance(targets, weights)
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):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
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: tgsmith61591/pmdarima
Commit Name: 942f284052b22214d830c1bc2c8de03bffaa8d07
Time: 2020-02-18
Author: aaronreidsmith@gmail.com
File Name: build_tools/azure/render_meta.py
Class Name:
Method Name:
Project Name: HyperGAN/HyperGAN
Commit Name: 35d9aa8a6d11ac5c30d0be81ed3b1be9ce503ec1
Time: 2018-07-31
Author: mikkel@255bits.com
File Name: hypergan/trainers/fitness_trainer.py
Class Name: FitnessTrainer
Method Name: _create