[code] About the coach.py
diaodeyi opened this issue · comments
Hi , thanks for your great work! There are tow loss.backward()
in coach.py, is there any need for loss.backward(retain_graph=True)?
Because the Calculation graph will be cleared after backward() by default
It is ok that the graph will be cleared after the first forward pass. You perform the forward pass, perform backprop, and then clear the graph. And then you repeat the same thing for the cycle pass.
Thanks