Skip to content

StableAdamW: Missing divisor in RMS computation #27

@EricZimmermann

Description

@EricZimmermann

Hello

It seems as though there is a minor error in computing RMS in Stable Adam:

RMS is computed as:

rms = torch.norm(p.grad.data.div(root_sqr_avg.maximum(eps_t)), 2)

And is missing a normalization coefficient for the mean:
rms = torch.norm(p.grad.data.div(root_sqr_avg.maximum(eps_t)), 2) / math.sqrt(p.grad.data.div.numel())

as per
image

Additionally, another eps can be added in the final normalization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions