Distributions¶
-
class
optuna.distributions.UniformDistribution(low, high)[源代码]¶ 线性域的均匀分布。
一般情况下,该对象由
suggest_uniform()进行实例化,然后被传递到samplers.-
low¶ 该分布的取值范围下界。其中
low值是包含在取值范围内的。
-
high¶ 该分布的取值范围上界。其中
high值是不包含在取值范围内的。
-
-
class
optuna.distributions.LogUniformDistribution(low, high)[源代码]¶ Log 均匀分布
该对象由
suggest_loguniform()进行实例化之后会被传递到samplers-
low¶ 该分布的取值范围下界。其中
low值是包含在取值范围内的。
-
high¶ 该分布的取值范围上界。其中
high值是不包含在取值范围内的。
-
-
class
optuna.distributions.DiscreteUniformDistribution(low: float, high: float, q: float)[源代码]¶ 线性离散均匀分布
该对象由
suggest_discrete_uniform()进行实例化之后会被传递到samplers注解
如果区间 \([\mathsf{low}, \mathsf{high}]\) 不能被步数 \(q\) 整除的话, 值 \(\mathsf{high}\) 会被替代成 \(k q + \mathsf{low} \lt \mathsf{high}\) 的最大值,其中 \(k\) 是整数。
-
low¶ 该分布的取值范围下界。其中
low值是包含在取值范围内的。
-
high¶ 该分布的取值范围上界。其中
high值是包含在取值范围内的。
-
q¶ 离散化步骤。
-
-
class
optuna.distributions.IntUniformDistribution(low: int, high: int, step: int = 1)[源代码]¶ 整数上的均匀分布。
该对象由
suggest_int()进行实例化之后会被传递到samplers注解
如果区间 \([\mathsf{low}, \mathsf{high}]\) 不能被步数 \(\mathsf{step}\) 整除的话, 值 \(\mathsf{high}\) 会被替代成 \(k \times \mathsf{step} + \mathsf{low} \lt \mathsf{high}\) 的最大值,其中 \(k\) 是整数。
-
low¶ 该分布的取值范围下界。其中
low值是包含在取值范围内的。
-
high¶ 该分布的取值范围上界。其中
high值是包含在取值范围内的。
-
step¶ 取值间隔步长。
-
-
class
optuna.distributions.IntLogUniformDistribution(low: int, high: int, step: int = 1)[源代码]¶ Log 操作后的整数均匀分布。
该对象由
suggest_int()进行实例化之后会被传递到samplers注解
如果区间 \([\mathsf{low}, \mathsf{high}]\) 不能被步数 \(\mathsf{step}\) 整除的话, 值 \(\mathsf{high}\) 会被替代成 \(k \times \mathsf{step} + \mathsf{low} \lt \mathsf{high}\) 的最大值,其中 \(k\) 是整数。
-
low¶ 该分布的取值范围下界。其中
low值是包含在取值范围内的。
-
high¶ 该分布的取值范围上界。其中
high值是包含在取值范围内的。
-
step¶ 取值间隔步长。
-
-
class
optuna.distributions.CategoricalDistribution(choices)[源代码]¶ 分类分布。
该对象由
suggest_categorical()进行实例化之后会被传递到samplers- 参数
choices -- 可选参数值
-
choices¶ 可选参数值
-
optuna.distributions.distribution_to_json(dist)[源代码]¶ 将分布序列化成json格式
- 参数
dist -- 待序列化的分布
- 返回
输出的 JSON 文件名