3. •컴퓨터공학 학사 (2006 - 2014)
•SW developer at Smilegate (2013.11 - 2014.5)
•SW developer at Ericsson (2014.10 - 2017.01)
•Research Engineer at Medipixel (2018.11 - 2019.08)
•Research Engineer at J.Marple (2019.09 - )
3
걸어온 길
4. 최근 활동
•연구주제
- 모델 기반 동적 제어 시스템
- 강화학습을 이용한 심혈관 시술용 가이드와이어 제어
•기타활동
- PG is all you need with 김경환, 김민철
- Rainbow is all you need with 김경환
- RL algorithms with 김경환, 김민철
- 모두를 위한 컨벡스 최적화 @풀잎스쿨, 모두의 연구소
4
5. 이 발표는?
•범위
- Policy Gradient에서 A2C에 이르는 이론적 배경
- 실습을 통한 A2C 구현의 이해 (Pytorch)
•목표
- Pendulum 환경에서의 에이전트 제어
5
12. •Partially observable state만을 획득할 수 있다면?
- e.g. 포커게임
•Infinite action space를 다뤄야한다면?
- e.g. 로봇팔 제어
12
상상해봅시다
https://kr.pokernews.com/news/2013/09/hand-motions-to-catch-bluffs-kr-5709.htm
https://etinow.me/143
13. 13
Short corridor with switched actions
Sutton, R. and Barto, A. (2018). Reinforcement Learning: An Introduction. 2nd ed. MIT Press
• 입력되는 모든 state가 동일
• 가운데 state에서는 action의 효과가 뒤바뀜
ϵ = 0.1
• 최적의 policy는 좌 : 우를 0.41 : 0.59 비율로 선택하는 것
19. 19
Policy Gradient
•Finite Horizon Case
∇θJ(θ) = Eτ∼πθ(τ)[(
T
∑
t=1
∇θlog π(at |st))(
T
∑
t=1
r(st, at))]
≈
1
N
N
∑
i
(
T
∑
t=1
∇θlog π(at |st))(
T
∑
t=1
r(st, at))
N samples
20. 20
Policy Gradient
•Markov Property
∇θJ(θ) ≈
1
N
N
∑
i
(
T
∑
t=1
∇θlog π(at |st))(
T
∑
t=1
r(st, at))
t < t’ 일때, t’에서의 policy가 t 시점에 영향을 끼치지 않는다고 가정
=
1
N
N
∑
i
(
T
∑
t=1
∇θlog π(at |st))(
T
∑
t=t′

r(st′

, at′

))
=
1
N
N
∑
i
T
∑
t=1
∇θlog π(at |st) ⋅ Gt
21. 21
Policy Gradient
•Policy Gradient
∇θJ(θ) ≈
1
N
N
∑
i
T
∑
t=1
∇θlog π(at |st) ⋅ Gt
t < t’ 일때, t’에서의 policy가 t 시점에 영향을 끼치지 않는다고 가정
θ ← θ + α∇θJ(θ)
Gradient Ascent!
직관적 해석:
Return이 곱해진 Maximum log likelihood의 형태
- Action probability가 높을수록 업데이트에 덜 반영
- Return이 높을수록 업데이트에 더 반영
23. 23
Policy Gradient
•Reinforce: High-variance issue
CS294-112 at UC Berkeley (2018). Lecture5: Policy Gradient Introduction
Sample trajectory에 대한 과적합으로 학습을 원활하게 하기 어려움
Variance-Bias trade-o
f
가 필요
24. 24
Policy Gradient
•Reinforce: High-variance issue
CS294-112 at UC Berkeley (2018). Lecture5: Policy Gradient Introduction
Sample trajectory에 대한 과적합으로 학습을 원활하게 하기 어려움
Variance-Bias trade-o
f
가 필요
적절한 Baseline 함수를 이용!
25. 25
Policy Gradient
•Reinforce with Baseline
J(θ) ≈
1
N
N
∑
i
T
∑
t=1
log π(at |st; θ) ⋅ Gt
→
1
N
N
∑
i
T
∑
t=1
log π(at |st; θ) ⋅ (Gt − v(s; w))
theta에 대한 미분과 함께 소거가능
27. 27
Policy Gradient
•Short corridor with switched actions
Sutton, R. and Barto, A. (2018). Reinforcement Learning: An Introduction. 2nd ed. MIT Press
28. 28
Policy Gradient
•Reinforce with Baseline
Sutton, R. and Barto, A. (2018). Reinforcement Learning: An Introduction. 2nd ed. MIT Press
Return 대신 Q(s,a)를 사용한다면?