Computes generalized-advantage estimates and value targets for an on-policy trajectory buffer, following Schulman et al., "High-Dimensional Continuous Control Using Generalized Advantage Estimation. More...
#include <LibtorchRLValueEstimator.h>
Classes | |
| struct | Targets |
| Generalized-advantage estimates and critic targets for one trajectory. More... | |
Public Member Functions | |
| LibtorchRLValueEstimator (Real discount_factor, Real lambda_factor) | |
| Build the GAE helper. | |
| void | computeValueTargets (LibtorchRLTrajectoryBuffer &buffer, Moose::LibtorchArtificialNeuralNet &value_network) const |
| Fill every trajectory in the buffer with value targets and advantages. | |
| Targets | estimate (const LibtorchRLTrajectoryBuffer::Trajectory &trajectory, Moose::LibtorchArtificialNeuralNet &value_network) const |
| Compute value targets and advantages for one trajectory. | |
Private Member Functions | |
| std::vector< Real > | evaluate (const std::vector< std::vector< Real > > &observations, Moose::LibtorchArtificialNeuralNet &value_network) const |
| Evaluate the critic on a batch of observations. | |
Private Attributes | |
| const Real | _discount_factor |
| Reward discount factor used in the temporal-difference recursion. | |
| const Real | _lambda_factor |
| GAE lambda factor used in the reverse-time advantage recursion. | |
Computes generalized-advantage estimates and value targets for an on-policy trajectory buffer, following Schulman et al., "High-Dimensional Continuous Control Using Generalized Advantage Estimation.
"
Definition at line 24 of file LibtorchRLValueEstimator.h.
| LibtorchRLValueEstimator::LibtorchRLValueEstimator | ( | Real | discount_factor, |
| Real | lambda_factor | ||
| ) |
Build the GAE helper.
| discount_factor | Reward discount factor. |
| lambda_factor | GAE lambda factor. |
Definition at line 41 of file LibtorchRLValueEstimator.C.
| void LibtorchRLValueEstimator::computeValueTargets | ( | LibtorchRLTrajectoryBuffer & | buffer, |
| Moose::LibtorchArtificialNeuralNet & | value_network | ||
| ) | const |
Fill every trajectory in the buffer with value targets and advantages.
| buffer | On-policy trajectory buffer to update. |
| value_network | Critic used for target estimation. |
Definition at line 48 of file LibtorchRLValueEstimator.C.
Referenced by LibtorchDRLControlTrainer::execute().
| LibtorchRLValueEstimator::Targets LibtorchRLValueEstimator::estimate | ( | const LibtorchRLTrajectoryBuffer::Trajectory & | trajectory, |
| Moose::LibtorchArtificialNeuralNet & | value_network | ||
| ) | const |
Compute value targets and advantages for one trajectory.
| trajectory | Trajectory to evaluate. |
| value_network | Critic used for target estimation. |
Definition at line 60 of file LibtorchRLValueEstimator.C.
Referenced by computeValueTargets().
|
private |
Evaluate the critic on a batch of observations.
| observations | Observation matrix to feed through the critic. |
| value_network | Critic used for the evaluation. |
Definition at line 89 of file LibtorchRLValueEstimator.C.
Referenced by estimate().
|
private |
Reward discount factor used in the temporal-difference recursion.
Definition at line 71 of file LibtorchRLValueEstimator.h.
Referenced by estimate().
|
private |
GAE lambda factor used in the reverse-time advantage recursion.
Definition at line 73 of file LibtorchRLValueEstimator.h.
Referenced by estimate().