bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitrl::rl::algos::pg Namespace Reference

Classes

class  A2CSolver
 A2C solver assuming separate networks for the actor and the critic. Similar to the Reinforce algorithm implementation, the PolicyType should expose an act method with the following signature. More...
struct  A2CConfig
 The A2CConfig struct. Configuration for A2CSolver class. More...
struct  A2CMonitor
class  ACSolverBase
 A2C solver assuming separate networks for the actor and the critic. Similar to the Reinforce algorithm implementation, the PolicyType should expose an act method with the following signature. More...
class  DistributedPPOSolver
 Proximal policy optimisation over several ranks, threads, processes or machines, that average their gradients. More...
class  ParallelPPOSolver
 Proximal policy optimisation that learns from several episodes at once, played by the copies of a bitrl::envs::ParallelEnvs. More...
class  PPOSolver
struct  PPOConfig
 The PPOConfig struct. Configuration for PPOSolver class. More...
class  ReinforceSolver
 The ReinforceSolver class. The ReinforceSolver trains a policy represented by the PolicyTp template parameter on the environment represented by the EnvType parameter. More...
struct  ReinforceConfig
 The ReinforceOpts struct. Holds various configuration options for the Reinforce algorithm. More...
struct  ReinforceMonitor

Enumerations

enum class  BaselineEnumType { NONE = -1 , CONSTANT = 0 , MEAN = 1 , STANDARDIZE = 2 }
 Enumeration of the baseline types supported. More...

Functions

std::ostream & operator<< (std::ostream &out, const A2CConfig &opts)
std::ostream & operator<< (std::ostream &out, const PPOConfig &opts)
std::ostream & operator<< (std::ostream &out, ReinforceConfig opts)
std::vector< torch_tensor_t > compute_loss_item (const std::vector< real_t > &rewards, const std::vector< torch_tensor_t > &log_probs)
 compute_loss_item. Compute the product -rewards[i] * log_probs[i]
std::vector< real_t > compute_baseline_with_constant (const std::vector< real_t > &rewards, real_t constant)
 Compute the baseline using a user-defined constant value from the given rewards.
std::vector< real_t > compute_baseline_with_mean (const std::vector< real_t > &rewards)
 Compute the baseline using the mean value of the provided rewards.
std::vector< real_t > compute_baseline_with_standardization (const std::vector< real_t > &rewards, real_t eps=bitsim::consts::TOLERANCE)
 Compute the baseline using standarization also known as whitening.

Enumeration Type Documentation

◆ BaselineEnumType

Enumeration of the baseline types supported.

Enumerator
NONE 
CONSTANT 
MEAN 
STANDARDIZE 

Function Documentation

◆ compute_baseline_with_constant()

std::vector< real_t > bitrl::rl::algos::pg::compute_baseline_with_constant ( const std::vector< real_t > & rewards,
real_t constant )

Compute the baseline using a user-defined constant value from the given rewards.

◆ compute_baseline_with_mean()

std::vector< real_t > bitrl::rl::algos::pg::compute_baseline_with_mean ( const std::vector< real_t > & rewards)

Compute the baseline using the mean value of the provided rewards.

◆ compute_baseline_with_standardization()

std::vector< real_t > bitrl::rl::algos::pg::compute_baseline_with_standardization ( const std::vector< real_t > & rewards,
real_t eps = bitsim::consts::TOLERANCE )

Compute the baseline using standarization also known as whitening.

◆ compute_loss_item()

std::vector< torch_tensor_t > bitrl::rl::algos::pg::compute_loss_item ( const std::vector< real_t > & rewards,
const std::vector< torch_tensor_t > & log_probs )

compute_loss_item. Compute the product -rewards[i] * log_probs[i]

◆ operator<<() [1/3]

std::ostream & bitrl::rl::algos::pg::operator<< ( std::ostream & out,
const A2CConfig & opts )
inline

◆ operator<<() [2/3]

std::ostream & bitrl::rl::algos::pg::operator<< ( std::ostream & out,
const PPOConfig & opts )
inline

◆ operator<<() [3/3]

std::ostream & bitrl::rl::algos::pg::operator<< ( std::ostream & out,
ReinforceConfig opts )
inline