jaxdp
Exact dynamic programming (DP) for finite Markov decision processes (MDPs) in JAX.
jaxdp provides jax.jit and jax.vmap compatible implementations of MDPs, DP operators and mappings, and planning algorithms.
Installation
uv add jaxdp
uv add "jaxdp[dev]" # for development
Quick start
Make an MDP and apply value iteration steps.
import jaxdp
mdp = jaxdp.make("frozen-lake-deterministic")
algo = jaxdp.ValueIteration(gamma=0.99)
state = algo.init(mdp)
for _ in range(100):
state = algo.update(mdp, state)
pi = jaxdp.greedy_map.v(mdp, state.v_val, algo.gamma)
v_pi = jaxdp.policy_eval.v(mdp, pi, algo.gamma)
You can use jax.vmap to compute target values for different discount factors.
import jax
import jax.numpy as jnp
import jaxdp
mdp = jaxdp.make("garnet")
v_val = jnp.linspace(0.0, 1.0, mdp.state_size)
@jax.jit
@jax.vmap
def target_value(gamma: jax.Array) -> jax.Array:
q_val = jaxdp.reward.sa(mdp) + gamma * jaxdp.trans_op.sa(mdp, v_val)
return jnp.max(q_val, axis=0)
gammas = jnp.array([0.9, 0.99, 0.995, 0.999])
v_vals = target_value(gammas)
# >>> v_vals.shape
# (4, ...)
See the component reference for the public API and MDPs.
Citation
If you use jaxdp in your research, please cite:
@software{tolgaok_jaxdp_2026,
author = {Tolga Ok},
title = {{jaxdp}: Exact dynamic programming for finite Markov decision processes in JAX},
year = {2026},
version = {0.4.0},
url = {https://github.com/TolgaOk/jaxdp},
}
Metadata
Release files for jaxdp 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jaxdp-0.4.0.tar.gz | 43.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jaxdp-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.9 kB
Release files / jaxdp-0.4.0.tar.gz
| Download URL | jaxdp-0.4.0.tar.gz |
|---|---|
| Size | 43.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96eca91c693af498a7e10a1685e6400038522299bc95c264953913fbb56a5114
|
|
BLAKE2b-256 checksum How to use checksums |
eb915fa1699e04071187dade9715febd708e816d4589209118b8a34f058f3c16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / jaxdp-0.4.0-py3-none-any.whl
| Download URL | jaxdp-0.4.0-py3-none-any.whl |
|---|---|
| Size | 36.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e2cd04291b3f22773d1b574fd1da7cbf42eb83884e374dfdfdb168e175032c1
|
|
BLAKE2b-256 checksum How to use checksums |
f25437dc9b0f061fcc8e592c211601f36d5f12bd7d0b6b6b9c05a358e9e9db48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|