-
Hi everyone, However I have a perplexity. During the tutorial the classic training pipeline was:
But, chatting about it, chatGPT says:
Can you clarify this aspect please? Thank you so much! 👍🏼 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi AloscariS, Both approaches are fine to use. The important thing is to reset the gradients before you calculate the new ones. I don't know why chatGPT considers the placement from the tutorial "unconventional". Perhaps, chatGPT was trained on more examples where Best wishes. |
Beta Was this translation helpful? Give feedback.
-
I think the gradients will keep unchanged during the Forward pass and Calculate the Loss, the gradients are only changed during the Backward Pass, so you only need to place |
Beta Was this translation helpful? Give feedback.
I think the gradients will keep unchanged during the Forward pass and Calculate the Loss, the gradients are only changed during the Backward Pass, so you only need to place
optimizer.zero_grad()
before the Backward Pass.