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

The examples of bitrl, in the order they build on each other: the basic ideas of reinforcement learning, the PyTorch C++ API that the deep methods use, running experiments, the environments, and then the algorithms, from bandits to deep reinforcement learning. Most of the environments are Gymnasium's, which run on the bitrl-rest-api server, so start it before you run the examples that use them.

The basics

Estimating with samples, returns and Markov chains, which the algorithms below are built on.

The PyTorch C++ API

bitrl's deep reinforcement learning uses libtorch, PyTorch's C++ API.

Experiments

Keeping what training learns, and logging how it went.

Environments

Multi-armed bandits

Dynamic programming

Monte Carlo methods

Temporal difference learning

Deep reinforcement learning

Robotics

bitsim's robots, simulated with Chrono. These need bitsim built with Chrono.

Multi-agent

Several agents in one environment, each acting on what it observes. The trainings and simulations that do not depend on each other run in parallel, on bitsim's thread pool.

Distributed multi-agent

Every agent in a participant of its own, a thread, a process or a machine, meeting the others through bitsim's transports, MQTT for one. Every participant holds a copy of the environment, and only the actions travel, so the agents learn and drive exactly as they do in one process.

Evolution strategies

A search for the weights of a policy that needs only the returns of episodes, no gradients. The episodes of a generation do not depend on each other, so they run on all the threads, or on several ranks that exchange only the returns.