bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ppo_parallel_rollouts Namespace Reference

Classes

struct  ActorImpl
struct  CriticImpl
struct  SlowCartPole
struct  Networks
struct  Training
class  ParallelEnvs
 Several copies of an environment, stepped at the same time on the threads of a bitsim::utils::concurrency::ThreadPool. More...
class  CartPole
 The cart-pole of Barto, Sutton and Anderson, simulated in this process with bitsim::dynamics::CartPoleDynamics. More...
class  TorchCategorical

Typedefs

using steady = std::chrono::steady_clock
using real_t
 real_t
typedef torch::Tensor torch_tensor_t
 torch_tensor_t
using uint_t
 uint_t

Functions

torch_tensor_t to_tensor (const std::vector< real_t > &state)
 TORCH_MODULE (Actor)
 TORCH_MODULE (Critic)
pg::PPOConfig ppo_config ()
real_t greedy_return (Actor &actor)
real_t seconds (steady::duration d)
real_t tail_mean (const std::vector< real_t > &v)
Training one_at_a_time (uint_t n_episodes)
template<typename Env>
Training in_rounds (uint_t n_episodes, uint_t n_copies, bool threads, uint_t max_rounds=0)
void report (const std::string &name, const Training &t)
int run (uint_t n_episodes, uint_t n_copies)

Variables

const uint_t SEED = 42
const uint_t MAX_STEPS = 500
const real_t LEARNING_RATE = 0.001

Typedef Documentation

◆ real_t

◆ steady

using ppo_parallel_rollouts::steady = std::chrono::steady_clock

◆ torch_tensor_t

typedef torch::Tensor bitrl::torch_tensor_t

◆ uint_t

Function Documentation

◆ greedy_return()

real_t ppo_parallel_rollouts::greedy_return ( Actor & actor)

◆ in_rounds()

template<typename Env>
Training ppo_parallel_rollouts::in_rounds ( uint_t n_episodes,
uint_t n_copies,
bool threads,
uint_t max_rounds = 0 )

◆ one_at_a_time()

Training ppo_parallel_rollouts::one_at_a_time ( uint_t n_episodes)

◆ ppo_config()

pg::PPOConfig ppo_parallel_rollouts::ppo_config ( )

◆ report()

void ppo_parallel_rollouts::report ( const std::string & name,
const Training & t )

◆ run()

int ppo_parallel_rollouts::run ( uint_t n_episodes,
uint_t n_copies )

◆ seconds()

real_t ppo_parallel_rollouts::seconds ( steady::duration d)

◆ tail_mean()

real_t ppo_parallel_rollouts::tail_mean ( const std::vector< real_t > & v)

◆ to_tensor()

torch_tensor_t ppo_parallel_rollouts::to_tensor ( const std::vector< real_t > & state)

◆ TORCH_MODULE() [1/2]

ppo_parallel_rollouts::TORCH_MODULE ( Actor )

◆ TORCH_MODULE() [2/2]

ppo_parallel_rollouts::TORCH_MODULE ( Critic )

Variable Documentation

◆ LEARNING_RATE

const real_t ppo_parallel_rollouts::LEARNING_RATE = 0.001

◆ MAX_STEPS

const uint_t ppo_parallel_rollouts::MAX_STEPS = 500

◆ SEED

const uint_t ppo_parallel_rollouts::SEED = 42