utilities 模块

用于与 AutoMLPipelineBuilder 交互的实用工具方法。

函数

get_automl_environment

获取用于许多模型或 hts 的 automl 环境。

get_automl_environment(workspace: azureml.core.workspace.Workspace, automl_settings_dict: Dict[str, Any]) -> azureml.core.environment.Environment

参数

workspace
automl_settings_dict

get_default_inference_env

通过提供 train_run_id 和 train_experiment_name 获取默认推理环境。

get_default_inference_env(experiment: azureml.core.experiment.Experiment, train_run_id: str, train_experiment_name: str, step_name: str) -> azureml.core.environment.Environment

参数

experiment
train_run_id
train_experiment_name
step_name

get_module_file_abs_path

获取绝对文件路径。

get_module_file_abs_path(file_module: Any) -> pathlib.Path

参数

file_module

get_output_datastore_and_file

获取输出数据存储和输出数据文件的位置。 如果输入为数据文件,则 None 将作为默认数据存储返回。

get_output_datastore_and_file(output: Union[azureml.data.output_dataset_config.OutputDatasetConfig, azureml.core.datastore.Datastore], output_name: str, pipeline_output_name: Optional[str] = None) -> Tuple[Optional[azureml.core.datastore.Datastore], Union[azureml.data.output_dataset_config.OutputDatasetConfig, azureml.pipeline.core.builder.PipelineData]]

参数

output
必需

将使用的输出位置。 它可以是一个作为目录的数据存储,也可以是一个 OutputDatasetConfig。

output_name
必需

PipelineData 的输出名称。

pipeline_output_name
默认值: None

管道的输出名称。

返回

包含输出数据存储和数据文件的元组。

get_output_from_mm_pipeline

从多个模型管道获取输出数据文件。

注意:此方法使用shutil.rmtree(results_name)删除整个提供的目录树。

get_output_from_mm_pipeline(run: azureml.core.run.Run, results_name: str, output_name: str, parallel_run_output_file_name: Optional[str] = None) -> Optional[str]

参数

run
必需

运行的运行对象。

results_name
必需

将下载输出文件的目录。

output_name
必需

如果未手动配置输出的名称,则为“many_models_inference_output”或“many_models_training_output”。

parallel_run_output_file_name
默认值: None

并行运行输出文件的名称 (可选,默认值为“parallel_run_step.txt”) 。

返回

包含下载的输出文件的路径或 None 出现任何错误的字符串。

get_step_run_env

获取管道步骤的环境。

get_step_run_env(automl_settings: Dict[str, Any], jasmine_client: azureml._restclient.jasmine_client.JasmineClient, compute: Union[str, azureml.core.compute.compute.ComputeTarget], compute_sku: str, _workspace: Optional[azureml.core.workspace.Workspace] = None) -> azureml.core.environment.Environment

参数

automl_settings
必需

AutoML 设置 dict。

jasmine_client
必需

用于获取策展环境的 jasmine 客户端。

compute
必需

计算目标。

compute_sku
必需

要使用的计算的名称。

_workspace
默认值: None

工作区的内部参数,用于在 CE 尚未发布的情况下获取环境。

返回

基于 dnn 和 gpu 设置的策展环境。

set_environment_variables_for_run

为多个模型或 hts 运行设置运行配置上的环境变量

set_environment_variables_for_run(run_config: azureml.core.runconfig.RunConfiguration)

参数

run_config