Skip to main content

ParadigmCostScenario

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.

One input classified three ways: hand-written rules, engineered features, and a learned network.

Rules: rule_comparisons comparisons over the raw pixels. Features: a feature_grid by feature_grid grid of cells, feature_bins orientation bins each, feature_operations operations in feature_memory of working state. Network: network’s MACs.

Notes

Equation: Rule image storage is pixel_count*pixel_width; a feature grid has grid**2*bins entries.

Assumptions: The three supplied work budgets refer to the same input but may count different operation kinds.

Excludes: Accuracy equivalence and conversion of work-count ratios into latency ratios.

References

Derivation: The rule path stores one value per image pixel. The feature path places a fixed number of orientation bins in every grid cell. The neural path obtains MACs from DenseNetworkModel. Their count ratios compare declared work categories rather than pretending comparisons and MACs have identical costs.

Examples

>>> from mlsysim import Scenarios
>>> s = Scenarios.DigitRecognitionParadigms
>>> s.feature_count == s.feature_grid**2 * s.feature_bins
True

Attributes

Name Description
bytes_per_pixel
feature_bins
feature_count Engineered feature count: orientation bins for each cell in the square grid.
feature_grid
feature_memory
feature_operations
feature_to_rule_ratio Dimensionless engineered-feature operations divided by rule comparisons; these are different operation categories.
image_pixels
network
network_to_rule_ratio Dimensionless network MACs divided by rule comparisons; this is a work-count contrast, not a latency ratio.
rule_comparisons
rule_memory Raw image storage in bytes assumed accessible to the handwritten-rule classifier.

image_pixels

Type: int.

Declared default: required.

bytes_per_pixel

Type: Quantity.

Declared default: required.

rule_comparisons

Type: int.

Declared default: required.

feature_grid

Type: int.

Declared default: required.

feature_bins

Type: int.

Declared default: required.

feature_operations

Type: int.

Declared default: required.

feature_memory

Type: Quantity.

Declared default: required.

network

Type: DenseNetworkScenario.

Declared default: required.

rule_memory

engine.scenario_types.ParadigmCostScenario.rule_memory

Raw image storage in bytes assumed accessible to the handwritten-rule classifier.

Equation: (image_pixels * bytes_per_pixel).to('byte').

feature_count

engine.scenario_types.ParadigmCostScenario.feature_count

Engineered feature count: orientation bins for each cell in the square grid.

Equation: feature_grid ** 2 * feature_bins.

feature_to_rule_ratio

engine.scenario_types.ParadigmCostScenario.feature_to_rule_ratio

Dimensionless engineered-feature operations divided by rule comparisons; these are different operation categories.

Equation: feature_operations / rule_comparisons.

network_to_rule_ratio

engine.scenario_types.ParadigmCostScenario.network_to_rule_ratio

Dimensionless network MACs divided by rule comparisons; this is a work-count contrast, not a latency ratio.

Equation: network.result.macs_per_example / rule_comparisons.

Back to top