Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to ExperimentDescriptionAPI #3679

Merged
merged 4 commits into from
Jun 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions src/nupic/frameworks/opf/exp_description_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,39 @@ def convertNupicEnvToOPF(self):


class ExperimentDescriptionAPI(DescriptionIface):
"""
TODO: Document this.
"""Interface for specifying OPF experiments.

This class is used to specify the model and control parameters for an OPF
experiment. The model config includes the necessary information for
constructing an OPF model and the control includes information about the
environment, where to get the data from, etc.

The experiment_runner takes an instance of this class as the description
of the experiment to run. Similarly, scripts/run_opf_experiment.py looks
for an instance of this class in a variable called `descriptionInterface`
in the experiment files that are passed to it.

:param modelConfig: (dict) a specification of the model to use, including
the following keys:
model: the name of the OPF model to create
version: the config format version to use
modelParams: parameters to pass to the OPF model
There may be other required fields such as predictionSteps,
predictedField, and numRecords
:param control: (dict): a specification of the experimental setup,
including the following keys:
environment: the environment that the model will be run in
dataset: input specification as defined in
`src/nupic/frameworks/opf/jsonschema/stream_def.json`
iterationCount: maximum number of iterations, or -1 to iterate
until the data source is exhausted
inferenceArgs: a dict containing all the supplementary parameters
for inference, including "predictedField" and "predictionSteps"
metrics: a list of MetricSpec instances that specify the metrics to
compute during this experiment
loggedMetrics: a sequence of regular expression strings that specify
which metrics should be logged at each iteration of the
experiment
"""

def __init__(self, modelConfig, control):
Expand Down