Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/timesfm/flax/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@


class RMSNorm(nnx.Module):
"""RMS normalization."""
"""RMS normalization.

The scale is initialized to zeros on purpose: a freshly constructed layer
outputs zeros, so at init the residual connection carries the signal.
Loading a checkpoint overwrites the scale. See
`test_zero_scale_produces_zeros` in tests/test_torch_layers.py.
"""

__data__ = ("scale",)

Expand Down
8 changes: 7 additions & 1 deletion src/timesfm/torch/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@


class RMSNorm(nn.Module):
"""RMS normalization."""
"""RMS normalization.

The scale is initialized to zeros on purpose: a freshly constructed layer
outputs zeros, so at init the residual connection carries the signal.
Loading a checkpoint overwrites the scale. See
`test_zero_scale_produces_zeros` in tests/test_torch_layers.py.
"""

def __init__(
self,
Expand Down
Loading