GridSamplingAlgorithm Classe
Algorithme d’échantillonnage de grille.
- Héritage
-
azure.ai.ml.entities._job.sweep.sampling_algorithm.SamplingAlgorithmGridSamplingAlgorithm
Constructeur
GridSamplingAlgorithm()
Exemples
Affectation d’un algorithme d’échantillonnage de grille pour un sweepJob
from azure.ai.ml.entities import CommandJob
from azure.ai.ml.sweep import GridSamplingAlgorithm, SweepJob, SweepJobLimits
command_job = CommandJob(
inputs=dict(kernel="linear", penalty=1.0),
compute=cpu_cluster,
environment=f"{job_env.name}:{job_env.version}",
code="./scripts",
command="python scripts/train.py --kernel $kernel --penalty $penalty",
experiment_name="sklearn-iris-flowers",
)
sweep = SweepJob(
sampling_algorithm=GridSamplingAlgorithm(),
trial=command_job,
search_space={"ss": Choice(type="choice", values=[{"space1": True}, {"space2": True}])},
inputs={"input1": {"file": "top_level.csv", "mode": "ro_mount"}},
compute="top_level",
limits=SweepJobLimits(trial_timeout=600),
)
Collaborer avec nous sur GitHub
La source de ce contenu se trouve sur GitHub, où vous pouvez également créer et examiner les problèmes et les demandes de tirage. Pour plus d’informations, consultez notre guide du contributeur.
Azure SDK for Python