Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# A Dockerfile that sets up a full SenseNet 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 \ | ||
freeglut3 \ | ||
python-opengl \ | ||
libboost-all-dev \ | ||
libglu1-mesa \ | ||
libglu1-mesa-dev \ | ||
libsdl2-2.0-0\ | ||
libgles2-mesa-dev \ | ||
libsdl2-dev \ | ||
wget \ | ||
unzip \ | ||
git \ | ||
xserver-xorg-input-void \ | ||
xserver-xorg-video-dummy \ | ||
python-gtkglext1 \ | ||
xpra \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& easy_install pip | ||
|
||
WORKDIR /usr/local/sensenet | ||
RUN mkdir -p sensenet && touch sensenet/__init__.py | ||
COPY ./sensenet/version.py ./sensenet | ||
COPY ./requirements.txt . | ||
COPY ./setup.py . | ||
RUN pip install -e .[all] | ||
|
||
# Finally, upload our actual code! | ||
COPY . /usr/local/sensenet | ||
|
||
WORKDIR /root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
import gym | ||
from env import TouchEnv | ||
from torch.autograd import Variable | ||
import torch | ||
def select_action(state): | ||
state = torch.from_numpy(state).float().unsqueeze(0) | ||
return state | ||
|
||
tenv = SenseEnv() | ||
env = gym.make("CartPole-v0") | ||
input_dim = env.observation_space.shape[0] | ||
output_dim = env.action_space.n | ||
tinput_dim = tenv.observation_space() | ||
toutput_dim = len(tenv.action_space()) | ||
print("gym observation space: ",input_dim) | ||
print("gym action space: ",output_dim) | ||
print("touch observation space: ",tinput_dim) | ||
print("touch action space: ",toutput_dim) | ||
state = env.reset() | ||
tstate = tenv.reset() | ||
print("gym state:",state) | ||
print("touch state:",tstate) | ||
print("new gym action:",select_action(state)) | ||
print("new touch action:",select_action(tstate)) | ||
#state, reward, done, _ = env.step(action[0,0]) |