Usage of pyro.module in model and guide

I am going over the tutorials to understand how to register networks with pyro.module. I see in many of the examples that a network is registered either in the model or guide (e.g., in a simple VAE, the encoder is registered in the guide, and the decoder is registered in the model) and that makes sense to me. However, a network has been registered both in the model and guide in scANVI example and I don’t understand why it is registered twice. Could you please elaborate on when/where a network should be registered?

it doesn’t matter where it’s registered or how many times as long as it’s at least once

2 Likes