ConstantKLController¶
- class torchrl.data.ConstantKLController(*, kl_coef: float | None = None, model: torch.nn.modules.module.Module | None = None)[source]¶
Constant KL Controller.
This controller maintains a fixed coefficient no matter what values it is updated with.
- Keyword Arguments:
kl_coef (
float) – The coefficient to multiply KL with when calculating the reward.model (nn.Module, optional) – wrapped model that needs to be controlled. Must have an attribute
"kl_coef". If provided, the"kl_coef"will be updated in-place.