Skip to content

feat: add clamp/clip autograd gate for gradient clipping #159

Description

@ulises-jeremias

Training stability requires gradient clipping, but there's no clamp/clip gate
in the autograd engine. The forward pass is min(max(x, lo), hi); gradient is
zero outside the bounds, 1 inside.

Task

Add autograd/gates_basic.v or new gates_clip.v with forward and backward.
Wire into nn/optimizers/ as a clipper option (clip_grad_norm or clip_grad_value).

Files

  • autograd/gates_basic.v or new autograd/gates_clip.v
  • nn/optimizers/ — add clip option

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions