Initial commit
This commit adds a basic random action gym environment which can be built into a Docker image using CrowdAI's repo2docker.
This commit is contained in:
Родитель
e2f97c7d2a
Коммит
9203a11f63
|
@ -0,0 +1,3 @@
|
|||
UnitySDK.log
|
||||
__pycache__
|
||||
.DS_STORE
|
30
README.md
30
README.md
|
@ -1,2 +1,28 @@
|
|||
# obstacle-tower-challenge
|
||||
Repository for the MLAgents Obstacle Tower challenge
|
||||
# Obstacle Tower Challenge Starter Kit
|
||||
|
||||
## Setup
|
||||
|
||||
* **repo2docker**
|
||||
|
||||
```
|
||||
pip install crowdai-repo2docker
|
||||
```
|
||||
|
||||
## Build Docker image
|
||||
|
||||
```
|
||||
./build.sh
|
||||
```
|
||||
|
||||
## Run Docker image
|
||||
|
||||
```
|
||||
docker run -it obstacle_tower_challenge:latest
|
||||
docker exec -it [CONTAINER_ID] ./run.sh
|
||||
```
|
||||
|
||||
## Local Run
|
||||
|
||||
```
|
||||
./run.sh
|
||||
```
|
|
@ -0,0 +1,3 @@
|
|||
curl
|
||||
git
|
||||
xvfb
|
|
@ -0,0 +1,7 @@
|
|||
export IMAGE_NAME="obstacle_tower_challenge"
|
||||
|
||||
crowdai-repo2docker --no-run \
|
||||
--user-id 1001 \
|
||||
--user-name crowdai \
|
||||
--image-name ${IMAGE_NAME} \
|
||||
--debug .
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"challenge_id" : "crowdai-mlagents-2018-obstacletower",
|
||||
"grader_id": "crowdai-mlagents-2018-obstacletower",
|
||||
"authors" : ["harperj"],
|
||||
"description" : "Obstacle Tower random agent",
|
||||
"gpu": false
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
curl https://storage.googleapis.com/obstacle-tower-build/obstacletower_linux.zip > obstacletower_linux.zip
|
||||
unzip obstacletower_linux.zip
|
|
@ -0,0 +1 @@
|
|||
git+git://github.com/Unity-Technologies/obstacle-tower-env@master
|
|
@ -0,0 +1,28 @@
|
|||
from obstacle_tower_env import ObstacleTowerEnv
|
||||
import sys
|
||||
|
||||
def run_episode(env):
|
||||
env.reset()
|
||||
done = False
|
||||
reward = 0.0
|
||||
|
||||
while not done:
|
||||
action = env.action_space.sample()
|
||||
obs, reward, done, info = env.step(action)
|
||||
return reward
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
environment_filename = \
|
||||
sys.argv[1] if len(sys.argv) > 1 else './ObstacleTower/obstacletower'
|
||||
|
||||
env = ObstacleTowerEnv(environment_filename)
|
||||
if env.is_grading():
|
||||
score = run_episode(env)
|
||||
else:
|
||||
while True:
|
||||
reward = run_episode(env)
|
||||
print("Episode reward: " + str(reward))
|
||||
|
||||
env.close()
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Use This line would work in case of the docker container
|
||||
# Else the relevant env variables will not be loaded during evaluatino
|
||||
source activate base
|
||||
echo "root"
|
||||
|
||||
python run.py
|
Загрузка…
Ссылка в новой задаче