Azure Machine Learning Experiment Creation
AMLExperiment
Source code in azure_helper/steps/create_aml_experiment.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
__init__(aml_interface, aml_compute_name, aml_compute_instance, env_name, experiment_name, training_script_path, min_node=1, max_node=2, clean_after_run=True)
Instantiate the creation of an AzureML Experiment needed to train a model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aml_interface |
AMLInterface
|
The aml_interface needed to register the experiment in the workspace. |
required |
aml_compute_name |
str
|
The name of the compute instance used. |
required |
aml_compute_instance |
str
|
The size (as in |
required |
min_node |
int
|
The minimum number of nodes to use on the compute instance. Defaults to 1. |
1
|
max_node |
int
|
The maximum number of nodes to use on the compute instance. Defaults to 2. |
2
|
env_name |
str
|
The name of the training environment. |
required |
experiment_name |
str
|
The name of the experiment. |
required |
training_script_path |
str
|
The path to the training loop script. |
required |
clean_after_run |
bool
|
Whether or not you want to delete the compute instance after training. Defaults to True. |
True
|
Source code in azure_helper/steps/create_aml_experiment.py
generate_run_config()
Generate the run configuration of the experiment.
By definition, the run configuration is the combination of the training environment and the compute instance.
Returns:
Name | Type | Description |
---|---|---|
RunConfiguration |
RunConfiguration
|
The run configuration of the experiment. |
Source code in azure_helper/steps/create_aml_experiment.py
submit_pipeline(steps)
Used to submit a training pipeline.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
steps |
List[PythonScriptStep]
|
The different steps of the training pipeline. |
required |
This should be a registered AZML Pipeline with the followings steps :
- Download raw datas from one datastore
- Transform those datas in "gold" datas and store them in another datastore
- Use these gold datas to train a model
- Evaluate that model
- Save and version that model
Source code in azure_helper/steps/create_aml_experiment.py
submit_run()
Submit your training loop and create an experiment.
This experiment is defined by the use of the ScriptRunConfig
class.
This means that you have to provide the path to a script defining your training loop, defined by the parameters
source_directory
and script
of the ScriptRunConfig
class, script
being the path of your training loop
relative to source_directory
.
For example purpose, a training loop example is provided TrainingLoopExample is provided, as well as an abstract class if you want to use this training loop structure, but you're not forced to.