Noise Scheduler

class opacus.scheduler.ExponentialNoise(optimizer, *, gamma, last_epoch=-1)[source]

Decays the noise_multiplier by gamma every epoch. When last_epoch=-1, sets initial noise_multiplier as noise_multiplier.

Parameters:
  • optimizer (DPOptimizer) – Wrapped optimizer

  • gamma (float) – Multiplicative factor of learning rate decay.

  • last_epoch (int) – The index of last epoch

class opacus.scheduler.LambdaNoise(optimizer, *, noise_lambda, last_epoch=-1)[source]

Sets the noise_multiplier to the initial noise_multiplier times a given function. When last_epoch=-1, sets initial noise_multiplier as noise_multiplier.

Parameters:
  • optimizer (DPOptimizer) – Wrapped optimizer.

  • noise_lambda (Callable[[int], float]) – A function which computes a multiplicative factor given an integer epoch

  • last_epoch (int) – The index of last epoch. Default: -1.

class opacus.scheduler.StepNoise(optimizer, *, step_size, gamma, last_epoch=-1)[source]

Decays the noise_multiplier by gamma every step_size epochs. When last_epoch=-1, sets initial noise_multiplier as noise_multiplier.

Parameters:
  • optimizer (DPOptimizer) – Wrapped optimizer.

  • step_size (int) – Period of learning rate decay.

  • gamma (float) – Multiplicative factor of learning rate decay.

  • last_epoch (int) – The index of last epoch