opacus icon indicating copy to clipboard operation
opacus copied to clipboard

Missing zero_grad in text classifier tutorial

Open wulu473 opened this issue 5 years ago • 1 comments

The building_text_classifier.ipynb tutorial never calls optimizer.zero_grad(). The accumulated gradients should be zeroed after a step is taken.

wulu473 avatar Jul 03 '21 14:07 wulu473

zero_grad is not needed for opacus. Please see https://github.com/pytorch/opacus/pull/96

for more details

JohnlNguyen avatar Jul 06 '21 16:07 JohnlNguyen