Skip to main content

OutputShapingScenario

Reliability scenarios · Implementation: mlsysim/engine/scenario_definitions/reliability.py.

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

An API that returns the top top_k of class_count scores, rounded from from_decimals to to_decimals decimal places.

Notes

Equation: Entry fractions count retained scores; log-two level counts express decimal representation sizes in bits.

Assumptions: Positive top-k count and decimal rounding of scores in [0,1].

Excludes: An attack-success model or information-theoretic privacy guarantee.

References

Derivation: Entry fractions count retained scores; log-two level counts express decimal representation sizes in bits. 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.ImageNetTop5RoundedScores
>>> round(float(scenario.scores_reduction), 4)
200.0

Attributes

Name Description
bits_removed Log-two count of the removed decimal bins, in bits; this is a representation count, not
class_count
decimal_digits_removed Number of decimal places removed from each returned score.
entries_removed Fraction of score entries suppressed by returning only the top-k entries.
from_decimals
retained_bits Log-two count of the retained score levels including both endpoints of [0,1].
scores_reduction Dimensionless full-score count divided by returned top-k score count.
to_decimals
top_k

class_count

Type: int.

Declared default: required.

top_k

Type: int.

Declared default: required.

from_decimals

Type: int.

Declared default: required.

to_decimals

Type: int.

Declared default: required.

scores_reduction

engine.scenario_types.OutputShapingScenario.scores_reduction

Dimensionless full-score count divided by returned top-k score count.

Times fewer scores per answer than returning every class.

Equation: class_count / top_k.

entries_removed

engine.scenario_types.OutputShapingScenario.entries_removed

Fraction of score entries suppressed by returning only the top-k entries.

Equation: 1 - top_k / class_count.

decimal_digits_removed

engine.scenario_types.OutputShapingScenario.decimal_digits_removed

Number of decimal places removed from each returned score.

Equation: from_decimals - to_decimals.

bits_removed

engine.scenario_types.OutputShapingScenario.bits_removed

Log-two count of the removed decimal bins, in bits; this is a representation count, not a privacy guarantee.

Bits per score removed under a decimal-bin count.

Equation: calc_level_bits(10 ** decimal_digits_removed).

retained_bits

engine.scenario_types.OutputShapingScenario.retained_bits

Log-two count of the retained score levels including both endpoints of [0,1].

Bits left in a score in [0, 1] at to_decimals places (10^d + 1 levels).

Equation: calc_level_bits(10 ** to_decimals + 1).

Back to top