pytorch / opacus

Training PyTorch models with differential privacy
https://opacus.ai
Apache License 2.0
1.65k stars 328 forks source link

Fixing the corner case when the optimizer has no trainable parameters #619

Closed HuanyuZhang closed 5 months ago

HuanyuZhang commented 5 months ago

Summary: We made the following changes:

  1. We has fixed the corner case when the optimizer has no trainable parameters. This might happen when there are more than one optimizers while some of them are frozen during the fine-tuning.
  2. We have changed the "closure" logic in the "step" function in "ddpoptimizer.py", to make it consistent with "optimizer.py".

Differential Revision: D53055273

facebook-github-bot commented 5 months ago

This pull request was exported from Phabricator. Differential Revision: D53055273

facebook-github-bot commented 5 months ago

This pull request was exported from Phabricator. Differential Revision: D53055273

facebook-github-bot commented 5 months ago

This pull request has been merged in pytorch/opacus@f4dc430b09f917a87f9222903fc511d441049258.