Shortcuts

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.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources