Skip to content

Welcome to gymnax

Compare
Choose a tag to compare
@RobertTLange RobertTLange released this 22 Nov 09:07
· 121 commits to main since this release

Classic Open AI gym wrapper including gymnax.make, env.reset, env.step:

import jax
import gymnax

rng = jax.random.PRNGKey(0)
rng, key_reset, key_policy, key_step = jax.random.split(rng, 4)

env, env_params = gymnax.make("Pendulum-v1")

obs, state = env.reset(key_reset, env_params)
action = env.action_space(env_params).sample(key_policy)
n_obs, n_state, reward, done, _ = env.step(key_step, state, action, env_params)