Normal 類別
常態分佈組態。
- 繼承
-
azure.ai.ml.entities._job.sweep.search_space.SweepDistributionNormal
建構函式
Normal(mu: float | None = None, sigma: float | None = None, **kwargs: Any)
參數
名稱 | Description |
---|---|
mu
|
分佈的平均數。 預設值: None
|
sigma
|
分佈的標準差。 預設值: None
|
範例
在命令作業上設定超參數掃掠的正常分佈。
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),
)