{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Copyright (c) Microsoft Corporation. All rights reserved.\n", "\n", "Licensed under the MIT License." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Reinforcement Learning in Azure Machine Learning - Training a Minecraft agent using custom environments\n", "\n", "This tutorial will show how to set up a more complex reinforcement\n", "learning (RL) training scenario. It demonstrates how to train an agent to\n", "navigate through a lava maze in the Minecraft game using Azure Machine\n", "Learning.\n", "\n", "**Please note:** This notebook trains an agent on a randomly generated\n", "Minecraft level. As a result, on rare occasions, a training run may fail\n", "to produce a model that can solve the maze. If this happens, you can\n", "re-run the training step as indicated below.\n", "\n", "**Please note:** This notebook uses 1 NC6 type node and 8 D2 type nodes\n", "for up to 5 hours of training, which corresponds to approximately $9.06 (USD)\n", "as of May 2020.\n", "\n", "Minecraft is currently one of the most popular video\n", "games and as such has been a study object for RL. [Project \n", "Malmo](https://www.microsoft.com/en-us/research/project/project-malmo/) is\n", "a platform for artificial intelligence experimentation and research built on\n", "top of Minecraft. We will use Minecraft [gym](https://gym.openai.com) environments from Project\n", "Malmo's 2019 MineRL competition, which are part of the \n", "[MineRL](http://minerl.io/docs/index.html) Python package.\n", "\n", "Minecraft environments require a display to run, so we will demonstrate\n", "how to set up a virtual display within the docker container used for training.\n", "Learning will be based on the agent's visual observations. To\n", "generate the necessary amount of sample data, we will run several\n", "instances of the Minecraft game in parallel. Below, you can see a video of\n", "a trained agent navigating a lava maze. Starting from the green position,\n", "it moves to the blue position by moving forward, turning left or turning right:\n", "\n", "
\n",
" \n",
" | \n",
"
|---|
| Fig 1. Video of a trained Minecraft agent navigating a lava maze. | \n", "