https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LibtorchRLTrajectoryBuffer::TensorBatch Struct Reference

Flattened tensor data assembled from the stored trajectories. More...

#include <LibtorchRLTrajectoryBuffer.h>

Public Member Functions

std::int64_t size () const
 Return the number of transitions represented by the batch.
 

Public Attributes

torch::Tensor observations
 Flattened observation matrix.
 
torch::Tensor next_observations
 Flattened next-observation matrix.
 
torch::Tensor actions
 Flattened action matrix.
 
torch::Tensor log_probabilities
 Flattened action log-probabilities.
 
torch::Tensor rewards
 Flattened rewards.
 
torch::Tensor value_targets
 Flattened critic targets.
 
torch::Tensor advantages
 Flattened advantages.
 

Detailed Description

Flattened tensor data assembled from the stored trajectories.

Definition at line 53 of file LibtorchRLTrajectoryBuffer.h.

Member Function Documentation

◆ size()

std::int64_t LibtorchRLTrajectoryBuffer::TensorBatch::size ( ) const
inline

Return the number of transitions represented by the batch.

Definition at line 73 of file LibtorchRLTrajectoryBuffer.h.

73{ return observations.defined() ? observations.size(0) : 0; }
torch::Tensor observations
Flattened observation matrix.

Referenced by LibtorchRLMiniBatchSampler::sample(), LibtorchDRLControlTrainer::trainController(), and LibtorchRLMiniBatchSampler::validateBatch().

Member Data Documentation

◆ actions

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::actions

◆ advantages

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::advantages

◆ log_probabilities

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::log_probabilities

◆ next_observations

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::next_observations

Flattened next-observation matrix.

Definition at line 58 of file LibtorchRLTrajectoryBuffer.h.

Referenced by LibtorchRLTrajectoryBuffer::flatten().

◆ observations

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::observations

Flattened observation matrix.

Definition at line 56 of file LibtorchRLTrajectoryBuffer.h.

Referenced by LibtorchRLTrajectoryBuffer::flatten(), LibtorchRLMiniBatchSampler::makeMiniBatch(), and size().

◆ rewards

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::rewards

Flattened rewards.

Definition at line 64 of file LibtorchRLTrajectoryBuffer.h.

Referenced by LibtorchRLTrajectoryBuffer::flatten().

◆ value_targets

torch::Tensor LibtorchRLTrajectoryBuffer::TensorBatch::value_targets

The documentation for this struct was generated from the following file: