Skip to content
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

network structure and training #1

Open
ZHANGRUI666 opened this issue Dec 6, 2019 · 2 comments
Open

network structure and training #1

ZHANGRUI666 opened this issue Dec 6, 2019 · 2 comments

Comments

@ZHANGRUI666
Copy link

respected author:
i have a puzzle that the three components: representation and dynamics as well as prediction network are constructed in one big conv network?
if they work seperately ,how to train them jointly and in 'end to end' fashion?
can you figure it out?

@YuriCat
Copy link
Owner

YuriCat commented Dec 6, 2019

Hi,
Constructing one big net is not necessary in this case.
You can tell an optimizer the whole parameters to train.
Following code will work.


rep, dyn, pre = Rep(), Dyn(), Pre()
params = list(rep.parameters()) + list(dyn.parameters()) + list(pre.parameters())
opt = optim.SGD(params, lr=1e-3)

... (forward and backward computation in the same way)

@ZHANGRUI666
Copy link
Author

ZHANGRUI666 commented Dec 7, 2019

So cute! your reply helps me a lot and the program is exellent 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants