Partager via


Randint Classe

Configuration de la distribution Randint.

Héritage
azure.ai.ml.entities._job.sweep.search_space.SweepDistribution
Randint

Constructeur

Randint(upper: int | None = None, **kwargs: Any)

Paramètres

Nom Description
upper
int

Limite supérieure de la distribution.

valeur par défaut: None

Exemples

Configuration des distributions Randint pour un balayage d’hyperparamètre sur un travail De commande.


   from azure.ai.ml import command

   job = command(
       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",
   )

   from azure.ai.ml.sweep import Normal, Randint

   # we can reuse an existing Command Job as a function that we can apply inputs to for the sweep configurations
   job_for_sweep = job(
       penalty=Randint(upper=5),
       kernel=Normal(mu=2.0, sigma=1.0),
   )