Bettermdptools is a package designed to help users get started with gymnasium, a maintained fork of OpenAI’s Gym library. Bettermdptools includes planning and reinforcement learning algorithms, useful utilities and plots, environment models for blackjack and cartpole, and starter code for working with gymnasium.
pip install or git clone bettermdptools.
pip install bettermdptools
git clone https://github.com/jlm429/bettermdptools
Starter code to get up and running on the gymnasium frozen lake environment. See bettermdptools/notebooks for more.
import gymnasium as gym
from bettermdptools.algorithms.planner import Planner
from bettermdptools.utils.plots import Plots
# make gym environment
frozen_lake = gym.make('FrozenLake8x8-v1', render_mode=None)
# run VI
V, V_track, pi = Planner(frozen_lake.P).value_iteration()
#plot state values
size=(8,8)
Plots.values_heat_map(V, "Frozen Lake\nValue Iteration State Values", size)
Pull requests are welcome.
- Fork bettermdptools.
- Create a branch (
git checkout -b branch_name
) - Commit changes (
git commit -m "Comments"
) - Push to branch (
git push origin branch_name
) - Open a pull request