资源算法pysc2-examples

pysc2-examples

2019-12-30 | |  44 |   0 |   0

StartCraft II Reinforcement Learning Examples

This example program was built on

Current examples

Minimaps

  • CollectMineralShards with Deep Q Network

Quick Start Guide

1. Get PySC2

PyPI

The easiest way to get PySC2 is to use pip:

$ pip install git+https://github.com/deepmind/pysc2

Also, you have to install baselines library.

$ pip install git+https://github.com/openai/baselines

2. Install StarCraft II

Mac / Win

You have to purchase StarCraft II and install it. Or even the Starter Edition will work.

http://us.battle.net/sc2/en/legacy-of-the-void/

Linux Packages

Follow Blizzard's documentation to get the linux version. By default, PySC2 expects the game to live in~/StarCraftII/.

3. Download Maps

Download the ladder mapsand the mini gamesand extract them to your StarcraftII/Maps/ directory.

4. Train it!

$ python train_mineral_shards.py --algorithm=a2c

5. Enjoy it!

$ python enjoy_mineral_shards.py

4-1. Train it with DQN

$ python train_mineral_shards.py --algorithm=deepq --prioritized=True --dueling=True --timesteps=2000000 --exploration_fraction=0.2

4-2. Train it with A2C(A3C)

$ python train_mineral_shards.py --algorithm=a2c --num_agents=2 --num_scripts=2 --timesteps=2000000

DescriptionDefaultParameter Type
mapGym EnvironmentCollectMineralShardsstring
loglogging type  : tensorboard, stdouttensorboardstring
algorithmCurrently, support 2 algorithms  : deepq, a2ca2cstring
timestepsTotal training steps2000000int
exploration_fractionexploration fraction0.5float
prioritizedWhether using prioritized replay for DQNFalseboolean
duelingWhether using dueling network for DQNFalseboolean
lrlearning rate (if 0 set random e-5 ~ e-3)0.0005float
num_agentsnumber of agents for A2C4int
num_scriptsnumber of scripted agents for A2C4int
nstepsnumber of steps for update policy20int


上一篇:5stardataportals

下一篇:pysc2-tutorial

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • shih-styletransfer

    shih-styletransfer Code from Style Transfer ...