Calling a different method post training #2781
Answered
by
IvyZX
shenoynikhil
asked this question in
General
-
I have a variational autoencoder from which I want to generate images. Post training, my VAE model class has a separate function for generating images from gaussian noise, from flax import linen as nn
class VAE(nn.Module):
def generate_samples(self, num_samples): How do I call this method with say a |
Beta Was this translation helpful? Give feedback.
Answered by
IvyZX
Jan 9, 2023
Replies: 1 comment
-
You can directly access the parameters from For example for |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
shenoynikhil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can directly access the parameters from
state.params
. Then you can call your own method with it.For example for
nn.Module
'sapply()
, you can run inference like:model.apply({'params': state.params}, x)