nip.utils.experiments

nip.utils.experiments#

Experiment runners.

Contains utilities for running hyperparameter experiments. These can be run either sequentially or in parallel using a pool of workers.

The workflow is as follows:

  1. Call the constructor with the hyperparameter grid and the experiment function.

  2. (Optional) Add any additional arguments to the arg parser using experiment.parser.add_argument.

  3. Call experiment.run() to run the experiment.

See the docstrings of the classes for more details.

Functions

_identity(string)

Return the input string.

Classes

ExperimentFunctionArguments(combo, run_id, ...)

Arguments to the function which runs a single experiment.

HyperparameterExperiment(param_grid, ...[, ...])

A base class to run an experiment over a grid of hyperparameters.

MultiLineFormatter([fmt, datefmt, style, ...])

Multi-line formatter.

MultiprocessHyperparameterExperiment(...[, ...])

A class to run an experiment over a grid of hyperparameters in parallel.

PrefixLoggerAdapter(logger, prefix)

A logger adapter that adds a prefix to the log message.

SequentialHyperparameterExperiment(...[, ...])

A class to run an experiment over a grid of hyperparameters in sequence.

TqdmMultiProcessPoolMaxTasks(process_count)

A TqdmMultiProcessPool that allows setting maxtasksperchild.