Skip to content

Commit 63c5468

Browse files
authored
Fixing incorrect masking rate in masking rate sampling (ecmwf#247)
* added paranthesis to 1.0 / (2.5 * np.pi) * comitting nonsense * reverted nonsense * ran ruff again
1 parent 929b3fe commit 63c5468

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/weathergen/datasets/tokenizer_masking.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ def batchify_source(
156156
# mask either patches or entire stream
157157
if masking_rate_sampling:
158158
cur_masking_rate = np.clip(
159-
np.abs(self.rng.normal(loc=cur_masking_rate, scale=1.0 / 2.5 * np.pi)), 0.0, 1.0
159+
np.abs(self.rng.normal(loc=cur_masking_rate, scale=1.0 / (2.5 * np.pi))),
160+
0.0,
161+
1.0,
160162
)
161163

162164
tokenize_window = partial(

0 commit comments

Comments
 (0)