Skip to main content

AdversarialTrainingPassesScenario

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.

Work per batch of adversarial training, in standard forward-backward passes (equal cost, no reuse).

Notes

Equation: Attack and update pass counts add, then divide by standard-pass count for relative work.

Assumptions: All declared forward-backward passes have equal cost and no reusable work.

Excludes: Actual kernel runtime, cache reuse, and attack effectiveness.

References

Derivation: Attack and update pass counts add, then divide by standard-pass count for relative work. 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.PgdSevenTraining
>>> round(float(scenario.passes), 4)
8.0

Attributes

Name Description
attack_passes
passes Total attack plus update passes per batch under equal-cost pass accounting.
slowdown Dimensionless adversarial pass count divided by standard training pass count.
standard_passes
update_passes

attack_passes

Type: int.

Declared default: required.

update_passes

Type: int.

Declared default: required.

standard_passes

Type: int.

Declared default: 1.

passes

engine.scenario_types.AdversarialTrainingPassesScenario.passes

Total attack plus update passes per batch under equal-cost pass accounting.

Equation: attack_passes + update_passes.

slowdown

engine.scenario_types.AdversarialTrainingPassesScenario.slowdown

Dimensionless adversarial pass count divided by standard training pass count.

Work multiple over standard training.

Equation: passes / standard_passes.

Back to top