pipeline.simple

Simple simulation pipeline.

class pipeline.simple.SimpleSimulator(configuration: dict | str, data: Data | Tensor = None, **kwargs)

A prototypical simulation pipeline, bringing together data loading, network construction, model specification, disk I/O, and visualization.

This pipeline can be configured by providing a dictionary or a path to a YAML.

Parameters:
  • configuration (dict or str) – Pipeline script configuration dictionary or path to YAML.

  • data (Data or Tensor, optional) – Sapicore Data object or Tensor to use during model training.

Note

For a more complex demonstration involving data processing, selection, sampling, and cross-validation, see tutorials/basic_experiment.py. If using this script with data (be it Data or Tensor), it should be curated and coerced to the shape buffer X labels ahead of time.

initialize(seed: int = None)

Initializes the pipeline. Validates data object and project root path given in the configuration, sets random number generation seed, and applies log message configuration.

Parameters:

seed (int, optional) – Random seed to be used throughout the simulation. Applied to all relevant libraries. If not provided, looks up “seed” in the configuration dictionary. If not found, the project default utils.constants.SEED is used to ensure reproducibility.

Warning

Deterministic behavior is vital when conducting reproducible experiments. This is one of many safeguards included in Sapicore. Users who wish to modify this default behavior will have to consciously override initialize().

run()

Runs the generic simulator pipeline based on the given configuration.