ReinforcementLearningConfiguration Class
Represents configuration for reinforcement learning runs targeting Azure Machine Learning compute targets.
ReinforcementLearningConfiguration object encapsulates the information necessary to submit a reinforcement learning run in an experiment. It includes information about head, workers and compute targets to execute experiment runs on.
- Inheritance
-
azureml._base_sdk_common.abstract_run_config_element._AbstractRunConfigElementReinforcementLearningConfiguration
Constructor
ReinforcementLearningConfiguration(head_configuration, worker_configuration, max_run_duration_seconds=None, cluster_coordination_timeout_seconds=None, source_directory=None, _path=None, _name=None, framework=None)
Parameters
- head_configuration
The configuration for head.
- max_run_duration_seconds
- int
The maximum allowed time for the run in seconds. Azure ML will attempt to automatically cancel the job if it takes longer than this value.
- cluster_coordination_timeout_seconds
- int
The maximum time in seconds that the job can take to start once it has passed the queued state.
- framework
- RLFramework
Orchestration framework to be used in the experiment. The default is Ray version 0.8.0
Methods
load |
Load a previously saved reinforcement learning run configuration file from an on-disk file. If If |
save |
Save the ReinforcementLearningConfiguration to a file on disk. A UserErrorException is raised when:
If If This method is useful when editing the configuration manually or when sharing the configuration with the CLI. |
load
Load a previously saved reinforcement learning run configuration file from an on-disk file.
If path
points to a file, the ReinforcementLearningConfiguration is loaded from that file.
If path
points to a directory, which should be a project directory, then the
ReinforcementLearningConfiguration is loaded from
<path>/.azureml/<name> or <path>/aml_config/<name>.
static load(path=None, name=None)
Parameters
- path
- str
A user selected root directory for run configurations. Typically this is the Git Repository or the Python project root directory. For backward compatibility, the configuration will also be loaded from .azureml or aml_config sub directory. If the file is not in those directories, the file is loaded from the specified path. Path defaults to current working directory if not provided.
Returns
The reinforcement learning run configuration object.
Return type
save
Save the ReinforcementLearningConfiguration to a file on disk.
A UserErrorException is raised when:
The ReinforcementLearningConfiguration can't be saved with the name specified.
No
name
parameter was specified.No
path
parameter is invalid.
If path
is of the format <dir_path>/<file_name> where <dir_path> is a valid directory, then the
ReinforcementLearningConfiguration is saved at <dir_path>/<file_name>.
If path
points to a directory, which should be a project directory, then the
ReinforcementLearningConfiguration is saved at
<path>/.azureml/<name> or <path>/aml_config/<name>.
This method is useful when editing the configuration manually or when sharing the configuration with the CLI.
save(path=None, name=None, separate_environment_yaml=False)
Parameters
- separate_environment_yaml
- bool
Indicates whether to save the Conda environment configuration. If True, the Conda environment configuration is saved to a YAML file named '_environment.yml'.
- path
- str
A user selected root directory for run configurations. Typically this is the Git Repository or the Python project root directory. The configuration is saved to a sub directory named .azureml.
Return type
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for