Separating guide and model parameters in svi.step() function to perform aggressive training of inference network


#1

Hi,

To avoid latent variable collapse when using auto-regressive decoders, I found this easy to implement idea mentioned in the paper. The idea (See Algorithm 1) is to optimize the inference network more aggressively in the first few epochs and then let the normal VAE training take over.

I believe that we can implement it by separating out guide and model parameters in step function in svi.py class at this line.

Any pointers on how i can separate out the guide and model parameters in the step function?

Thanks


#2

I think, i can separate parameters here: https://github.com/pyro-ppl/pyro/blob/dev/pyro/infer/trace_elbo.py#L130

Do you think its the correct approach?


#3

Sorry, my bad.

Looking at their code: https://github.com/jxhe/vae-lagging-encoder/blob/master/toy.py#L506

They are using two different optimizers for encoder and decoder parameters. That would be easy to do in Pyro (http://pyro.ai/examples/custom_objectives.html#Basic-SVI-Usage)