Experiment Runner

This script provides the runExperiment() API function that is used by the command-line client run_opf_experiment.py of Online Prediction Framework (OPF). It executes a single experiment.

This runner is generally run through scripts/run_opf_experiment.py.

experiment_runner.runExperiment(args, model=None)

Run a single OPF experiment.


The caller is responsible for initializing python logging before calling this function (e.g., import nupic.support; nupic.support.initLogging())

See also: initExperimentPrng().

  • args

    (string) Experiment command-line args list. Too see all options, run with --help:

      -h, --help           show this help message and exit
      -c <CHECKPOINT>      Create a model and save it under the given <CHECKPOINT>
                           name, but don't run it
      --listCheckpoints    List all available checkpoints
      --listTasks          List all task labels in description.py
      --load=<CHECKPOINT>  Load a model from the given <CHECKPOINT> and run it.
                           Run with --listCheckpoints flag for more details.
      --newSerialization   Use new capnproto serialization
      --tasks              Run the tasks with the given TASK LABELS in the order
                           they are given.  Either end of arg-list, or a
                           standalone dot ('.') arg or the next short or long
                           option name (-a or --blah) terminates the list. NOTE:
                           FAILS TO RECOGNIZE task label names with one or more
                           leading dashes. [default: run all of the tasks in
      --testMode           Reduce iteration count for testing
      --noCheckpoint       Don't checkpoint the model after running each task.
  • model – (Model) For testing, may pass in an existing OPF Model to use instead of creating a new one.

(Model) reference to OPF Model instance that was constructed (this is provided to aid with debugging) or None, if none was created.


Initialize PRNGs that may be used by other modules in the experiment stack.


User may call this function to initialize PRNGs that are used by the experiment stack before calling runExperiment(), unless user has its own own logic for initializing these PRNGs.