FCLayers bias' gradient set to 0

I was wondering why do you set gradient of the bias in FCLayers to 0? scvi-tools/_base_components.py at 2472b76572672fb9c98755522fa3c7326a946444 · scverse/scvi-tools · GitHub I thought it is decided if bias is used here scvi-tools/_base_components.py at 2472b76572672fb9c98755522fa3c7326a946444 · scverse/scvi-tools · GitHub so I do not see why allowing to set it but not to update it.
Or do I misunderstand? - I noticed this as my scvi-tools based model is not updating the biases so it seems that the set_online_update_hooks function must be called somewhere.

Hi, thank you for your question. I believe set_online_update_hooks is only used for scArches, where we want a subset of the pre-trained layers to be frozen when training on query data. If I’m not mistaken, these hooks aren’t there during normal model training.

Could you send a reproducible code snippet where your biases are not being updated? Thanks.

I checked with the SCVI model and there all looks ok so I will try to figure out what is off with my model. Thank you for the quick response.

1 Like