Skip to main content

DpSgdRunScenario

Training scenarios · Implementation: mlsysim/engine/scenario_definitions/training.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

Inputs a DP-SGD privacy accountant needs for one Poisson-sampled run on dataset_size examples; this type does not estimate epsilon.

Notes

Equation: Batch-to-dataset ratio specifies sampling; epochs times dataset size divided by batch size specifies steps.

Assumptions: The caller supplies DP-SGD training choices and an intended privacy target.

Excludes: Computation or certification of epsilon, gradient clipping behavior, and remainder-batch handling beyond integer truncation.

References

Derivation: Batch-to-dataset ratio specifies sampling; epochs times dataset size divided by batch size specifies steps. Individual property contracts identify the exact accounting expression or reusable calculation. Registry entries supply the scenario inputs; this class does not turn them into measured outcomes.

Examples

Evaluate a named scenario using its declared inputs.

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.Cifar10DpSgdRun
>>> round(float(scenario.sampling_rate), 4)
0.08

Attributes

Name Description
batch_size
clip_norm
dataset_size
delta
epochs
noise_multiplier
sampling_rate Poisson sample probability per step, approximated by batch size divided by dataset size.
steps Integer training-step count for the declared epochs, truncating a fractional final
target_epsilon

dataset_size

Type: int.

Declared default: required.

batch_size

Type: int.

Declared default: required.

clip_norm

Type: float.

Declared default: required.

noise_multiplier

Type: float.

Declared default: required.

epochs

Type: int.

Declared default: required.

target_epsilon

Type: float.

Declared default: required.

delta

Type: float.

Declared default: required.

sampling_rate

engine.scenario_types.DpSgdRunScenario.sampling_rate

Poisson sample probability per step, approximated by batch size divided by dataset size.

Equation: batch_size / dataset_size.

steps

engine.scenario_types.DpSgdRunScenario.steps

Integer training-step count for the declared epochs, truncating a fractional final batch.

Equation: int(epochs * dataset_size / batch_size).

Back to top