Skip to content

Commit 33aef2a

Browse files
committed
minor improvement
Signed-off-by: Hao Wu <skyw@nvidia.com>
1 parent 611cc18 commit 33aef2a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

emerging_optimizers/orthogonalized_optimizers/polargrad.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(
136136
...
137137
alpha: float = 1.0,
138138
center_rows: bool = False,
139-
eps: float = 1e-8,
139+
eps: float = 1e-15,
140140
extra_scale_factor: float = 1.0,
141141
) -> None:
142142
scaled_orthogonalize_fn = functools.partial(
@@ -151,10 +151,10 @@ def __init__(
151151
)
152152
153153
Args:
154-
grad: The (momentum) tensor to orthogonalize, shape ``[m, n]`` with ``m >= n``.
154+
grad: The (momentum) tensor to orthogonalize.
155155
alpha: Exponent applied to the nuclear-norm scale factor.
156-
center_rows: If True, project onto the zero-row-mean subspace before and after the update,
157-
removing the shared logit-shift direction. Intended for LM-head matrices.
156+
center_rows: If True, subtract the per-column mean (the average over the row / vocabulary axis,
157+
``dim=0``) before and after the update, so each column is zero-mean.
158158
eps: Floor on the right-Gram eigenvalues for the inverse sqrt and nuclear-norm computation.
159159
extra_scale_factor: Extra multiplier on the update.
160160

0 commit comments

Comments
 (0)