Holding parameters constant

Hi folks!

I was wondering if there’s an easy way to hold parameters fixed while performing VI? Specifically, I’d like to use H.substitute to set parameters to specific values and then keep them constant.

Thanks so much :slight_smile:

If you use substitute handler, I think they should be constant. You can also jax.lax.stop_gradient it.

1 Like

I tried the substitute handler before and it didn’t seem to work… Instead I mask the parameters in the optax optimizer as described here.