Skip to content

EMA Update kernel #24

Description

@superposition

Description

Exponential moving average update for target networks (momentum encoders).

Operation

# Update target params: target = tau * target + (1 - tau) * source
ema_update(target_params, source_params, tau=0.999)

Implementation

  • Fused kernel for all parameters
  • In-place update (no allocation)
  • Support for parameter groups with different tau

Tests

  • Correct EMA formula applied
  • In-place modification of target
  • Works with tau=0 (copy) and tau=1 (no-op)
  • Handles multiple parameter tensors
  • No gradients through target (detached)

Used In

JEPA, BYOL, MoCo, EMA model averaging, Polyak averaging

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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