Skip to content

How to update EMA only at desired steps #221

@dohyun1411

Description

@dohyun1411

Hi,

I am training my model (VQ + other models) with gradient accumulation.
Since the VQ module uses EMA updates at every forward pass,
it is difficult to align them with the gradient updates.

What I want is to accumulate the necessary data during forward passes,
but defer the actual EMA update until a specific step (e.g., when gradients are applied).

I also noticed a parameter, manual_ema_update.
Can this be used to manually trigger EMA updates at the right time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions