I’m facing trouble figuring out what is the difference between using
mx.autograd.backward to calculate gradients. The documentation doesn’t provide any difference. Once when I was optimizing 2 objective functions
loss2.backward() Then it shows error:
Check failed: !AGInfo::IsNone(*i) Cannot differentiate node because it is not in a computational graph. You need to set is_recording to true or use autograd.record() to save computational graphs for backward. If you want to differentiate the same graph twice, you need to pass retain_graph=True to backward.
While mx.autograph.backward([loss1, loss2]) works fine.
Any help is appreciated.