Command Class
Base class for command node, used for command component version consumption.
You should not instantiate this class directly. Instead, you should create from builder function: command.
- Inheritance
-
azure.ai.ml.entities._builders.base_node.BaseNodeCommand
Constructor
Command(*, component: str | CommandComponent, compute: str | None = None, inputs: Dict[str, Input | str | bool | int | float | Enum] | None = None, outputs: Dict[str, str | Output] | None = None, limits: CommandJobLimits | None = None, identity: ManagedIdentityConfiguration | AmlTokenConfiguration | UserIdentityConfiguration | None = None, distribution: Dict | MpiDistribution | TensorFlowDistribution | PyTorchDistribution | None = None, environment: Environment | str | None = None, environment_variables: Dict | None = None, resources: JobResourceConfiguration | None = None, services: Dict[str, JobService | JupyterLabJobService | SshJobService | TensorBoardJobService | VsCodeJobService] | None = None, **kwargs)
Parameters
- component
- CommandComponent
Id or instance of the command component/job to be run for the step
- inputs
- <xref:Dict>[str, <xref:Union>[Input, <xref:SweepDistribution>, str, bool, int, float, <xref:Enum>, dict]]
Inputs to the command.
Mapping of output data bindings used in the job.
- experiment_name
- str
Name of the experiment the job will be created under, if None is provided, default will be set to current directory name.
- resources
- <xref:Union>[<xref:Dict>, JobResourceConfiguration]
Compute Resource configuration for the command.
- distribution
- <xref:Union>[<xref:Dict>, PyTorchDistribution, MpiDistribution, TensorFlowDistribution]
Distribution configuration for distributed training.
- identity
- <xref:Union>[<xref:ManagedIdentity>, <xref:AmlToken>, <xref:UserIdentity>]
Identity that training job will use while running on compute.
- services
- <xref:Dict>[str, <xref:Union>[JobService, JupyterLabJobService, SshJobService, TensorBoardJobService, VsCodeJobService]]
Interactive services for the node. This is an experimental parameter, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
Methods
set_limits |
Set limits for Command. |
set_resources |
Set resources for Command. |
sweep |
Turn the command into a sweep node with extra sweep run setting. The command component in current Command node will be used as its trial component. A command node can sweep for multiple times, and the generated sweep node will share the same trial component. |
set_limits
Set limits for Command.
set_limits(*, timeout: int, **kwargs)
set_resources
Set resources for Command.
set_resources(*, instance_type: str | List[str] | None = None, instance_count: int | None = None, properties: Dict | None = None, docker_args: str | None = None, shm_size: str | None = None, **kwargs)
sweep
Turn the command into a sweep node with extra sweep run setting. The command component in current Command node will be used as its trial component. A command node can sweep for multiple times, and the generated sweep node will share the same trial component.
sweep(*, primary_metric: str, goal: str, sampling_algorithm: str = 'random', compute: str | None = None, max_concurrent_trials: int | None = None, max_total_trials: int | None = None, timeout: int | None = None, trial_timeout: int | None = None, early_termination_policy: EarlyTerminationPolicy | str | None = None, search_space: Dict[str, Choice | LogNormal | LogUniform | Normal | QLogNormal | QLogUniform | QNormal | QUniform | Randint | Uniform] | None = None, identity: ManagedIdentityConfiguration | AmlTokenConfiguration | UserIdentityConfiguration | None = None) -> Sweep
Parameters
- primary_metric
- str
primary metric of the sweep objective, AUC e.g. The metric must be logged in running the trial component.
- sampling_algorithm
- str, <xref:valid values: random>, <xref:grid> or <xref:bayesian>
sampling algorithm to sample inside search space. Defaults to "random"
- compute
- str
target compute to run the node. If not specified, compute of current node will be used.
- max_total_trials
Sweep Job max total trials.
- early_termination_policy
- <xref:Union>[<xref:EarlyTerminationPolicy>, str], <xref:valid values: bandit>, <xref:median_stopping> or <xref:truncation_selection.>
early termination policy of the sweep node:
- identity
- <xref:Union>[<xref:azure.ai.ml.entities.ManagedIdentityConfiguration,azure.ai.ml.entities.AmlTokenConfiguration,azure.ai.ml.entities.UserIdentityConfiguration>]
Identity that training job will use while running on compute.
Returns
A sweep node with component from current Command node as its trial component.
Return type
Attributes
code
command
component
distribution
identity
Configuration of the hyperparameter identity.
parameters
resources
services
Tilbakemeldinger
Send inn og vis tilbakemelding for