├── .DS_Store
├── README.md
├── modulabs_lecture
└── 모두연 저자특강.pdf
├── naver_seminar
└── RLCode와 A3C 쉽고 깊게 이해하기.pdf
├── snu_lecture
├── .DS_Store
├── code
│ ├── deep-sarsa
│ │ ├── __pycache__
│ │ │ └── environment.cpython-35.pyc
│ │ ├── deep_sarsa_agent.py
│ │ ├── deep_sarsa_exercise1.py
│ │ ├── deep_sarsa_exercise2.py
│ │ ├── environment.py
│ │ ├── save_graph
│ │ │ ├── deep_sarsa_.png
│ │ │ └── deep_sarsa_trained.png
│ │ └── save_model
│ │ │ ├── deep_sarsa.h5
│ │ │ └── deep_sarsa_trained.h5
│ ├── img
│ │ ├── circle.png
│ │ ├── down.png
│ │ ├── left.png
│ │ ├── rectangle.png
│ │ ├── right.png
│ │ ├── triangle.png
│ │ └── up.png
│ ├── keras_example
│ │ └── sequential_model.py
│ └── q-learning
│ │ ├── .python-version
│ │ ├── __pycache__
│ │ ├── environment.cpython-35.pyc
│ │ └── environment.cpython-36.pyc
│ │ ├── environment.py
│ │ ├── q_learning_agent.py
│ │ ├── q_learning_exercise1.py
│ │ └── q_learning_exercise2.py
├── install_guide
│ ├── .DS_Store
│ ├── README.md
│ ├── img
│ │ ├── how-to-windows.png
│ │ ├── link-env-with-pychar-1.png
│ │ ├── link-env-with-pychar-2.png
│ │ ├── link-env-with-pychar.png
│ │ ├── numpy_install.png
│ │ ├── numpy_install2.png
│ │ ├── numpy_install3.png
│ │ ├── python3png.png
│ │ ├── python_install.png
│ │ ├── win_atari.png
│ │ ├── win_atari.py3.png
│ │ ├── win_breakout.png
│ │ ├── win_breakout2.png
│ │ ├── win_git.png
│ │ ├── win_git2.png
│ │ ├── win_gym.png
│ │ ├── win_make.png
│ │ ├── win_make2.png
│ │ ├── win_msys2.png
│ │ ├── win_msys2_2.png
│ │ ├── win_msys2_3.png
│ │ ├── win_msys2_4.png
│ │ ├── win_msys2_5.png
│ │ ├── win_openai_gym.png
│ │ ├── win_openai_gym2.png
│ │ ├── win_openai_gym3.png
│ │ ├── win_openai_gym4.png
│ │ ├── win_openai_gym5.png
│ │ ├── win_pycharm_install1.png
│ │ ├── win_pycharm_project.png
│ │ ├── win_pycharm_project2.png
│ │ ├── win_pycharm_setting2.png
│ │ ├── win_pycharm_settings.png
│ │ ├── win_setting.png
│ │ ├── win_setting2.png
│ │ ├── win_setting3.png
│ │ ├── win_setting4.png
│ │ ├── win_setup.py.png
│ │ ├── win_setup.py2.png
│ │ └── win_xming.png
│ ├── install_image
│ │ ├── .DS_Store
│ │ ├── atari_breakout.png
│ │ ├── cartpole_exam.png
│ │ ├── console_hello_world.png
│ │ ├── deep_sarsa.png
│ │ ├── deep_sarsa_run.png
│ │ ├── deep_sarsa_run2.png
│ │ ├── default_config.png
│ │ ├── file_setting.png
│ │ ├── hello_world_ubuntu.png
│ │ ├── install_keras.PNG
│ │ ├── install_matplotlib.PNG
│ │ ├── install_numpy.PNG
│ │ ├── install_pillow.PNG
│ │ ├── install_tensorflow.PNG
│ │ ├── openai_github.png
│ │ ├── project_interpreter.png
│ │ ├── pycham_new_project.png
│ │ ├── pycharm_community.png
│ │ ├── pycharm_drag.png
│ │ ├── pycharm_init.png
│ │ ├── python3_terminal.jpg
│ │ ├── python_download.png
│ │ ├── python_installed.png
│ │ ├── python_intalled.png
│ │ ├── q_learning.png
│ │ ├── q_learning_run.png
│ │ ├── rl_book_hello_world.png
│ │ ├── rl_book_project.png
│ │ ├── rl_book_venv.png
│ │ ├── rl_book_virtualenv.png
│ │ ├── rlcode_book_directory.png
│ │ ├── rlcode_project.png
│ │ ├── run_hello_world.png
│ │ ├── sh_pycharm.sh.png
│ │ └── terminal_rlcode_book.png
│ ├── 맥_설치가이드.md
│ ├── 우분투_설치가이드.md
│ └── 윈도우10_설치가이드.md
└── 서울대학교 인지과학 튜토리얼.pdf
└── wiki
├── .DS_Store
├── README.md
├── img
├── how-to-windows.png
├── link-env-with-pychar-1.png
├── link-env-with-pychar-2.png
├── link-env-with-pychar.png
├── numpy_install.png
├── numpy_install2.png
├── numpy_install3.png
├── python3png.png
├── python_install.png
├── win_atari.png
├── win_atari.py3.png
├── win_breakout.png
├── win_breakout2.png
├── win_git.png
├── win_git2.png
├── win_gym.png
├── win_make.png
├── win_make2.png
├── win_msys2.png
├── win_msys2_2.png
├── win_msys2_3.png
├── win_msys2_4.png
├── win_msys2_5.png
├── win_openai_gym.png
├── win_openai_gym2.png
├── win_openai_gym3.png
├── win_openai_gym4.png
├── win_openai_gym5.png
├── win_pycharm_install1.png
├── win_pycharm_project.png
├── win_pycharm_project2.png
├── win_pycharm_setting2.png
├── win_pycharm_settings.png
├── win_setting.png
├── win_setting2.png
├── win_setting3.png
├── win_setting4.png
├── win_setup.py.png
├── win_setup.py2.png
└── win_xming.png
├── install_image
├── .DS_Store
├── atari_breakout.png
├── cartpole_exam.png
├── console_hello_world.png
├── deep_sarsa_run.png
├── deep_sarsa_run2.png
├── default_config.png
├── file_setting.png
├── hello_world_ubuntu.png
├── install_keras.PNG
├── install_matplotlib.PNG
├── install_numpy.PNG
├── install_pillow.PNG
├── install_tensorflow.PNG
├── openai_github.png
├── project_interpreter.png
├── pycham_new_project.png
├── pycharm_community.png
├── pycharm_drag.png
├── pycharm_init.png
├── python3_terminal.jpg
├── python_download.png
├── python_installed.png
├── python_intalled.png
├── rl_book_hello_world.png
├── rl_book_project.png
├── rl_book_venv.png
├── rl_book_virtualenv.png
├── rlcode_book_directory.png
├── rlcode_project.png
├── run_hello_world.png
├── sh_pycharm.sh.png
└── terminal_rlcode_book.png
├── 맥_설치가이드.md
├── 우분투_설치가이드.md
└── 윈도우10_설치가이드.md
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/.DS_Store
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RLCode_tutorial
2 | RLCode 강화학습 튜토리얼 및 강의 자료들입니다
3 |
--------------------------------------------------------------------------------
/modulabs_lecture/모두연 저자특강.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/modulabs_lecture/모두연 저자특강.pdf
--------------------------------------------------------------------------------
/naver_seminar/RLCode와 A3C 쉽고 깊게 이해하기.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/naver_seminar/RLCode와 A3C 쉽고 깊게 이해하기.pdf
--------------------------------------------------------------------------------
/snu_lecture/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/.DS_Store
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/__pycache__/environment.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/deep-sarsa/__pycache__/environment.cpython-35.pyc
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/deep_sarsa_agent.py:
--------------------------------------------------------------------------------
1 | import pylab
2 | import random
3 | import numpy as np
4 | from environment import Env
5 | from keras.layers import Dense
6 | from keras.optimizers import Adam
7 | from keras.models import Sequential
8 |
9 | EPISODES = 1000
10 |
11 |
12 | # 그리드월드 예제에서의 딥살사 에이전트
13 | class DeepSARSAgent:
14 | def __init__(self):
15 | # 에이전트가 가능한 모든 행동 정의
16 | self.action_space = [0, 1, 2, 3, 4]
17 | # 상태의 크기와 행동의 크기 정의
18 | self.action_size = len(self.action_space)
19 | self.state_size = 15
20 | self.discount_factor = 0.99
21 | self.learning_rate = 0.001
22 |
23 | # 탐험 관련
24 | self.epsilon = 1.
25 | self.epsilon_decay = .9999
26 | self.epsilon_min = 0.01
27 | # 모델 생성
28 | self.model = self.build_model()
29 |
30 | # 상태가 입력 큐함수가 출력인 인공신경망 생성
31 | def build_model(self):
32 | model = Sequential()
33 | model.add(Dense(30, input_dim=self.state_size, activation='relu'))
34 | model.add(Dense(30, activation='relu'))
35 | model.add(Dense(self.action_size, activation='linear'))
36 | model.summary()
37 | model.compile(loss='mse', optimizer=Adam(lr=self.learning_rate))
38 | return model
39 |
40 | # 입실론 탐욕 방법으로 행동 선택
41 | def get_action(self, state):
42 | if random.random() <= self.epsilon:
43 | # 무작위 행동 반환
44 | action = random.choice(self.action_space)
45 | return action
46 | else:
47 | # 모델로부터 행동 산출
48 | state = np.float32(state)
49 | q_values = self.model.predict(state)[0]
50 | return np.argmax(q_values)
51 |
52 | def train_model(self, state, action, reward, next_state, next_action, done):
53 | state = np.float32(state)
54 | next_state = np.float32(next_state)
55 |
56 | # 살사의 큐함수 업데이트 식
57 | target = self.model.predict(state)[0]
58 | if done:
59 | target[action] = reward
60 | else:
61 | target[action] = (reward + self.discount_factor *
62 | self.model.predict(next_state)[0][next_action])
63 |
64 | # 출력 값 reshape
65 | target = np.reshape(target, [1, self.action_size])
66 | # 인공신경망 업데이트
67 | self.model.fit(state, target, epochs=1, verbose=0)
68 |
69 |
70 | if __name__ == "__main__":
71 | # 환경과 에이전트 생성
72 | env = Env()
73 | agent = DeepSARSAgent()
74 |
75 | global_step = 0
76 | scores, episodes = [], []
77 |
78 | for e in range(EPISODES):
79 | done = False
80 | score = 0
81 | state = env.reset()
82 | state = np.reshape(state, [1, 15])
83 |
84 | while not done:
85 | # env 초기화
86 | global_step += 1
87 | if agent.epsilon > agent.epsilon_min:
88 | agent.epsilon *= agent.epsilon_decay
89 |
90 | # 현재 상태에 대한 행동 선택
91 | action = agent.get_action(state)
92 | # 선택한 행동으로 환경에서 한 타임스텝 진행 후 샘플 수집
93 | next_state, reward, done = env.step(action)
94 | next_state = np.reshape(next_state, [1, 15])
95 | next_action = agent.get_action(next_state)
96 | # 샘플로 모델 학습
97 | agent.train_model(state, action, reward, next_state, next_action,
98 | done)
99 | state = next_state
100 | score += reward
101 |
102 | if done:
103 | # 에피소드마다 학습 결과 출력
104 | scores.append(score)
105 | episodes.append(e)
106 | pylab.plot(episodes, scores, 'b')
107 | pylab.savefig("./save_graph/deep_sarsa_.png")
108 | print("episode:", e, " score:", score, "global_step",
109 | global_step, " epsilon:", agent.epsilon)
110 |
111 | # 100 에피소드마다 모델 저장
112 | if e % 100 == 0:
113 | agent.model.save_weights("./save_model/deep_sarsa.h5")
114 |
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/deep_sarsa_exercise1.py:
--------------------------------------------------------------------------------
1 | from environment import Env
2 | import random
3 |
4 | if __name__ == "__main__":
5 | # 환경과 에이전트 생성
6 | env = Env()
7 |
8 | for episode in range(10):
9 | print('episode ' + str(episode) + ' ----------------')
10 | done = False
11 | state = env.reset()
12 |
13 | while not done:
14 | # 랜덤하게 행동 선택
15 | action = random.choice([0, 1, 2, 3, 4])
16 | # 선택한 행동으로 환경에서 한 타임스텝 진행
17 | state, reward, done = env.step(action)
18 |
19 | print('state: ', state, ' action: ', action, ' reward: ', reward)
20 |
21 | if done:
22 | break
23 |
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/deep_sarsa_exercise2.py:
--------------------------------------------------------------------------------
1 | import random
2 | import numpy as np
3 | from environment import Env
4 | from keras.layers import Dense
5 | from keras.optimizers import Adam
6 | from keras.models import Sequential
7 |
8 | EPISODES = 1000
9 |
10 |
11 | # 그리드월드 예제에서의 딥살사 에이전트
12 | class DeepSARSAgent:
13 | def __init__(self):
14 | # 에이전트가 가능한 모든 행동 정의
15 | self.action_space = [0, 1, 2, 3, 4]
16 | # 상태의 크기와 행동의 크기 정의
17 | self.action_size = len(self.action_space)
18 | self.state_size = 15
19 | self.discount_factor = 0.99
20 | self.learning_rate = 0.001
21 |
22 | # 탐험 관련
23 | self.epsilon = 1.
24 | self.epsilon_decay = .9999
25 | self.epsilon_min = 0.01
26 |
27 | # 모델 생성
28 |
29 | # 상태가 입력 큐함수가 출력인 인공신경망 생성
30 | def build_model(self):
31 | pass
32 |
33 | # 입실론 탐욕 방법으로 행동 선택
34 | def get_action(self, state):
35 | pass
36 |
37 | def train_model(self, state, action, reward, next_state, next_action, done):
38 | state = np.float32(state)
39 | next_state = np.float32(next_state)
40 |
41 | # 살사의 큐함수 업데이트 식
42 |
43 | # 출력 값 reshape
44 |
45 | # 인공신경망 업데이트
46 |
47 |
48 | if __name__ == "__main__":
49 | # 환경과 에이전트 생성
50 | env = Env()
51 | agent = DeepSARSAgent()
52 |
53 | global_step = 0
54 | scores, episodes = [], []
55 |
56 | for e in range(EPISODES):
57 | done = False
58 | score = 0
59 | state = env.reset()
60 | state = np.reshape(state, [1, 15])
61 |
62 | while not done:
63 | # env 초기화
64 | global_step += 1
65 | if agent.epsilon > agent.epsilon_min:
66 | agent.epsilon *= agent.epsilon_decay
67 |
68 | # 현재 상태에 대한 행동 선택
69 |
70 | # 선택한 행동으로 환경에서 한 타임스텝 진행 후 샘플 수집
71 |
72 | # 샘플로 모델 학습
73 |
74 | if done:
75 | # 에피소드마다 학습 결과 출력
76 | break
77 |
78 | # 100 에피소드마다 모델 저장
79 |
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/environment.py:
--------------------------------------------------------------------------------
1 | import time
2 | import numpy as np
3 | import tkinter as tk
4 | from PIL import ImageTk, Image
5 |
6 | PhotoImage = ImageTk.PhotoImage
7 | UNIT = 50 # 픽셀 수
8 | HEIGHT = 5 # 그리드 세로
9 | WIDTH = 5 # 그리드 가로
10 |
11 | np.random.seed(1)
12 |
13 |
14 | class Env(tk.Tk):
15 | def __init__(self):
16 | super(Env, self).__init__()
17 | self.action_space = ['u', 'd', 'l', 'r']
18 | self.action_size = len(self.action_space)
19 | self.title('DeepSARSA')
20 | self.geometry('{0}x{1}'.format(HEIGHT * UNIT, HEIGHT * UNIT))
21 | self.shapes = self.load_images()
22 | self.canvas = self._build_canvas()
23 | self.counter = 0
24 | self.rewards = []
25 | self.goal = []
26 | # 장애물 설정
27 | self.set_reward([0, 1], -1)
28 | self.set_reward([1, 2], -1)
29 | self.set_reward([2, 3], -1)
30 | # 목표 지점 설정
31 | self.set_reward([4, 4], 1)
32 |
33 | def _build_canvas(self):
34 | canvas = tk.Canvas(self, bg='white',
35 | height=HEIGHT * UNIT,
36 | width=WIDTH * UNIT)
37 | # 그리드 생성
38 | for c in range(0, WIDTH * UNIT, UNIT): # 0~400 by 80
39 | x0, y0, x1, y1 = c, 0, c, HEIGHT * UNIT
40 | canvas.create_line(x0, y0, x1, y1)
41 | for r in range(0, HEIGHT * UNIT, UNIT): # 0~400 by 80
42 | x0, y0, x1, y1 = 0, r, HEIGHT * UNIT, r
43 | canvas.create_line(x0, y0, x1, y1)
44 |
45 | self.rewards = []
46 | self.goal = []
47 | # 캔버스에 이미지 추가
48 | x, y = UNIT/2, UNIT/2
49 | self.rectangle = canvas.create_image(x, y, image=self.shapes[0])
50 |
51 | canvas.pack()
52 |
53 | return canvas
54 |
55 | def load_images(self):
56 | rectangle = PhotoImage(
57 | Image.open("../img/rectangle.png").resize((30, 30)))
58 | triangle = PhotoImage(
59 | Image.open("../img/triangle.png").resize((30, 30)))
60 | circle = PhotoImage(
61 | Image.open("../img/circle.png").resize((30, 30)))
62 |
63 | return rectangle, triangle, circle
64 |
65 | def reset_reward(self):
66 |
67 | for reward in self.rewards:
68 | self.canvas.delete(reward['figure'])
69 |
70 | self.rewards.clear()
71 | self.goal.clear()
72 | self.set_reward([0, 1], -1)
73 | self.set_reward([1, 2], -1)
74 | self.set_reward([2, 3], -1)
75 |
76 | # #goal
77 | self.set_reward([4, 4], 1)
78 |
79 | def set_reward(self, state, reward):
80 | state = [int(state[0]), int(state[1])]
81 | x = int(state[0])
82 | y = int(state[1])
83 | temp = {}
84 | if reward > 0:
85 | temp['reward'] = reward
86 | temp['figure'] = self.canvas.create_image((UNIT * x) + UNIT / 2,
87 | (UNIT * y) + UNIT / 2,
88 | image=self.shapes[2])
89 |
90 | self.goal.append(temp['figure'])
91 |
92 |
93 | elif reward < 0:
94 | temp['direction'] = -1
95 | temp['reward'] = reward
96 | temp['figure'] = self.canvas.create_image((UNIT * x) + UNIT / 2,
97 | (UNIT * y) + UNIT / 2,
98 | image=self.shapes[1])
99 |
100 | temp['coords'] = self.canvas.coords(temp['figure'])
101 | temp['state'] = state
102 | self.rewards.append(temp)
103 |
104 | # new methods
105 |
106 | def check_if_reward(self, state):
107 | check_list = dict()
108 | check_list['if_goal'] = False
109 | rewards = 0
110 |
111 | for reward in self.rewards:
112 | if reward['state'] == state:
113 | rewards += reward['reward']
114 | if reward['reward'] == 1:
115 | check_list['if_goal'] = True
116 |
117 | check_list['rewards'] = rewards
118 |
119 | return check_list
120 |
121 | def coords_to_state(self, coords):
122 | x = int((coords[0] - UNIT / 2) / UNIT)
123 | y = int((coords[1] - UNIT / 2) / UNIT)
124 | return [x, y]
125 |
126 | def reset(self):
127 | self.update()
128 | time.sleep(0.5)
129 | x, y = self.canvas.coords(self.rectangle)
130 | self.canvas.move(self.rectangle, UNIT / 2 - x, UNIT / 2 - y)
131 | self.reset_reward()
132 | return self.get_state()
133 |
134 | def step(self, action):
135 | self.counter += 1
136 | self.render()
137 |
138 | if self.counter % 2 == 1:
139 | self.rewards = self.move_rewards()
140 |
141 | next_coords = self.move(self.rectangle, action)
142 | check = self.check_if_reward(self.coords_to_state(next_coords))
143 | done = check['if_goal']
144 | reward = check['rewards']
145 |
146 | self.canvas.tag_raise(self.rectangle)
147 |
148 | s_ = self.get_state()
149 |
150 | return s_, reward, done
151 |
152 | def get_state(self):
153 |
154 | location = self.coords_to_state(self.canvas.coords(self.rectangle))
155 | agent_x = location[0]
156 | agent_y = location[1]
157 |
158 | states = list()
159 |
160 | for reward in self.rewards:
161 | reward_location = reward['state']
162 | states.append(reward_location[0] - agent_x)
163 | states.append(reward_location[1] - agent_y)
164 | if reward['reward'] < 0:
165 | states.append(-1)
166 | states.append(reward['direction'])
167 | else:
168 | states.append(1)
169 |
170 | return states
171 |
172 | def move_rewards(self):
173 | new_rewards = []
174 | for temp in self.rewards:
175 | if temp['reward'] == 1:
176 | new_rewards.append(temp)
177 | continue
178 | temp['coords'] = self.move_const(temp)
179 | temp['state'] = self.coords_to_state(temp['coords'])
180 | new_rewards.append(temp)
181 | return new_rewards
182 |
183 | def move_const(self, target):
184 |
185 | s = self.canvas.coords(target['figure'])
186 |
187 | base_action = np.array([0, 0])
188 |
189 | if s[0] == (WIDTH - 1) * UNIT + UNIT / 2:
190 | target['direction'] = 1
191 | elif s[0] == UNIT / 2:
192 | target['direction'] = -1
193 |
194 | if target['direction'] == -1:
195 | base_action[0] += UNIT
196 | elif target['direction'] == 1:
197 | base_action[0] -= UNIT
198 |
199 | if (target['figure'] is not self.rectangle
200 | and s == [(WIDTH - 1) * UNIT, (HEIGHT - 1) * UNIT]):
201 | base_action = np.array([0, 0])
202 |
203 | self.canvas.move(target['figure'], base_action[0], base_action[1])
204 |
205 | s_ = self.canvas.coords(target['figure'])
206 |
207 | return s_
208 |
209 | def move(self, target, action):
210 | s = self.canvas.coords(target)
211 |
212 | base_action = np.array([0, 0])
213 |
214 | if action == 0: # 상
215 | if s[1] > UNIT:
216 | base_action[1] -= UNIT
217 | elif action == 1: # 하
218 | if s[1] < (HEIGHT - 1) * UNIT:
219 | base_action[1] += UNIT
220 | elif action == 2: # 우
221 | if s[0] < (WIDTH - 1) * UNIT:
222 | base_action[0] += UNIT
223 | elif action == 3: # 좌
224 | if s[0] > UNIT:
225 | base_action[0] -= UNIT
226 |
227 | self.canvas.move(target, base_action[0], base_action[1])
228 |
229 | s_ = self.canvas.coords(target)
230 |
231 | return s_
232 |
233 | def render(self):
234 | # 게임 속도 조정
235 | time.sleep(0.05)
236 | self.update()
237 |
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/save_graph/deep_sarsa_.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/deep-sarsa/save_graph/deep_sarsa_.png
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/save_graph/deep_sarsa_trained.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/deep-sarsa/save_graph/deep_sarsa_trained.png
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/save_model/deep_sarsa.h5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/deep-sarsa/save_model/deep_sarsa.h5
--------------------------------------------------------------------------------
/snu_lecture/code/deep-sarsa/save_model/deep_sarsa_trained.h5:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/deep-sarsa/save_model/deep_sarsa_trained.h5
--------------------------------------------------------------------------------
/snu_lecture/code/img/circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/circle.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/down.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/left.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/rectangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/rectangle.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/right.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/triangle.png
--------------------------------------------------------------------------------
/snu_lecture/code/img/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/img/up.png
--------------------------------------------------------------------------------
/snu_lecture/code/keras_example/sequential_model.py:
--------------------------------------------------------------------------------
1 | from keras.layers import Dense
2 | from keras.models import Sequential
3 | from keras.optimizers import Adam
4 | import numpy as np
5 |
6 | state_size = 15
7 | action_size = 5
8 | batch_size = 100
9 |
10 | x_train = np.random.rand(batch_size, state_size)
11 | y_train = np.random.rand(batch_size, action_size)
12 |
13 | model = Sequential()
14 | model.add(Dense(30, input_dim=state_size, activation='relu'))
15 | model.add(Dense(30, activation='relu'))
16 | model.add(Dense(action_size, activation='linear'))
17 | model.compile(loss='mse', optimizer=Adam(lr=0.001))
18 | model.summary()
19 |
20 | model.fit(x_train, y_train, batch_size=32, epochs=1)
21 |
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/.python-version:
--------------------------------------------------------------------------------
1 | 3.5.0
2 |
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/__pycache__/environment.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/q-learning/__pycache__/environment.cpython-35.pyc
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/__pycache__/environment.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/code/q-learning/__pycache__/environment.cpython-36.pyc
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/environment.py:
--------------------------------------------------------------------------------
1 | import time
2 | import numpy as np
3 | import tkinter as tk
4 | from PIL import ImageTk, Image
5 |
6 | np.random.seed(1)
7 | PhotoImage = ImageTk.PhotoImage
8 | UNIT = 100 # 픽셀 수
9 | HEIGHT = 5 # 그리드월드 세로
10 | WIDTH = 5 # 그리드월드 가로
11 |
12 |
13 | class Env(tk.Tk):
14 | def __init__(self):
15 | super(Env, self).__init__()
16 | self.action_space = ['u', 'd', 'l', 'r']
17 | self.n_actions = len(self.action_space)
18 | self.title('Q Learning')
19 | self.geometry('{0}x{1}'.format(HEIGHT * UNIT, HEIGHT * UNIT))
20 | self.shapes = self.load_images()
21 | self.canvas = self._build_canvas()
22 | self.texts = []
23 |
24 | def _build_canvas(self):
25 | canvas = tk.Canvas(self, bg='white',
26 | height=HEIGHT * UNIT,
27 | width=WIDTH * UNIT)
28 | # 그리드 생성
29 | for c in range(0, WIDTH * UNIT, UNIT): # 0~400 by 80
30 | x0, y0, x1, y1 = c, 0, c, HEIGHT * UNIT
31 | canvas.create_line(x0, y0, x1, y1)
32 | for r in range(0, HEIGHT * UNIT, UNIT): # 0~400 by 80
33 | x0, y0, x1, y1 = 0, r, HEIGHT * UNIT, r
34 | canvas.create_line(x0, y0, x1, y1)
35 |
36 | # 캔버스에 이미지 추가
37 | self.rectangle = canvas.create_image(50, 50, image=self.shapes[0])
38 | self.triangle1 = canvas.create_image(250, 150, image=self.shapes[1])
39 | self.triangle2 = canvas.create_image(150, 250, image=self.shapes[1])
40 | self.circle = canvas.create_image(250, 250, image=self.shapes[2])
41 |
42 | canvas.pack()
43 |
44 | return canvas
45 |
46 | def load_images(self):
47 | rectangle = PhotoImage(
48 | Image.open("../img/rectangle.png").resize((65, 65)))
49 | triangle = PhotoImage(
50 | Image.open("../img/triangle.png").resize((65, 65)))
51 | circle = PhotoImage(
52 | Image.open("../img/circle.png").resize((65, 65)))
53 |
54 | return rectangle, triangle, circle
55 |
56 | def text_value(self, row, col, contents, action, font='Helvetica', size=10,
57 | style='normal', anchor="nw"):
58 |
59 | if action == 0:
60 | origin_x, origin_y = 7, 42
61 | elif action == 1:
62 | origin_x, origin_y = 85, 42
63 | elif action == 2:
64 | origin_x, origin_y = 42, 5
65 | else:
66 | origin_x, origin_y = 42, 77
67 |
68 | x, y = origin_y + (UNIT * col), origin_x + (UNIT * row)
69 | font = (font, str(size), style)
70 | text = self.canvas.create_text(x, y, fill="black", text=contents,
71 | font=font, anchor=anchor)
72 | return self.texts.append(text)
73 |
74 | def print_value_all(self, q_table):
75 | for i in self.texts:
76 | self.canvas.delete(i)
77 | self.texts.clear()
78 | for i in range(HEIGHT):
79 | for j in range(WIDTH):
80 | for action in range(0, 4):
81 | state = [i, j]
82 | if str(state) in q_table.keys():
83 | temp = q_table[str(state)][action]
84 | self.text_value(j, i, round(temp, 2), action)
85 |
86 | def coords_to_state(self, coords):
87 | x = int((coords[0] - 50) / 100)
88 | y = int((coords[1] - 50) / 100)
89 | return [x, y]
90 |
91 | def state_to_coords(self, state):
92 | x = int(state[0] * 100 + 50)
93 | y = int(state[1] * 100 + 50)
94 | return [x, y]
95 |
96 | def reset(self):
97 | self.update()
98 | time.sleep(0.5)
99 | x, y = self.canvas.coords(self.rectangle)
100 | self.canvas.move(self.rectangle, UNIT / 2 - x, UNIT / 2 - y)
101 | self.render()
102 | return self.coords_to_state(self.canvas.coords(self.rectangle))
103 |
104 | def step(self, action):
105 | state = self.canvas.coords(self.rectangle)
106 | base_action = np.array([0, 0])
107 | self.render()
108 |
109 | if action == 0: # 상
110 | if state[1] > UNIT:
111 | base_action[1] -= UNIT
112 | elif action == 1: # 하
113 | if state[1] < (HEIGHT - 1) * UNIT:
114 | base_action[1] += UNIT
115 | elif action == 2: # 좌
116 | if state[0] > UNIT:
117 | base_action[0] -= UNIT
118 | elif action == 3: # 우
119 | if state[0] < (WIDTH - 1) * UNIT:
120 | base_action[0] += UNIT
121 |
122 | # 에이전트 이동
123 | self.canvas.move(self.rectangle, base_action[0], base_action[1])
124 | # 에이전트(빨간 네모)를 가장 상위로 배치
125 | self.canvas.tag_raise(self.rectangle)
126 | next_state = self.canvas.coords(self.rectangle)
127 |
128 | # 보상 함수
129 | if next_state == self.canvas.coords(self.circle):
130 | reward = 100
131 | done = True
132 | elif next_state in [self.canvas.coords(self.triangle1),
133 | self.canvas.coords(self.triangle2)]:
134 | reward = -100
135 | done = True
136 | else:
137 | reward = 0
138 | done = False
139 |
140 | next_state = self.coords_to_state(next_state)
141 | return next_state, reward, done
142 |
143 | def render(self):
144 | time.sleep(0.03)
145 | self.update()
146 |
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/q_learning_agent.py:
--------------------------------------------------------------------------------
1 | from collections import defaultdict
2 | from environment import Env
3 | import random
4 |
5 |
6 | class QLearningAgent:
7 | def __init__(self, actions):
8 | # 행동 = [0, 1, 2, 3] 순서대로 상, 하, 좌, 우
9 | self.actions = actions
10 | self.learning_rate = 0.1
11 | self.discount_factor = 0.9
12 | self.epsilon = 0.1
13 | self.q_table = defaultdict(lambda: [0.0, 0.0, 0.0, 0.0])
14 |
15 | # 샘플로부터 큐함수 업데이트
16 | def learn(self, state, action, reward, next_state):
17 | q_1 = self.q_table[state][action]
18 | # 벨만 최적 방정식을 사용한 큐함수의 업데이트
19 | q_2 = reward + self.discount_factor * max(self.q_table[next_state])
20 | self.q_table[state][action] += self.learning_rate * (q_2 - q_1)
21 |
22 | # 큐함수에 의거하여 입실론 탐욕 정책에 따라서 행동을 반환
23 | def get_action(self, state):
24 | if random.random() <= self.epsilon:
25 | # 무작위 행동 반환
26 | action = random.choice(self.actions)
27 | else:
28 | # 큐함수에 따른 행동 반환
29 | state_action = self.q_table[state]
30 | action = self.arg_max(state_action)
31 | return action
32 |
33 | @staticmethod
34 | def arg_max(state_action):
35 | max_index_list = []
36 | max_value = state_action[0]
37 | for index, value in enumerate(state_action):
38 | if value > max_value:
39 | max_index_list.clear()
40 | max_value = value
41 | max_index_list.append(index)
42 | elif value == max_value:
43 | max_index_list.append(index)
44 | return random.choice(max_index_list)
45 |
46 | if __name__ == "__main__":
47 | env = Env()
48 | agent = QLearningAgent(actions=list(range(env.n_actions)))
49 |
50 | for episode in range(1000):
51 | state = env.reset()
52 |
53 | while True:
54 | env.render()
55 |
56 | # 현재 상태에 대한 행동 선택
57 | action = agent.get_action(str(state))
58 | # 행동을 취한 후 다음 상태, 보상 에피소드의 종료여부를 받아옴
59 | next_state, reward, done = env.step(action)
60 |
61 | # 로 큐함수를 업데이트
62 | agent.learn(str(state), action, reward, str(next_state))
63 | state = next_state
64 | # 모든 큐함수를 화면에 표시
65 | env.print_value_all(agent.q_table)
66 |
67 | if done:
68 | break
69 |
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/q_learning_exercise1.py:
--------------------------------------------------------------------------------
1 | from environment import Env
2 | import random
3 |
4 | if __name__ == "__main__":
5 | env = Env()
6 |
7 | for episode in range(10):
8 | print('episode ' + str(episode) + ' ----------------')
9 | env.reset()
10 |
11 | while True:
12 | env.render()
13 | # 랜덤하게 행동을 선택 (상, 하, 좌, 우)
14 | action = random.choice([0, 1, 2, 3])
15 | # 한 스텝 환경에서 진행
16 | state, reward, done = env.step(action)
17 | print('state: ', state, ' action: ', action, ' reward: ', reward)
18 |
19 | if done:
20 | break
21 |
--------------------------------------------------------------------------------
/snu_lecture/code/q-learning/q_learning_exercise2.py:
--------------------------------------------------------------------------------
1 | from collections import defaultdict
2 | from environment import Env
3 | import random
4 |
5 |
6 | class QLearningAgent:
7 | def __init__(self, actions):
8 | # 행동 = [0, 1, 2, 3] 순서대로 상, 하, 좌, 우
9 | pass
10 |
11 | # 샘플로부터 큐함수 업데이트
12 | def learn(self, state, action, reward, next_state):
13 | pass
14 |
15 | # 큐함수에 의거하여 입실론 탐욕 정책에 따라서 행동을 반환
16 | def get_action(self, state):
17 | pass
18 |
19 | @staticmethod
20 | def arg_max(state_action):
21 | max_index_list = []
22 | max_value = state_action[0]
23 | for index, value in enumerate(state_action):
24 | if value > max_value:
25 | max_index_list.clear()
26 | max_value = value
27 | max_index_list.append(index)
28 | elif value == max_value:
29 | max_index_list.append(index)
30 | return random.choice(max_index_list)
31 |
32 | if __name__ == "__main__":
33 | env = Env()
34 | agent = QLearningAgent(actions=list(range(env.n_actions)))
35 |
36 | for episode in range(1000):
37 | state = env.reset()
38 |
39 | while True:
40 | env.render()
41 |
42 | # 현재 상태에 대한 행동 선택
43 |
44 | # 행동을 취한 후 다음 상태, 보상 에피소드의 종료여부를 받아옴
45 |
46 | # 로 큐함수를 업데이트
47 |
48 | # 모든 큐함수를 화면에 표시
49 | env.print_value_all(agent.q_table)
50 |
51 | if done:
52 | break
53 |
--------------------------------------------------------------------------------
/snu_lecture/install_guide/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/.DS_Store
--------------------------------------------------------------------------------
/snu_lecture/install_guide/README.md:
--------------------------------------------------------------------------------
1 | # Installation guide
2 |
3 | 강화학습 튜토리얼의 환경 설치 설명을 위한 레포지토리 입니다.
4 |
5 | 다음 세가지의 설치 환경을 설명합니다.
6 |
7 | 해당 링크를 누르면 환경 설치에 대한 상세 가이드를 보실 수 있습니다.
8 |
9 | - **윈도우 [[link]](./윈도우10_설치가이드.md)**
10 |
11 | - **리눅스(우분투) [[link]](./우분투_설치가이드.md)**
12 |
13 | - **맥(osx) [[link]](./맥_설치가이드.md)**
14 |
15 |
16 |
17 | ### IDE(interface Development environment)
18 |
19 | 공통적으로 파이참(pycharm)[[link]](https://www.jetbrains.com/pycharm/)을 IDE로 사용하고 있습니다.
20 |
21 |
22 |
23 | ### 파이썬 패키지 관리자(package manager)
24 |
25 | - 윈도우, 리눅스(우분투)와 맥(osx) 모두 pip를 사용합니다.
26 |
27 | 파이썬을 설치하면 내장으로 설치되어 있습니다.
28 |
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/how-to-windows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/how-to-windows.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/link-env-with-pychar-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/link-env-with-pychar-1.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/link-env-with-pychar-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/link-env-with-pychar-2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/link-env-with-pychar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/link-env-with-pychar.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/numpy_install.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/numpy_install.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/numpy_install2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/numpy_install2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/numpy_install3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/numpy_install3.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/python3png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/python3png.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/python_install.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/python_install.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_atari.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_atari.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_atari.py3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_atari.py3.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_breakout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_breakout.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_breakout2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_breakout2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_git.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_git.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_git2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_git2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_gym.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_gym.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_make.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_make.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_make2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_make2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_msys2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_msys2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_msys2_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_msys2_2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_msys2_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_msys2_3.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_msys2_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_msys2_4.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_msys2_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_msys2_5.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_openai_gym.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_openai_gym.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_openai_gym2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_openai_gym2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_openai_gym3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_openai_gym3.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_openai_gym4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_openai_gym4.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_openai_gym5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_openai_gym5.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_pycharm_install1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_pycharm_install1.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_pycharm_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_pycharm_project.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_pycharm_project2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_pycharm_project2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_pycharm_setting2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_pycharm_setting2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_pycharm_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_pycharm_settings.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setting.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setting2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setting2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setting3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setting3.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setting4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setting4.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setup.py.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setup.py.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_setup.py2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_setup.py2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/img/win_xming.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/img/win_xming.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/.DS_Store
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/atari_breakout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/atari_breakout.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/cartpole_exam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/cartpole_exam.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/console_hello_world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/console_hello_world.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/deep_sarsa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/deep_sarsa.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/deep_sarsa_run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/deep_sarsa_run.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/deep_sarsa_run2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/deep_sarsa_run2.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/default_config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/default_config.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/file_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/file_setting.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/hello_world_ubuntu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/hello_world_ubuntu.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/install_keras.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/install_keras.PNG
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/install_matplotlib.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/install_matplotlib.PNG
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/install_numpy.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/install_numpy.PNG
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/install_pillow.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/install_pillow.PNG
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/install_tensorflow.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/install_tensorflow.PNG
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/openai_github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/openai_github.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/project_interpreter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/project_interpreter.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/pycham_new_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/pycham_new_project.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/pycharm_community.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/pycharm_community.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/pycharm_drag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/pycharm_drag.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/pycharm_init.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/pycharm_init.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/python3_terminal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/python3_terminal.jpg
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/python_download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/python_download.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/python_installed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/python_installed.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/python_intalled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/python_intalled.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/q_learning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/q_learning.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/q_learning_run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/q_learning_run.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rl_book_hello_world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rl_book_hello_world.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rl_book_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rl_book_project.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rl_book_venv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rl_book_venv.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rl_book_virtualenv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rl_book_virtualenv.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rlcode_book_directory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rlcode_book_directory.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/rlcode_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/rlcode_project.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/run_hello_world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/run_hello_world.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/sh_pycharm.sh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/sh_pycharm.sh.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/install_image/terminal_rlcode_book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rlcode/rlcode-tutorial/046302625aad1fc83fd5e530bc9d79454de9162e/snu_lecture/install_guide/install_image/terminal_rlcode_book.png
--------------------------------------------------------------------------------
/snu_lecture/install_guide/맥_설치가이드.md:
--------------------------------------------------------------------------------
1 | ## 개발 환경 설정 : 맥 OS
2 |
3 | 맥 OS에는 기본적으로 파이썬 2.7버전이 설치되어있기 때문에 3.5 버전을 새로 설치를 해야 합니다.
4 |
5 | ### 1. 파이썬 3.5 설치 및 환경 설정
6 |
7 | 파이썬 다운로드 페이지[[Link]](https://www.python.org/downloads/release/python-350/)로 접속하면 다음과 같은 화면이 나옵니다.
8 |
9 |
185 |
186 |
187 |
188 |
189 | ## 큐러닝(Q-Learning) 실행
190 |
191 | 그리드월드 예제로 큐러닝을 실행합니다.
192 |
193 | 파이참에서 오른쪽 클릭 후 Run을 클릭해서 실행합니다.
194 |
195 |
114 |
115 |
116 |
117 |
118 |
119 | - **Numpy** : 파이썬
120 |
121 | Numpy도 pillow와 같이 명령어 프롬프트창(cmd)에서 다음 명령어로 설치합니다.
122 |
123 | ```shell
124 | $ pip install numpy
125 | ```
126 |
127 |
128 |
129 |
130 |
131 |
132 | ## 큐러닝(Q-Learning) 실행
133 |
134 | 그리드월드 예제로 큐러닝을 실행합니다.
135 |
136 | 파이참에서 오른쪽 클릭 후 Run을 클릭해서 실행합니다.
137 |
138 |
153 |
154 |
155 |
156 |
157 |
158 | - **Numpy** : 파이썬
159 |
160 | Numpy도 pillow와 같이 명령어 프롬프트창(cmd)에서 다음 명령어로 설치합니다.
161 |
162 | ```shell
163 | $ pip install numpy
164 | ```
165 |
166 |
167 |
168 |
169 |
170 |
171 | ## Tensorflow, Keras, Matplotlib, h5py 설치
172 |
173 | 딥살사(deep-SARSA)를 실행하기 위해 다음 라이브러리들을 설치해야합니다.
174 |
175 | Numpy, Pillow와 설치 방법은 같습니다.
176 |
177 | 명령어 프롬프트창(cmd)에서 다음 명령어를 실행하여 설치합니다.
178 |
179 | - **tensorflow** : 딥러닝 오픈소스 프레임워크
180 |
181 | ```shell
182 | $ pip install tensorflow
183 | ```
184 |
185 |
100 |
101 |
102 |
103 |
104 |
105 | - **Numpy** : 파이썬
106 |
107 | Numpy도 pillow와 같이 명령어 프롬프트창(cmd)에서 다음 명령어로 설치합니다.
108 |
109 | ```shell
110 | $ pip install numpy
111 | ```
112 |
113 |
114 |
115 |
116 |
117 |
118 | ### 6. Tensorflow, Keras, Matplotlib, h5py 설치
119 |
120 | 딥살사(deep-SARSA)를 실행하기 위해 다음 라이브러리들을 설치해야합니다.
121 |
122 | Numpy, Pillow와 설치 방법은 같습니다.
123 |
124 | 명령어 프롬프트창(cmd)에서 다음 명령어를 실행하여 설치합니다.
125 |
126 | - **tensorflow** : 딥러닝 오픈소스 프레임워크
127 |
128 | ```shell
129 | $ pip install tensorflow
130 | ```
131 |
132 |