ConstantKLController¶
- class torchrl.data.ConstantKLController(*, kl_coef: Optional[float] = None, model: Optional[Module] = 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.