Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
61 changes: 30 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# LIS (Life in Silico)
# LIS (Life in Silico) ver2
=============
LIS (Life In Silico) is a framework that makes intelligent agents _live_ in a virtual environment.
LIS version 2 uses [Unity Game Engine](https://unity3d.com) for the virtual environment and [OpenAI Gym](https://gym.openai.com) for the learning agent framework.


![screenshot](https://cloud.githubusercontent.com/assets/1708549/14311902/c6ce61ec-fc24-11e5-8018-5e3aaf98b6d3.png)

## Algorithm
<img width="371" alt="2016-04-08 19 00 14" src="https://cloud.githubusercontent.com/assets/1708549/14380751/2fec7856-fdbc-11e5-9ac0-17650fc74f34.png">
<img width="470" alt="Lisv2algorithm" src="https://cloud.githubusercontent.com/assets/21034484/18500782/accc85a0-7a85-11e6-8957-cfc9cd87fdc6.png">

### Algorithm Reference
+ Mnih, V. et al. Human-level control through deep reinforcement learning. Nature 518, 529–533 (2015)
Expand Down Expand Up @@ -56,25 +59,25 @@ download data:
./fetch.sh
```

Next, run python module as a server.
Open unity-sample-environment with Unity and load Scenes/Sample.

```
cd python-agent
python server.py
```
![2016-09-13 10 27 53](https://cloud.githubusercontent.com/assets/21034484/18458591/0d40c912-799d-11e6-88da-5af8018fc784.png)

Open unity-sample-environment with Unity and load Scenes/Sample.
Press Start Button.

![screenshot from 2016-04-06 18 08 31](https://cloud.githubusercontent.com/assets/1708549/14311462/990e607e-fc22-11e5-84cf-26c049482afc.png)
![2016-09-13 10 28 14](https://cloud.githubusercontent.com/assets/21034484/18458604/342c6eaa-799d-11e6-987b-cbc06b00f497.png)

Press Start Buttn. This will take a few minuts for loading caffe model.
Next, run python module as a client.This will take a few minutes for loading caffe model.

![screenshot from 2016-04-06 18 09 36](https://cloud.githubusercontent.com/assets/1708549/14311518/c309f8f2-fc22-11e5-937c-abd0d227d307.png)
```
cd gym_client/examples/agents
PYTHONPATH=../../ python Lis_dqn.py
```

You can watch reward history:

```
cd python-agent
cd gym_client/examples/agents
python plot_reward_log.py
```

Expand All @@ -87,31 +90,19 @@ This graph is a "sample" scene result. It takes about 6 hours on GPU Machine.

[SampleLikesAndDislikes scene result movie](https://www.youtube.com/watch?v=IERCgdG1_fw)

## Multi Agent
This is supported only SYNC mode. ASYNC mode is not supprted.

Start multi agent server:
## Examples

```
cd python-agent
python multi_agent.py --agent-count=2
```
Next, open unity-sample-environment and load Scenes/SampleMultiAgent.


You can watch reward history:

```
python plot_reward_log.py --log-file=reward_0.log
```
See the examples directory
- Run examples/agents/Lis_random.py to run an simple random agent
- Run examples/agents/Lis_dqn.py to run an Deep Q-Network agent

## System Configuration

- Client: Unity
- Server: python module
- Client: python module(gym)
- Server: Unity
- Communication: Socket (WebSocket over TCP) using MessagePack

<img width="300" alt="2016-04-09 4 14 49" src="https://cloud.githubusercontent.com/assets/1708549/14394932/bbd77756-fe09-11e5-89ba-da7834c2a39e.png">
<img width="300" alt="2016-04-09 4 14 49" src="https://cloud.githubusercontent.com/assets/21034484/18440301/9265bbf2-7943-11e6-93a5-93d49d98f8d6.png">

## Tips
### Simulate faster
Expand All @@ -134,6 +125,14 @@ This will make simulation more faster, but it will be slow gui response.
+ The MIT License (MIT)
+ Assets/Packages/websocket-sharp

+ websocket-client
+ Copyright (C) 2010 Hiroki Ohtani(liris)
+ LGPL License

+ gym
+ Copyright (c) 2016 OpenAI (http://openai.com)
+ The MIT License (MIT)
+ LIS-ver2/gym_client/gym

## License
+ Apache License, Version 2.0
Expand Down
4 changes: 2 additions & 2 deletions fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#!/bin/bash

echo "download caffemodel..."
curl -o python-agent/bvlc_alexnet.caffemodel http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel
curl -o gym_client/examples/agents/bvlc_alexnet.caffemodel http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel

curl -f -L -o python-agent/ilsvrc_2012_mean.npy https://github.com/BVLC/caffe/raw/master/python/caffe/imagenet/ilsvrc_2012_mean.npy
curl -f -L -o gym_client/examples/agents/ilsvrc_2012_mean.npy https://github.com/BVLC/caffe/raw/master/python/caffe/imagenet/ilsvrc_2012_mean.npy

13 changes: 13 additions & 0 deletions gym_client/CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
OpenAI Gym is dedicated to providing a harassment-free experience for
everyone, regardless of gender, gender identity and expression, sexual
orientation, disability, physical appearance, body size, age, race, or
religion. We do not tolerate harassment of participants in any form.

This code of conduct applies to all OpenAI Gym spaces (including Gist
comments) both online and off. Anyone who violates this code of
conduct may be sanctioned or expelled from these spaces at the
discretion of the OpenAI team.

We may add additional rules over time, which will be made clearly
available to participants. Participants are responsible for knowing
and abiding by these rules.
37 changes: 37 additions & 0 deletions gym_client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# A Dockerfile that sets up a full Gym install
FROM ubuntu:14.04

RUN apt-get update \
&& apt-get install -y libav-tools \
python-numpy \
python-scipy \
python-pyglet \
python-setuptools \
libpq-dev \
libjpeg-dev \
curl \
cmake \
swig \
python-opengl \
libboost-all-dev \
libsdl2-dev \
wget \
unzip \
git \
xpra \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& easy_install pip

WORKDIR /usr/local/gym
RUN mkdir -p gym && touch gym/__init__.py
COPY ./gym/version.py ./gym
COPY ./requirements.txt .
COPY ./setup.py .
RUN pip install -e .[all]

# Finally, upload our actual code!
COPY . /usr/local/gym

WORKDIR /root
ENTRYPOINT ["/usr/local/gym/bin/docker_entrypoint"]
21 changes: 21 additions & 0 deletions gym_client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2016 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
24 changes: 24 additions & 0 deletions gym_client/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.PHONY: install test

install:
pip install -r requirements.txt

base:
docker pull ubuntu:14.04
docker tag ubuntu:14.04 quay.io/openai/gym:base
docker push quay.io/openai/gym:base

test:
docker build -f test.dockerfile -t quay.io/openai/gym:test .
docker push quay.io/openai/gym:test

upload:
rm -rf dist
python setup.py sdist
twine upload dist/*

docker-build:
docker build -t quay.io/openai/gym .

docker-run:
docker run -ti quay.io/openai/gym bash
Loading