IAccountant

class opacus.accountants.accountant.IAccountant[source]
abstract get_epsilon(delta, *args, **kwargs)[source]

Return privacy budget (epsilon) expended so far.

Parameters
  • delta (float) – target delta

  • *args – subclass-specific args

  • **kwargs – subclass-specific kwargs

Return type

float

get_optimizer_hook_fn(sample_rate)[source]

Returns a callback function which can be used to attach to DPOptimizer :type sample_rate: float :param sample_rate: Expested samping rate used for accounting

Return type

Callable[[DPOptimizer], None]

abstract classmethod mechanism()[source]

Accounting mechanism name

Return type

str

abstract step(*, noise_multiplier, sample_rate)[source]

Signal one optimization step

Parameters
  • noise_multiplier (float) – Current noise multiplier

  • sample_rate (float) – Current sample rate