|
bitsim
Model, simulate, estimate and control robots in C++
|
Classes | |
| struct | ActorImpl |
| struct | CriticImpl |
| struct | Networks |
| struct | Rank |
| 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 |
| class | Communicator |
| How the ranks of a distributed training exchange numbers. More... | |
| class | TCPStoreCommunicator |
| A Communicator through c10d::TCPStore, the key-value store that comes with libtorch. More... | |
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_MODULE (Actor) | |
| TORCH_MODULE (Critic) | |
| pg::PPOConfig | ppo_config (uint_t n_rounds) |
| real_t | greedy_return (Actor &actor) |
| real_t | seconds (steady::duration d) |
| real_t | tail_mean (const std::vector< real_t > &v) |
| Rank | train_rank (Communicator &communicator, Networks &nets, uint_t n_rounds, uint_t n_copies) |
| Rank | one_thread (uint_t n_rounds, uint_t n_copies) |
| void | report (const std::string &name, const Rank &r) |
| bool | compare (const std::string &title, uint_t n_episodes, uint_t n_ranks, uint_t n_copies, uint_t port) |
| int | run_threads (uint_t n_episodes, uint_t n_ranks, uint_t n_copies, uint_t port) |
| int | run_rank (uint_t rank, uint_t n_episodes, uint_t n_ranks, uint_t n_copies, const std::string &host, uint_t port) |
| uint_t | task_seed (uint_t base_seed, uint_t task) noexcept |
| A seed for task task, made from base_seed. | |
Variables | |
| const uint_t | SEED = 42 |
| const uint_t | MAX_STEPS = 500 |
| const real_t | LEARNING_RATE = 0.001 |
| using bitsim::real_t |
| using ppo_distributed::steady = std::chrono::steady_clock |
| typedef torch::Tensor bitrl::torch_tensor_t |
| using bitsim::uint_t |
| bool ppo_distributed::compare | ( | const std::string & | title, |
| uint_t | n_episodes, | ||
| uint_t | n_ranks, | ||
| uint_t | n_copies, | ||
| uint_t | port ) |
| real_t ppo_distributed::greedy_return | ( | Actor & | actor | ) |
| pg::PPOConfig ppo_distributed::ppo_config | ( | uint_t | n_rounds | ) |
| void ppo_distributed::report | ( | const std::string & | name, |
| const Rank & | r ) |
| int ppo_distributed::run_rank | ( | uint_t | rank, |
| uint_t | n_episodes, | ||
| uint_t | n_ranks, | ||
| uint_t | n_copies, | ||
| const std::string & | host, | ||
| uint_t | port ) |
| int ppo_distributed::run_threads | ( | uint_t | n_episodes, |
| uint_t | n_ranks, | ||
| uint_t | n_copies, | ||
| uint_t | port ) |
| real_t ppo_distributed::seconds | ( | steady::duration | d | ) |
|
inlinenoexcept |
A seed for task task, made from base_seed.
Tasks that draw random numbers need a generator each, since sharing one between threads is a data race. Seeding them with base_seed + task gives generators whose first numbers are alike; this mixes the two numbers with SplitMix64, so that every task gets an unrelated seed that still depends only on base_seed and task.
| ppo_distributed::TORCH_MODULE | ( | Actor | ) |
| ppo_distributed::TORCH_MODULE | ( | Critic | ) |
| Rank ppo_distributed::train_rank | ( | Communicator & | communicator, |
| Networks & | nets, | ||
| uint_t | n_rounds, | ||
| uint_t | n_copies ) |
| const real_t ppo_distributed::LEARNING_RATE = 0.001 |
| const uint_t ppo_distributed::MAX_STEPS = 500 |
| const uint_t ppo_distributed::SEED = 42 |