你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
QNormal Class
QNormal distribution configuration.
Constructor
QNormal(mu: float | None = None, sigma: float | None = None, q: int | None = None, **kwargs: Any)
Parameters
Name | Description |
---|---|
mu
|
Mean of the distribution. Default value: None
|
sigma
|
Standard deviation of the distribution. Default value: None
|
q
|
Quantization factor. Default value: None
|
Examples
Configuring QNormal distributions for a hyperparameter sweep on a Command job.
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 QLogUniform, QNormal
# 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=QNormal(mu=2.0, sigma=1.0, q=1),
kernel=QLogUniform(min_value=1.0, max_value=5.0),
)