Giter Site home page Giter Site logo

cszmli / minerl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minerllabs/minerl

0.0 1.0 0.0 75.2 MB

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package

Home Page: http://minerl.io/docs/

License: Other

Python 26.73% Shell 0.27% Makefile 0.01% C 1.39% CMake 0.42% Batchfile 0.17% Java 70.79% GLSL 0.11% HTML 0.12%

minerl's Introduction

The MineRL Python Package

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

pip3 install --upgrade minerl

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.sarsd_iter(
        num_epochs=1, max_sequence_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.

minerl's People

Contributors

madcowd avatar brandonhoughton avatar pzhokhov avatar keisuke-nakata avatar adrienle avatar joosthuizinga avatar olegklimov avatar skbly7 avatar tomsilver avatar jietang avatar lbertge avatar thisisisaac avatar eambutu avatar tfzee avatar oscmansan avatar nicomon24 avatar glennpow avatar decodyng avatar miffyli avatar andkram avatar albertwujj avatar agostbiro avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.