Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support weight reparametrization #2738

Open
kitterion opened this issue Jan 23, 2025 · 1 comment
Open

Support weight reparametrization #2738

kitterion opened this issue Jan 23, 2025 · 1 comment
Labels
feature The feature request

Comments

@kitterion
Copy link
Contributor

Feature description

It would be nice if burn supported some way to apply weight reparametrization to layers like found in pytorch (e.g. weight_norm, spectral_norm).

Feature motivation

pytorch docs provide a decent explanation and relevant links but in short, this can stabilize training of certain networks.

(Optional) Suggest a Solution

In the current design this kind of api probably belongs on Param since dynamically replacing fields, like pytorch does, is not really feasible. Param would have to switch out implementations based on a particular reparametrization.

@laggui laggui added the feature The feature request label Jan 24, 2025
@nathanielsimard
Copy link
Member

You can use a visitor pattern to apply a transformation to each weight, similar to how the optimizer works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature The feature request
Projects
None yet
Development

No branches or pull requests

3 participants