Skip to content

Commit d51a1ee

Browse files
authored
Merge pull request #450 from yandexdataschool/spring20
Merge spring20 into master
2 parents ff1f81e + 3cd62f6 commit d51a1ee

File tree

142 files changed

+200559
-219602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+200559
-219602
lines changed

Dockerfile

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
# Practical_RL
12

2-
# Practical_RL [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/yandexdataschool/practical_rl/master)
33
An open course on reinforcement learning in the wild.
44
Taught on-campus at [HSE](https://cs.hse.ru) and [YSDA](https://yandexdataschool.com/) and maintained to be friendly to online students (both english and russian).
55

@@ -12,17 +12,17 @@ Taught on-campus at [HSE](https://cs.hse.ru) and [YSDA](https://yandexdataschool
1212
[![Github contributors](https://img.shields.io/github/contributors/yandexdataschool/Practical_RL.svg?logo=github&logoColor=white)](https://github.com/yandexdataschool/Practical_RL/graphs/contributors)
1313

1414
# Course info
15-
* __Chat room__ for YSDA & HSE students is [here](https://t.me/joinchat/CDFcMVcoAQvEiI9WAo1pEQ)
15+
* __Chat room__ for YSDA & HSE students is [here](http://t.me/practical_rl_2020)
1616
* __Grading__ rules for YSDA & HSE students is [here](https://github.com/yandexdataschool/Practical_RL/wiki/Homeworks-and-grading)
1717

1818
* __FAQ:__ [About the course](https://github.com/yandexdataschool/Practical_RL/wiki/Practical-RL), [Technical issues thread](https://github.com/yandexdataschool/Practical_RL/issues/1), [Lecture Slides](https://yadi.sk/d/loPpY45J3EAYfU), [Online Student Survival Guide](https://github.com/yandexdataschool/Practical_RL/wiki/Online-student's-survival-guide)
1919

2020
* Anonymous [feedback form](https://docs.google.com/forms/d/e/1FAIpQLSdurWw97Sm9xCyYwC8g3iB5EibITnoPJW2IkOVQYE_kcXPh6Q/viewform).
2121

2222
* Virtual course environment:
23+
* [__Google Colab__](https://colab.research.google.com/) - set open -> github -> yandexdataschool/pracical_rl -> {branch name} and select any notebook you want.
2324
* [Installing dependencies](https://github.com/yandexdataschool/Practical_RL/issues/1) on your local machine (recommended).
24-
* [__google colab__](https://colab.research.google.com/) - set open -> github -> yandexdataschool/pracical_rl -> {branch name} and select any notebook you want.
25-
* Alternatives: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/yandexdataschool/practical_rl/master) and [Azure Notebooks](https://notebooks.azure.com/).
25+
* Alternative: [Azure Notebooks](https://notebooks.azure.com/).
2626

2727

2828
# Additional materials
@@ -94,6 +94,7 @@ Course materials and teaching by: _[unordered]_
9494
- [Mikhail Konobeev](https://github.com/MichaelKonobeev) - seminars, hw checkups
9595
- [Ivan Kharitonov](https://github.com/neer201) - seminars, hw checkups
9696
- [Ravil Khisamov](https://github.com/zshrav) - seminars, hw checkups
97+
- [Anna Klepova](https://github.com/q0o0p) - hw checkups
9798
- [Fedor Ratnikov](https://github.com/justheuristic) - admin stuff
9899

99100
# Contributions

docker/Dockerfile

Lines changed: 54 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,65 @@
1-
FROM ubuntu:16.04
1+
ARG device
2+
ARG username="jovyan"
3+
4+
FROM ubuntu:18.04 AS base-cpu
5+
6+
FROM nvidia/cuda:10.2-base-ubuntu18.04 AS base-gpu
7+
8+
FROM base-$device AS base
9+
10+
ARG username
11+
ENV DEBIAN_FRONTEND=noninteractive
12+
13+
RUN apt-get -qq update && \
14+
apt-get install -y wget unzip git cmake xvfb sudo freeglut3-dev ffmpeg
15+
16+
RUN adduser --disabled-password --gecos "Default user" $username && \
17+
adduser $username sudo && \
18+
echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
19+
mkdir /notebooks && \
20+
chown -R $username /notebooks
21+
22+
RUN su $username -c \
23+
"wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh \
24+
-O /tmp/anaconda3.sh" && \
25+
mkdir -p /opt/conda && \
26+
chown -R $username /opt/conda && \
27+
su $username -c "/bin/bash /tmp/anaconda3.sh -b -p /opt/conda -u" && \
28+
rm /tmp/anaconda3.sh && \
29+
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
30+
su $username -c "echo '. /opt/conda/etc/profile.d/conda.sh' >> ~/.bashrc" && \
31+
su $username -c "echo 'conda activate base' >> ~/.bashrc"
32+
33+
ADD deeplearning.yaml /tmp/deeplearning-template.yaml
34+
35+
USER $username
36+
SHELL ["/bin/bash", "-i", "-c"]
37+
RUN conda install -y jupyter
38+
39+
FROM base AS stage-cpu
40+
RUN sed -e "s/{tensorflow}/tensorflow/g" -e "s/{pytorch}/pytorch/g" /tmp/deeplearning-template.yaml > /tmp/deeplearning.yaml
41+
42+
FROM base AS stage-gpu
43+
RUN sed -e "s/{tensorflow}/tensorflow-gpu/g" -e "s/{pytorch}/pytorch-gpu/g" /tmp/deeplearning-template.yaml > /tmp/deeplearning.yaml
44+
45+
FROM stage-$device as final
46+
247
LABEL maintainer "Alexander Panin <[email protected]>, Dmitry Mittov <[email protected]>"
348

49+
ARG username
50+
USER $username
51+
SHELL ["/bin/bash", "-i", "-c"]
452

5-
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
6-
apt-get -qq update && \
7-
apt-get install -y cmake \
8-
wget \
9-
unzip \
10-
git \
11-
zlib1g-dev \
12-
libjpeg-dev \
13-
xvfb \
14-
libav-tools \
15-
xorg-dev \
16-
python-opengl \
17-
swig3.0 \
18-
python-dev \
19-
python3-dev \
20-
python-pip \
21-
python3-pip \
22-
libopenblas-dev \
23-
liblapack-dev \
24-
libsdl2-dev \
25-
libboost-all-dev \
26-
graphviz \
27-
gcc \
28-
g++ && \
29-
ln -s /usr/bin/swig3.0 /usr/bin/swig
30-
31-
RUN pip install --upgrade pip==9.0.3 && \
32-
pip install --upgrade numpy scipy && \
33-
pip install --upgrade sklearn \
34-
jupyter \
35-
tqdm \
36-
graphviz \
37-
gym gym[box2d] gym[atari] \
38-
matplotlib \
39-
seaborn && \
40-
pip install --upgrade https://github.com/Theano/Theano/archive/master.zip \
41-
https://github.com/Lasagne/Lasagne/archive/master.zip \
42-
https://github.com/yandexdataschool/AgentNet/archive/master.zip \
43-
tensorflow \
44-
https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp27-cp27mu-linux_x86_64.whl \
45-
torchvision \
46-
keras
47-
48-
RUN pip install --upgrade gym_pull ppaquette-gym-doom
49-
50-
51-
RUN pip3 install --upgrade pip==9.0.3 && \
52-
pip3 install --upgrade numpy scipy && \
53-
pip3 install --upgrade sklearn \
54-
jupyter \
55-
tqdm \
56-
graphviz \
57-
gym gym[box2d] gym[atari] \
58-
matplotlib \
59-
seaborn && \
60-
pip3 install --upgrade https://github.com/Theano/Theano/archive/master.zip \
61-
https://github.com/Lasagne/Lasagne/archive/master.zip \
62-
https://github.com/yandexdataschool/AgentNet/archive/master.zip \
63-
https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl \
64-
torchvision \
65-
tensorflow \
66-
keras && \
67-
python3 -m ipykernel.kernelspec
53+
RUN conda env create -f /tmp/deeplearning.yaml && \
54+
conda activate deeplearning && \
55+
python -m ipykernel install --user --name python3 --display-name "Python 3"
6856

57+
RUN sudo rm /tmp/deeplearning*.yaml
6958

7059
EXPOSE 8888
7160
VOLUME /notebooks
7261
WORKDIR /notebooks
62+
ENV PATH /opt/conda/bin:$PATH
7363

7464
COPY run_jupyter.sh /
7565
CMD ["/run_jupyter.sh"]

docker/README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,47 @@ _tl;dr [dockerhub url](https://hub.docker.com/r/justheuristic/practical_rl/)_
77
We recommend you to use either native docker (recommended for linux) or kitematic(recommended for windows).
88
* Installing [kitematic](https://kitematic.com/), a simple interface to docker (all platforms)
99
* Pure docker: Guide for [windows](https://docs.docker.com/docker-for-windows/), [linux](https://docs.docker.com/engine/installation/), or [macOS](https://docs.docker.com/docker-for-mac/).
10+
* If you want to use your GPU make sure you have [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) and [NVidia driver](https://www.nvidia.com/en-us/drivers/unix/) + [CUDA 10.2](https://developer.nvidia.com/cuda-downloads) installed
1011

1112
Below are the instructions for both approaches.
1213

1314
## Kitematic
14-
Find justheuristic/practical_rl in the search menu. Download and launch the container.
15+
Find dmittov/practical_rl in the search menu. Download and launch the container.
1516

1617
Click on "web preview" screen in the top-right __or__ go to settings, ports and find at which port your jupyter is located, usually 32***.
1718

1819
## Native
19-
`docker run --rm -it -v /path/to/your/repo:/notebooks -p <local_port>:8888 justheuristic/practical_rl`
20+
`docker run --rm -it -v /path/to/your/repo:/notebooks -p <local_port>:8888 dmittov/practical_rl:spring2020-cpu`
2021

2122
For example,
22-
```docker run --rm -it -v /home/myuser/Documents/practical_rl:/notebooks -p 8888:8888 justheuristic/practical_rl```
23+
```docker run --rm -it -v /home/myuser/Documents/practical_rl:/notebooks -p 8888:8888 dmittov/practical_rl:spring2020-cpu```
2324

2425

2526
Then you can access your jupyter in a browser at `localhost:<local_port>/?token=<token_you_see_in_container_logs>`, e.g. `localhost:8888/?token=ad1a5a0aab43efb47a9a805388fcf508d0b5f84a16e4542b&token=ad1a5a0aab43efb47a9a805388fcf508d0b5f84a16e4542b`
2627

28+
#### GPU
29+
`docker run --rm -it -v /path/to/your/repo:/notebooks -p <local_port>:8888 --gpus all dmittov/practical_rl:spring2020-cuda-10.2`
30+
2731
## Manual
2832
Build container
2933

30-
`$ docker build -t dl .`
34+
`docker build -t practical_rl --build-arg device=cpu .`
35+
36+
to build GPU version
3137

38+
`docker build -t practical_rl --build-arg device=gpu .`
3239

3340
Run it
3441

35-
`$ docker run --rm -it -v <local_dir>:/notebooks -p <local_port>:8888 dl`
42+
`$ docker run --rm -it -v <local_dir>:/notebooks -p <local_port>:8888 practical_rl`
43+
44+
to run GPU version
45+
46+
`$ docker run --rm -it -v <local_dir>:/notebooks -p <local_port>:8888 --gpus all practical_rl`
3647

3748
examples:
3849

39-
```$ docker run --rm -it -v `pwd`:/notebooks -p 8888:8888 dl```
50+
```$ docker run --rm -it -v `pwd`:/notebooks -p 8888:8888 practical_rl```
4051

4152
Copy the token from console and run
4253
http://localhost:8888/?token=<token>

docker/deeplearning.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: deeplearning
2+
channels:
3+
- defaults
4+
dependencies:
5+
- graphviz
6+
- python-graphviz
7+
- ipykernel
8+
- keras
9+
- numpy=1.16.6
10+
- pip
11+
- scipy
12+
- {tensorflow}=1.13.1
13+
- tqdm
14+
- pyopengl-accelerate
15+
- {pytorch}
16+
- torchvision
17+
- opencv
18+
- pip:
19+
- atari-py
20+
- sklearn
21+
- matplotlib
22+
- seaborn
23+
- scikit-image
24+
- imageio
25+
- pyglet
26+
- psutil
27+
- gym
28+
- gym[box2d]
29+
- gym[atari]
30+
- requests
31+
- editdistance
32+
prefix: /opt/conda/envs/deeplearning

docker/run_jupyter.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/usr/bin/env bash
2-
jupyter notebook --no-browser --allow-root --ip 0.0.0.0
3-
2+
jupyter notebook --no-browser --ip 0.0.0.0

setup_colab.sh

100644100755
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#!/bin/bash
2-
# a setup script for google colab. Will be updated
3-
pip install gym
4-
apt-get install -y xvfb
5-
wget https://raw.githubusercontent.com/yandexdataschool/Practical_DL/fall18/xvfb -O ../xvfb
6-
apt-get install -y python-opengl ffmpeg
7-
pip install pyglet==1.2.4
1+
#!/usr/bin/env bash
82

3+
apt-get -qq update
4+
apt-get -qq install -y xvfb
5+
wget -q https://raw.githubusercontent.com/yandexdataschool/Practical_RL/spring20/xvfb -O ../xvfb

week01_intro/README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
## Materials:
22
* [__Lecture slides__](https://yadi.sk/i/-EUHXUXOTC5t9Q)
33
* __Russian:__
4-
* Intro to RL - [video](https://yadi.sk/i/bMo0qa-x3DoqkS)
5-
* Blackbox optimization - [video](https://yadi.sk/i/5yf_4oGI3EDJhJ)
6-
* Seminar - [video](https://yadi.sk/i/dPsWYMK13EDJj7) _only covering crossentropy method_
4+
* Intro to RL - [video](https://yadi.sk/i/HpRw6zYv3SPmFf)
5+
* Seminar - [video](https://yadi.sk/i/gRTVCHfM3SPmHo)
76

87
* __English:__
98
* [__main__] Video-intro by David Silver (english) - [video](https://www.youtube.com/watch?v=2pWv7GOvuf0)
@@ -20,14 +19,14 @@
2019
* About Differential evolution (english) - [pdf](http://jvanderw.une.edu.au/DE_1.pdf)
2120
* Video on Ant Colony Algorithm (english) - [video](https://www.youtube.com/watch?v=D58nLNLkb0I)
2221
* Longer video on Ant Colony Algorithm (english) - [video](https://www.youtube.com/watch?v=xpyKmjJuqhk)
23-
22+
* Longer video on corssentropy method (russian) - [video](https://yadi.sk/i/5yf_4oGI3EDJhJ)
23+
2424

2525
## Practice assignment
26-
Instant dive in: [__seminar_gym_interface__](https://colab.research.google.com/github/yandexdataschool/Practical_RL/blob/master/week01_intro/seminar_gym_interface.ipynb), [__crossentropy_method__](https://colab.research.google.com/github/yandexdataschool/Practical_RL/blob/master/week01_intro/crossentropy_method.ipynb)
26+
Instant dive in: [__seminar_gym_interface__](https://colab.research.google.com/github/yandexdataschool/Practical_RL/blob/master/week01_intro/seminar_gym_interface.ipynb), [__crossentropy_method__](https://colab.research.google.com/github/yandexdataschool/Practical_RL/blob/master/week01_intro/crossentropy_method.ipynb),
27+
[__deep_crossentropy_method__](https://colab.research.google.com/github/yandexdataschool/Practical_RL/blob/master/week01_intro/deep_crossentropy_method.ipynb)
2728

2829
* Open `gym_interface.ipynb` and follow instructions from there
2930
* After you're done there, proceed to `crossentropy_method.ipynb`
3031
* You can find homework and bonus assignment descriptions at the end of that notebook.
3132
* Note: so far it's enough to say `pip install gym` on top of any data-science-stuffed python, but we'd appreciate if you gradually switch to [full installation](https://github.com/openai/gym#installing-everything).
32-
33-

0 commit comments

Comments
 (0)