Skip to content

YN35/minerl-y

This branch is 4 commits ahead of, 45 commits behind minerllabs/minerl:dev.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

91729b2 · Oct 14, 2022
Jul 13, 2021
Sep 22, 2020
Mar 29, 2022
Dec 3, 2021
Oct 14, 2022
Jul 13, 2021
Dec 4, 2021
Jul 28, 2020
Jul 13, 2021
Jul 9, 2020
Jun 16, 2020
Jul 15, 2021
Nov 2, 2020
Jul 12, 2021
Sep 22, 2020
Apr 17, 2022
Jun 7, 2019
May 7, 2021
Oct 14, 2022
Jul 15, 2021
Jul 12, 2021
Dec 7, 2021
Dec 17, 2021

Repository files navigation

The MineRL Python Package

Documentation Status Dev Build status Downloads PyPI version "Open Issues" GitHub issues by-label Discord

Python package providing easy to use gym environments and a simple data api for the MineRLv0 dataset.

To get started please read the docs here!

Installation

With JDK-8 installed run this command

pip install git+https://github.com/YN35/minerl-y.git
pip install pyglet

Basic Usage

Running an environment:

import minerl
import gym
env = gym.make('MineRLNavigateDense-v0')


obs = env.reset()

done = False
while not done:
    action = env.action_space.sample() 
 
    # One can also take a no_op action with
    # action =env.action_space.noop()
    
 
    obs, reward, done, info = env.step(
        action)

Sampling the dataset:

import minerl

# YOU ONLY NEED TO DO THIS ONCE!
minerl.data.download('/your/local/path')

data = minerl.data.make(
    'MineRLObtainDiamond-v0',
    data_dir='/your/local/path')

# Iterate through a single epoch gathering sequences of at most 32 steps
for current_state, action, reward, next_state, done \
    in data.batch_iter(
        num_epochs=1, seq_len=32):

        # Print the POV @ the first step of the sequence
        print(current_state['pov'][0])

        # Print the final reward pf the sequence!
        print(reward[-1])

        # Check if final (next_state) is terminal.
        print(done[-1])

        # ... do something with the data.
        print("At the end of trajectories the length"
              "can be < max_sequence_len", len(reward))

Visualizing the dataset:

viewer|540x272

# Make sure your MINERL_DATA_ROOT is set!
export MINERL_DATA_ROOT='/your/local/path'

# Visualizes a random trajectory of MineRLObtainDiamondDense-v0
python3 -m minerl.viewer MineRLObtainDiamondDense-v0

MineRL Competition

If you're here for the MineRL competition. Please check the main competition website here.

About

Multiagent fixed MineRL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 66.7%
  • Python 30.4%
  • C 1.3%
  • Shell 0.6%
  • CMake 0.4%
  • Dockerfile 0.2%
  • Other 0.4%