Skip to content

Commit 1ecaa3e

Browse files
Jinpu Zhoumeta-codesync[bot]
authored andcommitted
Fix WEIGHTED_NUM_SAMPES typo in torchrec/metrics (meta-pytorch#3489)
Summary: Pull Request resolved: meta-pytorch#3489 Fix typo: WEIGHTED_NUM_SAMPES -> WEIGHTED_NUM_SAMPLES Reviewed By: iamzainhuda Differential Revision: D85461614 fbshipit-source-id: 77c6e4a70fdc0bab5fb8f796c2193c262cc99818
1 parent acdecd7 commit 1ecaa3e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

torchrec/metrics/mae.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
ERROR_SUM = "error_sum"
23-
WEIGHTED_NUM_SAMPES = "weighted_num_samples"
23+
WEIGHTED_NUM_SAMPLES = "weighted_num_samples"
2424

2525

2626
def compute_mae(
@@ -106,7 +106,7 @@ def _compute(self) -> List[MetricComputationReport]:
106106
metric_prefix=MetricPrefix.WINDOW,
107107
value=compute_mae(
108108
self.get_window_state(ERROR_SUM),
109-
self.get_window_state(WEIGHTED_NUM_SAMPES),
109+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
110110
),
111111
),
112112
]

torchrec/metrics/mse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
ERROR_SUM = "error_sum"
24-
WEIGHTED_NUM_SAMPES = "weighted_num_samples"
24+
WEIGHTED_NUM_SAMPLES = "weighted_num_samples"
2525
LABEL_SUM = "label_sum"
2626
LABEL_SQUARED_SUM = "label_squared_sum"
2727

@@ -162,15 +162,15 @@ def _compute(self) -> List[MetricComputationReport]:
162162
metric_prefix=MetricPrefix.WINDOW,
163163
value=compute_mse(
164164
self.get_window_state(ERROR_SUM),
165-
self.get_window_state(WEIGHTED_NUM_SAMPES),
165+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
166166
),
167167
),
168168
MetricComputationReport(
169169
name=MetricName.RMSE,
170170
metric_prefix=MetricPrefix.WINDOW,
171171
value=compute_rmse(
172172
self.get_window_state(ERROR_SUM),
173-
self.get_window_state(WEIGHTED_NUM_SAMPES),
173+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
174174
),
175175
),
176176
]
@@ -192,7 +192,7 @@ def _compute(self) -> List[MetricComputationReport]:
192192
metric_prefix=MetricPrefix.WINDOW,
193193
value=compute_r_squared(
194194
self.get_window_state(ERROR_SUM),
195-
self.get_window_state(WEIGHTED_NUM_SAMPES),
195+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
196196
self.get_window_state(LABEL_SUM),
197197
self.get_window_state(LABEL_SQUARED_SUM),
198198
),

torchrec/metrics/nmse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ERROR_SUM,
2020
get_mse_states,
2121
MSEMetricComputation,
22-
WEIGHTED_NUM_SAMPES,
22+
WEIGHTED_NUM_SAMPLES,
2323
)
2424
from torchrec.metrics.rec_metric import (
2525
MetricComputationReport,
@@ -117,21 +117,21 @@ def _compute(self) -> List[MetricComputationReport]:
117117

118118
window_mse = compute_mse(
119119
self.get_window_state(ERROR_SUM),
120-
self.get_window_state(WEIGHTED_NUM_SAMPES),
120+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
121121
)
122122
window_const_pred_mse = compute_mse(
123123
self.get_window_state(CONST_PRED_ERROR_SUM),
124-
self.get_window_state(WEIGHTED_NUM_SAMPES),
124+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
125125
)
126126
window_nmse = compute_norm(window_mse, window_const_pred_mse)
127127

128128
window_rmse = compute_rmse(
129129
self.get_window_state(ERROR_SUM),
130-
self.get_window_state(WEIGHTED_NUM_SAMPES),
130+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
131131
)
132132
window_const_pred_rmse = compute_rmse(
133133
self.get_window_state(CONST_PRED_ERROR_SUM),
134-
self.get_window_state(WEIGHTED_NUM_SAMPES),
134+
self.get_window_state(WEIGHTED_NUM_SAMPLES),
135135
)
136136
window_nrmse = compute_norm(window_rmse, window_const_pred_rmse)
137137

0 commit comments

Comments
 (0)