About this project
decisionrl is a reinforcement learning library purpose-built for operational decision-making problems such as pricing, inventory management, energy dispatch, queue admission, and supply chain optimization. Unlike general-purpose RL frameworks that target games and robotics, decisionrl ships each applied problem as a first-class environment paired with the classical operations-research baseline, so a learned policy can be measured against the standard method rather than asserted to be good.
The library provides 31 algorithms spanning tabular methods (Q-Learning, SARSA, Expected SARSA, Dyna-Q), value-based deep RL (DQN, Rainbow, C51, QR-DQN), actor-critic methods (PPO, A2C, TRPO, GRPO, IMPALA, Recurrent PPO), continuous control (DDPG, TD3, SAC, SACDiscrete), offline RL (TD3+BC, IQL, CQL, Decision Transformer), model-based approaches (MBPO, Dreamer, DreamerRSSM), goal-conditioned learning (HER+DQN), and imitation learning (Diffusion Policy). Every agent exposes a unified predict/learn/save/load interface regardless of whether it is tabular or deep, discrete or continuous, on-policy or off-policy.
The core is dependency-light: environments, classical baselines, and solvers are pure NumPy, while PyTorch is an optional extra needed only by algorithms that train. Built-in environments include GridWorld, CartPole, Pendulum, PointMass, and bandits, allowing end-to-end training with no extra installs. Gymnasium environments are available as an optional extra.
Applied environments cover non-stationary inventory with drifting demand, two-echelon supply chains, queue admission control, energy microgrid battery management, thermostat/HVAC control, stationary inventory, dynamic pricing, and joint pricing plus inventory. Each includes the best fixed-rule classical baseline found by search, not a naive default. Results show the learned policy outperforms the classical baseline on non-stationary tasks (e.g., roughly 16% improvement on drifting inventory, 20% on energy microgrid, 15% on supply chain cost reduction) and matches the exact dynamic-programming optimum on stationary tasks. A case study drives the inventory environment with quarterly US real consumption data from 1959 to 2009, showing the learned policy improves on the best fixed base-stock because real demand trends and no single order-up-to level fits every era.
The library also includes contextual bandits (LinUCB, linear Thompson sampling, epsilon-greedy) for one-shot decisions such as pricing and recommendation, RLHF and DPO on control tasks and a character-level GPT, imitation learning (BC, DAgger, GAIL), curiosity-driven exploration (RND, ICM), gradient-free optimization (12 evolution and swarm methods with an ask/tell interface plus a NeuroevolutionAgent), AlphaZero with MCTS and self-play for two-player perfect-information games, meta-RL (RL²) for online adaptation across a task distribution, multi-agent self-play with IPPO, distributed IMPALA-style actors feeding a central V-trace learner, and ONNX and TorchScript export with a torch-free FastAPI serving container.
A command-line interface supports training, evaluation, and live dashboard visualization. Experiments can be declared in YAML or JSON and run with decisionrl run or decisionrl.config.run. Reproducibility is ensured through seedable RNGs across Python, NumPy, and PyTorch, with a test suite of over 400 tests covering component correctness (spaces, buffers, sum-tree, schedules, GAE, normalization, save/load round-trips) and learning behaviour (tabular methods reach the optimal GridWorld policy; DQN and PPO learn CartPole; SAC, TD3, and DDPG solve the PointMass task). A scheduled CI workflow re-runs multi-seed applied verification nightly and fails if any reported result regresses below its baseline.
The project is licensed under MIT and draws design inspiration from CleanRL, Stable-Baselines3, Tianshou, and the Farama Foundation's Gymnasium interface.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.