Skip to main content

A standard format for offline reinforcement learning datasets, with popular reference datasets and related utilities.

Project description

pre-commit Code style: black

Minari is a Python library for conducting research in offline reinforcement learning, akin to an offline version of Gymnasium or an offline RL version of HuggingFace's datasets library. This library is currently in beta.

The documentation website is at minari.farama.org. We also have a public discord server (which we use for Q&A and to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6.

Note: Minari was previously developed under the name Kabuki.

Installation

To install Minari from PyPI:

pip install minari

Note that currently Minari is under a beta release. If you'd like to start testing or contribute to Minari please install this project from source with:

git clone https://github.com/Farama-Foundation/Minari.git
cd Minari
pip install -e .

Command Line API

To check available remote datasets:

minari list remote

To download a dataset:

minari download door-human-v1

To check available local datasets:

minari list local

To show the details of a dataset:

minari show door-human-v1

For the list of commands:

minari --help

Basic Usage

Reading a dataset

import minari

dataset = minari.load_dataset("door-human-v1")

for episode_data in dataset.iterate_episodes():
    ...

Writing a dataset

import minari
import gymnasium as gym
from minari import DataCollector


env = gym.make('LunarLander-v2')
env = DataCollector(env)

for _ in range(100):
    env.reset()
    done = False
    while not done:
        action = ...
        obs, rew, terminated, truncated, info = env.step(action)
        done = terminated or truncated

dataset = env.create_dataset("LunarLander-v2-test-v0")

For other examples, see Basic Usage. For a complete tutorial on how to create new datasets using Minari, see our Pointmaze D4RL Dataset tutorial, which re-creates the Maze2D datasets from D4RL.

Project Maintainers

Main Contributors: Rodrigo Perez-Vicente, Omar Younis, John Balis

Maintenance for this project is also contributed by the broader Farama team: farama.org/team.


Minari is a shortening of Minarai, the Japanese word for "learning by observation".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minari-0.4.3.tar.gz (40.2 kB view hashes)

Uploaded Source

Built Distribution

minari-0.4.3-py3-none-any.whl (42.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page