ConstantKLController¶ class torchrl.data.ConstantKLController(*, kl_coef: float | None = None, model: nn.Module | None = None)[source]¶ Constant KL Controller。 此控制器在接收到任何更新值时都会保持一个固定的系数。 关键字参数: kl_coef (float) – 计算奖励时用于乘以 KL 的系数。 model (nn.Module, optional) – 需要控制的包装模型。必须有一个属性 "kl_coef"。如果提供了该属性,则会在原地更新 "kl_coef"。