StepSequence クラス
Pipeline内のステップの一覧とその実行順序を表します。
パイプラインを初期化するときに StepSequence を使用して、特定の順序で実行するステップを含むワークフローを作成します。
StepSequence を初期化します。
コンストラクター
StepSequence(steps=None)
パラメーター
名前 | 説明 |
---|---|
steps
|
StepSequence の手順。 規定値: None
|
steps
必須
|
StepSequence の手順。 |
注釈
StepSequence を使用すると、 PipelineDataを使用してデータの依存関係を指定しなくても、特定の順序でステップを簡単に実行できます。
StepSequence を使用してパイプラインを構築する例を次に示します。
from azureml.pipeline.core import Pipeline, StepSequence
from azureml.pipeline.steps import PythonScriptStep
prepare_step = PythonScriptStep(
name='prepare data step',
script_name="prepare_data.py",
compute_target=compute
)
train_step = PythonScriptStep(
name='train step',
script_name="train.py",
compute_target=compute
)
step_sequence = StepSequence(steps=[prepare_step, train_step])
pipeline = Pipeline(workspace=ws, steps=step_sequence)
この例では、train_stepは、prepare_stepの実行が正常に完了した後にのみ実行されます。
3 つのステップを並列で実行し、それらを 4 番目のステップにフィードするには、次の手順を実行します。
initial_steps = [step1, step2, step3]
all_steps = StepSequence(steps=[initial_steps, step4])
pipeline = Pipeline(workspace=ws, steps=all_steps)