reinforce private
C++26 / header-only / tabular RL
Header-only C++26 reinforcement learning library. Type-safe, concept-constrained tabular RL with compile-time hyperparameter validation. Four algorithm families (TD, Monte Carlo, Actor-Critic, Policy Gradient), eight environments, 35+ composable wrappers with pipe syntax.
obs_wrapper env{classic_control::cart_pole{},
uniform_discretizer{/* ... */}};
auto algo = make_tabular_td<td_target_kind::greedy, num_actions>(
env.num_bins(), {.gamma = 0.99, .max_steps_per_episode = 500},
linear_decay_schedule(0.5, 0.01, 100'000));
auto rng = make_prng(42);
(void) algo.train(env, 1'000'000, rng, progress_logger(100));
Requires Clang 19+ (C++26). Lehmer64 RNG, Ziggurat normals, cache-aligned Q-tables, sum-tree PER, branchless transitions.
API reference (generated by docgen)
td_control class detail