PPO clipped surrogate loss on top of the reusable RL buffer/value-estimation core. More...
#include <LibtorchRLPPOLoss.h>
Public Member Functions | |
| LibtorchRLPPOLoss (Real clip_parameter, Real entropy_coeff) | |
| Build the PPO loss helper. | |
| LibtorchRLPPOLossOutput | compute (Moose::LibtorchActorNeuralNet &policy_network, Moose::LibtorchArtificialNeuralNet &value_network, const LibtorchRLMiniBatch &batch) const |
| Compute actor, critic, and entropy terms for one mini-batch. | |
Static Private Member Functions | |
| static torch::Tensor | reduceActionDimension (const torch::Tensor &tensor) |
| Collapse multi-action log-probabilities or entropies into one column tensor. | |
Private Attributes | |
| const Real | _clip_parameter |
| PPO clipping width used in the actor surrogate objective. | |
| const Real | _entropy_coeff |
| Weight applied to the entropy bonus inside the actor loss. | |
PPO clipped surrogate loss on top of the reusable RL buffer/value-estimation core.
Definition at line 34 of file LibtorchRLPPOLoss.h.
| LibtorchRLPPOLoss::LibtorchRLPPOLoss | ( | Real | clip_parameter, |
| Real | entropy_coeff | ||
| ) |
Build the PPO loss helper.
| clip_parameter | PPO clipping width. |
| entropy_coeff | Weight applied to the entropy bonus. |
Definition at line 14 of file LibtorchRLPPOLoss.C.
| LibtorchRLPPOLossOutput LibtorchRLPPOLoss::compute | ( | Moose::LibtorchActorNeuralNet & | policy_network, |
| Moose::LibtorchArtificialNeuralNet & | value_network, | ||
| const LibtorchRLMiniBatch & | batch | ||
| ) | const |
Compute actor, critic, and entropy terms for one mini-batch.
| policy_network | Actor network used for the policy term. |
| value_network | Critic network used for the value term. |
| batch | Mini-batch pulled from the on-policy trajectory buffer. |
Definition at line 20 of file LibtorchRLPPOLoss.C.
Referenced by LibtorchDRLControlTrainer::trainController().
|
staticprivate |
Collapse multi-action log-probabilities or entropies into one column tensor.
| tensor | Action-wise tensor to reduce. |
Definition at line 46 of file LibtorchRLPPOLoss.C.
Referenced by compute().
|
private |
PPO clipping width used in the actor surrogate objective.
Definition at line 62 of file LibtorchRLPPOLoss.h.
Referenced by compute().
|
private |
Weight applied to the entropy bonus inside the actor loss.
Definition at line 64 of file LibtorchRLPPOLoss.h.
Referenced by compute().