mlrl.testbed.modes.mode module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides base classes for implementing different modes of operation.

class mlrl.testbed.modes.mode.InputMode

Bases: Mode, ABC

An abstract base class for all modes of operation that access the meta-data of an earlier experiment.

INPUT_DIR = <mlrl.util.cli.PathArgument object>
configure_algorithmic_arguments(cli: CommandLineInterface, algorithmic_arguments: list[Argument])

Must be implemented by subclasses in order to configure the command line interface according to the mode of operation.

Parameters:
  • cli – The command line interface to be configured

  • algorithmic_arguments – The arguments that should be added to the command line interface for configuring the algorithm’s hyperparameters

configure_control_arguments(cli: CommandLineInterface, control_arguments: list[Argument])

Must be implemented by subclasses in order to configure the command line interface according to the mode of operation.

Parameters:
  • cli – The command line interface to be configured

  • control_arguments – The arguments that should be added to the command line interface for controlling mlrl-testbed’s behavior

run_experiment(control_arguments: set[Argument], algorithmic_arguments: set[Argument], args: Namespace, recipe: Recipe)

Must be implemented by subclasses in order to run an experiment according to the command line arguments specified by the user.

Parameters:
  • control_arguments – The arguments that should be added to the command line interface for controlling mlrl-testbed’s behavior

  • algorithmic_arguments – The arguments that should be added to the command line interface for configuring the algorithm’s hyperparameters

  • args – The command line arguments specified by the user

  • recipe – A Recipe that provides access to the ingredients that are needed for setting up experiments

class mlrl.testbed.modes.mode.Mode

Bases: ABC

An abstract base class for all modes of operation.

MODE = <mlrl.util.cli.SetArgument object>
abstractmethod configure_algorithmic_arguments(cli: CommandLineInterface, algorithmic_arguments: list[Argument])

Must be implemented by subclasses in order to configure the command line interface according to the mode of operation.

Parameters:
  • cli – The command line interface to be configured

  • algorithmic_arguments – The arguments that should be added to the command line interface for configuring the algorithm’s hyperparameters

abstractmethod configure_control_arguments(cli: CommandLineInterface, control_arguments: list[Argument])

Must be implemented by subclasses in order to configure the command line interface according to the mode of operation.

Parameters:
  • cli – The command line interface to be configured

  • control_arguments – The arguments that should be added to the command line interface for controlling mlrl-testbed’s behavior

abstractmethod run_experiment(control_arguments: set[Argument], algorithmic_arguments: set[Argument], args: Namespace, recipe: Recipe)

Must be implemented by subclasses in order to run an experiment according to the command line arguments specified by the user.

Parameters:
  • control_arguments – The arguments that should be added to the command line interface for controlling mlrl-testbed’s behavior

  • algorithmic_arguments – The arguments that should be added to the command line interface for configuring the algorithm’s hyperparameters

  • args – The command line arguments specified by the user

  • recipe – A Recipe that provides access to the ingredients that are needed for setting up experiments

abstractmethod to_enum() ExperimentMode

Returns the ExperimentMode that corresponds to this mode of operation.

Returns:

An ExperimentMode