evox.algorithms.so.es_variants.snes¶
模块内容¶
类¶
SNES算法的实现。 |
API¶
- class evox.algorithms.so.es_variants.snes.SNES(pop_size: int, center_init: torch.Tensor, sigma: float = 1.0, lrate_mean: float = 1.0, temperature: float = 12.5, weight_type: Literal[recomb, temp] = 'temp', device: torch.device | None = None)[源代码]¶
基础:
evox.core.AlgorithmSNES算法的实现。
参考文献:Natural Evolution Strategies (https://www.jmlr.org/papers/volume15/wierstra14a/wierstra14a.pdf)
这段代码受到了 evosax 中算法实现的启发或使用了其实现。有关 evosax 的更多信息,请访问以下网址:GitHub 链接:https://github.com/RobertTLange/evosax
初始化
用给定的参数初始化SNES算法。
- 参数:
pop_size -- 种群大小。
center_init -- 种群的初始中心。必须是一个一维张量。
optimizer -- 使用的优化器(optimizer)。 默认情况下为 None。 仅 support "adam" 或 None。
lrate_mean -- 均值的学习率。默认值为 1.0。
sigma -- 噪声的标准差。默认为 1.0。
temperature -- 计算权重时 softmax 的温度。默认值为 12.5。
weight_type -- 权重的类型。默认为 "temp"。
device -- 设备的使用者(设备用于存放张量的硬件)。默认为 None。