Question concerning usage of Sequential model. #3619
Answered
by
errhernandez
errhernandez
asked this question in
Q&A
-
Hello! I am using Sequential to construct my model by concatenating different types of layers. If I wanted to freeze parameters associated to different layers, or apply different learning rates to different layers, how can this be done? In pytorch one can use an ordered dict to name different layers in Sequential, but this appears not to be possible in PyG's version of Sequential. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
errhernandez
Dec 2, 2021
Replies: 1 comment 1 reply
-
Ok, I think I now know; it is simple enough: for layer in model.children():
for name, parameter in layer.named_parameters():
'do whatever with them here, for example:'
print( name, parametr.shape ) Sorry for asking trivialities; I'm still learning ;-) I hope this is useful to someone. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
errhernandez
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I think I now know; it is simple enough:
Sorry for asking trivialities; I'm still learning ;-) I hope this is useful to someone.