New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When finetuning, previous networks are kept fixed? #31
Comments
These lines ensure that the previous network outputs are assumed to be static (and thus avoid feeding back gradients through these networks): https://github.com/simonmeister/UnFlow/blob/master/src/e2eflow/core/flownet.py#L51 |
Oh, I get it, thank you very much. |
No problem! If you only want to add a few layers, you would need to insert the stop gradients directly before these layers in the flownet code, but it shouldn't be too hard. |
But in fact I want to finetune the first layer in every networks to adapt my 1 channel input image. |
Ah so i am unsure if what you want to do would work (from the learning side of things). Technically it would be easy to filter out variables by name if you collect the gradients manually and then update the variables by using apply_gradients. However, if you modify previous layers without adapting the later layers, i think you would run into problems with the learning, as the later layers can't adapt to the changing inputs and can't make sense of your "improved" representations from earlier layers. I would either re-train from scratch, or fine-tune end-to-end or you could maybe really try to just copy the channels first. |
Hi, Simmon!
Thanks for your wonderful code!
But I have some questions now, please give me some advices.
When finetuning, such as use the UnFlowC experiment for first network and UnFlowCS for the second network when training UnFlowCSS, you said that only the final network is trained and any previous networks are kept fixed.
But I can't figure out how you make the previous networks fixed in code, are there any settings in code to make sure the previous networks are fixed?
Please give me some clues, thank you very much!!
The text was updated successfully, but these errors were encountered: