Skip to content

How would I reparametrize nnx.Module parameters? #4546

Closed Answered by cgarciae
aniquetahir asked this question in Q&A
Discussion options

You must be logged in to vote

@aniquetahir can you create a separate optimizer for new_model (maybe call it sampled_model) at the begging and then simply update it after sampling its params? E.g.

# on init
model = ...
sampled_model = nnx.clone(model)
sampled_optimizer = nnx.Optimizer(sampled_model, ...)
... # later
logits, params = model(data)
nnx.update(sampled_model, params)

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@aniquetahir
Comment options

@cgarciae
Comment options

@aniquetahir
Comment options

@cgarciae
Comment options

Answer selected by aniquetahir
@aniquetahir
Comment options

@aniquetahir
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants