Skip to content

Tutorials

Welcome to the tutorials! This section teaches you how to build, run, and extend Envrax environments for all your RL environment needs.

If you are new to Envrax, we highly recommend working through the Essentials to get comfortable with the basics. Each tutorial builds on the other to help you gain a better understanding of each concept and become an Envrax master in no time! ๐Ÿ˜‰

If you are already familiar with the basics, check out the Advanced section for more task-focused walkthroughs.

Already an Expert?

Then what are you still doing here?! ๐Ÿคจ Get out there and build some environments! ๐Ÿš€

Prerequisites

These tutorials assume:

If any of that is unfamiliar, we highly recommend referring to the linked resources first and come back once comfortable. You'll get more out of the tutorials that way!

Essentials

New to Envrax?

Start here! ๐Ÿ‘‡

Each tutorial is a short, self-contained guide that includes a runnable code snippet to help get you familiar with the basics.

We recommend completing the tutorials in order below to get the most out of this tutorial series.

# Tutorial Teaches
1 Environment State What state is, extending EnvState, threading rng, and managing per-episode fields
2 Spaces What spaces are and using contracts like Box, Discrete, and MultiDiscrete to describe your environment
3 Environment Configuration Extending EnvConfig with your own static fields
4 Your First Environment Subclassing JaxEnv, implement the primary methods reset and step, and how to use it
5 Vectorising with VecEnv Running N parallel copies via jax.vmap
6 Multiple Environments Managing M heterogeneous envs with MultiEnv / MultiVecEnv
7 Environment Registry Registering envs by name and discovering registered specs
8 Make Methods Constructing registered envs with make(), make_vec(), make_multi(), and make_multi_vec()
9 Available Wrappers A catalogue of built-in wrappers for transforming observations, rewards, and episode statistics
10 Rendering Implementing render(state) for visual inspection

Advanced

Familiar with the basics?

Use these tutorials to level up further! ๐Ÿ’ช

Each tutorial is a task-focused guide for specific features. These can be read in any order and work independently.

# Tutorial Description
1 Creating a Custom Wrapper Build your own pass-through and stateful wrappers
2 Creating a Custom Space Subclass Space to create your own spaces that Envrax doesn't ship.