MCPcopy Create free account
hub / github.com/twitter/the-algorithm-ml / compute

Method compute

metrics/rce.py:169–181  ·  view source on GitHub ↗

Compute and return the accumulated rce.

(self)

Source from the content-addressed store, hash-verified

167 )
168
169 def compute(self) -> torch.Tensor:
170 """
171 Compute and return the accumulated rce.
172 """
173 baseline_mean = self.mean_label.compute()
174
175 baseline_ce = _binary_cross_entropy_with_clipping(
176 baseline_mean, baseline_mean, reduction="mean", epsilon=self.epsilon
177 )
178
179 pred_ce = self.binary_cross_entropy.compute()
180
181 return (1.0 - (pred_ce / baseline_ce)) * 100
182
183 def reset(self):
184 """

Callers 11

forwardMethod · 0.45
updateMethod · 0.45
_run_evaluationFunction · 0.45
test_count_metricFunction · 0.45
test_collectionsFunction · 0.45
test_task_dependent_ctrFunction · 0.45
test_stratified_ctrFunction · 0.45
test_aucFunction · 0.45
test_pos_rankFunction · 0.45
test_reciprocal_rankFunction · 0.45
test_hit_kFunction · 0.45

Tested by 8

test_count_metricFunction · 0.36
test_collectionsFunction · 0.36
test_task_dependent_ctrFunction · 0.36
test_stratified_ctrFunction · 0.36
test_aucFunction · 0.36
test_pos_rankFunction · 0.36
test_reciprocal_rankFunction · 0.36
test_hit_kFunction · 0.36