SlideShare a Scribd company logo
1 of 50
DDPG
RL Seoul Study 2019
190406
Subin Yang
Contents
1. 아이디어의 배경
2. 이론적 배경
3. 알고리즘
4. Pseudocode
5. 결과
Talk About
Problem & Solution
Intro
0. Intro
DDPG
Actor-Critic Method
Deterministic Policy
0. Intro
DDPG
Actor-Critic Method
DQN
Value function approximation>
Continuous action space를 가진 문제에서
DDPG가 좋다!
Q function을 구한 후 최적의 policy를 찾는 것 보다
Policy gradient를 통해 policy를 바로 학습할 수 있어 더 좋다.
0. Intro
DDPG
Deterministic Policy
DPG
Stochastic Policy>
Policy gradient를 수행할 때 action에 대한
integral 을 수행하지 않을 수 있다.
-> Computational efficiency
Idea
1. 아이디어의 배경
Problem: DQN cannot solve continuous control tasks
DQN(Deep Q Network)는 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다.
[이후 Actor-Critic 알고리즘에서 다시 설명]
차원의 저주가 발생한다.
example)
자유도의 수에 따라서 action의 수가 exponentially(지수적으로) 증가한다. 각각의 관절에 대해서 a가 –k, 0, k로 coarsest discretization된
7 자유도 시스템은 action space의 차원이 3의 7제곱이 된다.
Solution: DDPG 알고리즘
Model-free, high dimensional 에서도 polices를 학습할 수 있는 off-policy actor-critic 알고리즘을 선보인다.
1. 아이디어의 배경
Problem: DQN cannot solve continuous control tasks
DQN(Deep Q Network)는 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다.
[이후 Actor-Critic 알고리즘에서 다시 설명]
차원의 저주가 발생한다.
example)
자유도의 수에 따라서 action의 수가 exponentially(지수적으로) 증가한다. 각각의 관절에 대해서 a가 –k, 0, k로 coarsest discretization된
7 자유도 시스템은 action space의 차원이 3의 7제곱이 된다.
Solution: DDPG 알고리즘
Model-free, high dimensional 에서도 polices를 학습할 수 있는 off-policy actor-critic 알고리즘을 선보인다.
Background
2. 이론적 배경
Action-value function describes the expected return after taking action a in state s and thereafter following
policy
Recursive relationship know as the Bellman equation
2. 이론적 배경
Deterministic target policy로 대체하기
Q-Learning (a commonly used off-policy algorithm)
Consider function approximators parameterized by theta, which is optimize by minimizing loss
중간 Reference
자료: DPG
Reference: DPG
Model-free RL 알고리즘들의 다수는 generalized policy iteration에 기초한다. (policy evaluation + policy
improvement)
Policy Iteration
•Policy Evaluation
Monte Carlo evaluation 혹은 Temporal Different Learning 방법으로 action-value function을 esti
mate 하는 것 입니다.
• MC
• TD
•Policy Improvement
action-value function에 대해서 policy를 업데이트 합니다. 일반적인 방법은, action-value functio
n을 maximize하는 greedy 방법입니다.
• e-greedy
• policy gradient
Reference: SPG
Stochastic Policy Gradient (SPG)
Critic TD Learning 과 같은 policy evaluation 알고리즘을 사용하여, action-value function을 estimate 합니
다.
Actor adjusts the parameters theta of the stochastic policy pi by stochastic gradient ascent of equation(
2)
Reference: Off-PAC
Off-Policy Actor-Critic (Off-PAC)
Critic gradient TD Learning 방법을 가지고, trajectories에 대한 off-policy로 state-value function에 대해서 est
imate 합니다.
Actor off-policy로 stochastic gradient를 ascent하는 방향으로 policy parameter theta를 업데이트 합니
다. equation (5)
Reference: DPG
Policy gradient 알고리즘은 continuous actions spaces를 가진 RL 문제에서 널리 사용됩니다.
기본적인 아이디어는 다음과 같습니다.
Policy pi를 확률 분포로 나타낼 수 있습니다. 이 확률 분포는 파라미터 벡터 theta에 대해서 stochastic하게
action을 선택하는 분포입니다
Poilcy gradient 알고리즘은 이러한 stochastic policy를 샘플링하고, reward를 더 좋게 하는 방향으로 policy
parameter를 조절하는 것입니다.
Reference: DPG
특징
Stochastic Policy Gradient(SPG)의 단점이 있다면, action space가 many dimension을 가진 경우 SPG는
state와 action spaces를 모두 적분해야 하는데, DPG는 state space에 대해서만 적분해주면 됩니다.
Deterministic policy gradient는 Stochastic policy gradient에서 policy variance가 zero가 되는 limit case라고 볼
수 있습니다. (논문에서 증명)
Idea
- Learn Deterministic Policy (mu)
- Off-Policy Actor-Critic
- Choose action with Stochastic behavior policy (pi)
Reference: DPG
Off-Policy Deterministic Policy Gradient
Critic
true action-value function Qmu 대신에, differentiable action-value function Qw로 대체한다. 적절한
policy evaluation 방법을 이용하여, behavior policy beta에 의해 생성된 trajectories를 따르는 off-policy로써
action-value function Qw을 estimate 한다. (Q-Learning)
Actor adjust parameter theta with Off-Policy Deterministic Policy Gradient
Algorithms
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘 – Actor-Critic
Problem:
DQN은 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다.
Why?:
대부분 주목할만한 control task들은 continuous 하고 and high dimensional action spaces를 가지고 있다.
Continuous valued case는 매 스텝마다 iterative optimization process가 필요한데, DQN은 action을 찾는 방
법이 action-value function을 최대화 하는 방법에 의존하고 있어서 continuous domain에 바로 적용하기 어
렵다.
Solution:
Actor-Critic 접근법에 기초한 DPG(Deterministic Policy Gradient) 알고리즘을 이용한다.
3. 알고리즘 – Actor-Critic
Problem:
DQN은 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다.
Why?:
대부분 주목할만한 control task들은 continuous 하고 and high dimensional action spaces를 가지고 있다.
Continuous valued case는 매 스텝마다 iterative optimization process가 필요한데, DQN은 action을 찾는 방
법이 action-value function을 최대화 하는 방법에 의존하고 있어서 continuous domain에 바로 적용하기 어
렵다.
Solution:
Actor-Critic 접근법에 기초한 DPG(Deterministic Policy Gradient) 알고리즘을 이용한다.
3. 알고리즘 – Actor-Critic
DPG: Off-Policy Deterministic Policy Gradient
[Gradient of performance objective]
3. 알고리즘 – Actor-Critic
다른 말로 말하자면,
Action-value function을 approximation하는 q-learning과 같은 방법은 global optimum으로 간
다.
Policy gradient 방법은 local optimum으로 가기 때문에 optimal policy를 찾는데에 더 좋다.
이 논문에서 설명하는 뉘앙스는 value based learning을 하는데, q-learning은 결국 globally
hard-max Q value를 찾아야하고, 이를 위해서는 state-action space를 샅샅이 뒤져야한다는 단
점 이 있고,
OffPAC은 사진의 빨간 부분을 구하는 것을 gradient approximation (논문에서 인용한 Degris 논
문)을 통해서 안할 수 있기 때문에 local optimum 이 guarantee 되기에 장점이 있다는 것을 의미
한다.
Question. Global optimum of Q Learning vs Local optimum of Policy Gradient ?
https://github.com/mch5048
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘 – Actor-Critic
Problem:
Correlations between samples
대부분의 optimization 알고리즘들은 sample 들을 iid(independently and identically distributed)
라고 가정하지만,
환경에서 연속적으로 exploring 통해서 sample 들이 생성될 때 가정이 성립되지 않는다.
https://hunkim.github.io/ml/RL/rl07.pdf
3. 알고리즘 – Actor-Critic
Solution: Replay Buffer
Replay buffer is a finite sized cache.
Transitions는 exploration policy와 replay buffer에 저장된 tuple을 따라서 환경으로부터 sample
된다.
Replay buffer가 가득 차면, 오래된 sample들은 버려진다.
매 timestep 마다, actor와 critic은 buffer로부터 minibatch를 uniformly 하게 sampling 하면서 업
데이트 된다.
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘 – Actor-Critic
Problem: Non-stationary targets
Neural networks에 Q-Learning (eq.4) 을 바로 적용하는 것은 많은 환경 내에서 불안정하다는 것
이 증명되었다.
[ddpg.eq.4]
Target value (eq.5)를 계산 할 때 사용되는 network가 업데이트 되기 때문에, Q의 업데이트가 발
산하기 쉽습니다.
3. 알고리즘 – Actor-Critic
Solution: "Soft" target update
DQN에서 사용된 target network와 비슷하지만, weight를 직접 copy하는 대신에, actor-critic에 적용하기
위해서 "soft" target update로 변형하였다.
target network의 weight은 학습된 network를 천천히 따라가며 업데이트 된다.
이는 target values들이 천천히 변화되게 하고, 학습의 안정성을 더 좋게 만든다.
actor / critic networks 지수평균이동
식
Soft update가 DQN에서 사용했던 방식에 비해 어떤 장점이 있는지는 명확하게 설명되어있지 않지만,
stochastic gradient descent와 같이 급격하게 학습이 진행되는 것을 막기 위해 사용되는 것 같습니다. [PG
여행 인용]
https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘 – Actor-Critic
Problem: Different physical units of different components of the observation
example)
position versus velocities
network의 효과적인 학습을 어렵게 한다
다른 scale의 state value를 가진 환경들을 generalize 하는 hyperparameter들을 찾는데 어려움을
갖게 한다.
3. 알고리즘 – Actor-Critic
Solution: Batch Normalization
feature 들을 manually 하게 환경과 units에 대해서 비슷한 range로 scale 하는 것이다.
minibatch 안에 있는 sample들이 unit mean과 variance를 가지도록 하기 위해 normalize 한다.
[network에서 covariance shift 최소화]
https://blog.bigml.com/2014/01/03/simple-machine-learning-to-detect-covariate-shift/
3. 알고리즘
1. Actor-critic approach based on the DPG algorithm
2. Replay buffer
3. “Soft" target updates
4. Batch normalization
5. Add noise on policy to exploration
3. 알고리즘 – Actor-Critic
Problem: Exploration
Solution: Add noise sampled from a noise process N to our actor policy
DDPG와 같은 off-policy 알고리즘의 장점은, exploration의 문제를 학습 알고리즘으로부터 독립
적으로 다룰 수 있다는 것이다.
DDPG에서는 exploration을 위해서 output으로 나온 행동에 노이즈를 추가해준다.
3. 알고리즘 – Actor-Critic
Problem: Exploration
Solution: Add noise sampled from a noise process N to our actor policy
DDPG와 같은 off-policy 알고리즘의 장점은, exploration의 문제를 학습 알고리즘으로부터 독립
적으로 다룰 수 있다는 것이다.
DDPG에서는 exploration을 위해서 output으로 나온 행동에 노이즈를 추가해준다.
3. 알고리즘 – Actor-Critic
[PG여행 인용]
https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/
Pseudocode
4. Pseudocode
Initialize
1. Actor-Critic Network
2. Target Network
3. Replay Buffer
4. Pseudocode
Add noise to policy
Minibatch
4. Pseudocode
Update
1. Critic Network
2. Actor Network
4. Pseudocode
Soft Target Network
Set Target Network
Results
5. 결과
Example 학습
5. 결과
Target network + batch normalization (green)이 결과가 좋다.
Reference
질문 답변해주신 철희님 감사합니다!
DDPG
https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/
https://arxiv.org/pdf/1509.02971.pdf
https://youtu.be/_pbd6TCjmaw
http://pages.isir.upmc.fr/~sigaud/teach/ddpg.pdf
https://github.com/kairproject/schedule/issues/13
DPG
https://reinforcement-learning-kr.github.io/2018/06/27/2_dpg/
http://proceedings.mlr.press/v32/silver14.pdf
Off-PAC
https://arxiv.org/pdf/1205.4839.pdf
https://hunkim.github.io/ml/
Thank you

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

[강화학습 DDPG 리뷰] Deep Deterministic Policy Gradient

  • 1. DDPG RL Seoul Study 2019 190406 Subin Yang
  • 2. Contents 1. 아이디어의 배경 2. 이론적 배경 3. 알고리즘 4. Pseudocode 5. 결과
  • 6. 0. Intro DDPG Actor-Critic Method DQN Value function approximation> Continuous action space를 가진 문제에서 DDPG가 좋다! Q function을 구한 후 최적의 policy를 찾는 것 보다 Policy gradient를 통해 policy를 바로 학습할 수 있어 더 좋다.
  • 7. 0. Intro DDPG Deterministic Policy DPG Stochastic Policy> Policy gradient를 수행할 때 action에 대한 integral 을 수행하지 않을 수 있다. -> Computational efficiency
  • 9. 1. 아이디어의 배경 Problem: DQN cannot solve continuous control tasks DQN(Deep Q Network)는 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다. [이후 Actor-Critic 알고리즘에서 다시 설명] 차원의 저주가 발생한다. example) 자유도의 수에 따라서 action의 수가 exponentially(지수적으로) 증가한다. 각각의 관절에 대해서 a가 –k, 0, k로 coarsest discretization된 7 자유도 시스템은 action space의 차원이 3의 7제곱이 된다. Solution: DDPG 알고리즘 Model-free, high dimensional 에서도 polices를 학습할 수 있는 off-policy actor-critic 알고리즘을 선보인다.
  • 10. 1. 아이디어의 배경 Problem: DQN cannot solve continuous control tasks DQN(Deep Q Network)는 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다. [이후 Actor-Critic 알고리즘에서 다시 설명] 차원의 저주가 발생한다. example) 자유도의 수에 따라서 action의 수가 exponentially(지수적으로) 증가한다. 각각의 관절에 대해서 a가 –k, 0, k로 coarsest discretization된 7 자유도 시스템은 action space의 차원이 3의 7제곱이 된다. Solution: DDPG 알고리즘 Model-free, high dimensional 에서도 polices를 학습할 수 있는 off-policy actor-critic 알고리즘을 선보인다.
  • 12. 2. 이론적 배경 Action-value function describes the expected return after taking action a in state s and thereafter following policy Recursive relationship know as the Bellman equation
  • 13. 2. 이론적 배경 Deterministic target policy로 대체하기 Q-Learning (a commonly used off-policy algorithm) Consider function approximators parameterized by theta, which is optimize by minimizing loss
  • 15. Reference: DPG Model-free RL 알고리즘들의 다수는 generalized policy iteration에 기초한다. (policy evaluation + policy improvement) Policy Iteration •Policy Evaluation Monte Carlo evaluation 혹은 Temporal Different Learning 방법으로 action-value function을 esti mate 하는 것 입니다. • MC • TD •Policy Improvement action-value function에 대해서 policy를 업데이트 합니다. 일반적인 방법은, action-value functio n을 maximize하는 greedy 방법입니다. • e-greedy • policy gradient
  • 16. Reference: SPG Stochastic Policy Gradient (SPG) Critic TD Learning 과 같은 policy evaluation 알고리즘을 사용하여, action-value function을 estimate 합니 다. Actor adjusts the parameters theta of the stochastic policy pi by stochastic gradient ascent of equation( 2)
  • 17. Reference: Off-PAC Off-Policy Actor-Critic (Off-PAC) Critic gradient TD Learning 방법을 가지고, trajectories에 대한 off-policy로 state-value function에 대해서 est imate 합니다. Actor off-policy로 stochastic gradient를 ascent하는 방향으로 policy parameter theta를 업데이트 합니 다. equation (5)
  • 18. Reference: DPG Policy gradient 알고리즘은 continuous actions spaces를 가진 RL 문제에서 널리 사용됩니다. 기본적인 아이디어는 다음과 같습니다. Policy pi를 확률 분포로 나타낼 수 있습니다. 이 확률 분포는 파라미터 벡터 theta에 대해서 stochastic하게 action을 선택하는 분포입니다 Poilcy gradient 알고리즘은 이러한 stochastic policy를 샘플링하고, reward를 더 좋게 하는 방향으로 policy parameter를 조절하는 것입니다.
  • 19. Reference: DPG 특징 Stochastic Policy Gradient(SPG)의 단점이 있다면, action space가 many dimension을 가진 경우 SPG는 state와 action spaces를 모두 적분해야 하는데, DPG는 state space에 대해서만 적분해주면 됩니다. Deterministic policy gradient는 Stochastic policy gradient에서 policy variance가 zero가 되는 limit case라고 볼 수 있습니다. (논문에서 증명) Idea - Learn Deterministic Policy (mu) - Off-Policy Actor-Critic - Choose action with Stochastic behavior policy (pi)
  • 20. Reference: DPG Off-Policy Deterministic Policy Gradient Critic true action-value function Qmu 대신에, differentiable action-value function Qw로 대체한다. 적절한 policy evaluation 방법을 이용하여, behavior policy beta에 의해 생성된 trajectories를 따르는 off-policy로써 action-value function Qw을 estimate 한다. (Q-Learning) Actor adjust parameter theta with Off-Policy Deterministic Policy Gradient
  • 22. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 23. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 24. 3. 알고리즘 – Actor-Critic Problem: DQN은 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다. Why?: 대부분 주목할만한 control task들은 continuous 하고 and high dimensional action spaces를 가지고 있다. Continuous valued case는 매 스텝마다 iterative optimization process가 필요한데, DQN은 action을 찾는 방 법이 action-value function을 최대화 하는 방법에 의존하고 있어서 continuous domain에 바로 적용하기 어 렵다. Solution: Actor-Critic 접근법에 기초한 DPG(Deterministic Policy Gradient) 알고리즘을 이용한다.
  • 25. 3. 알고리즘 – Actor-Critic Problem: DQN은 low-dimensional action spaces에 대해서 다루는 문제들만 해결할 수 있다. Why?: 대부분 주목할만한 control task들은 continuous 하고 and high dimensional action spaces를 가지고 있다. Continuous valued case는 매 스텝마다 iterative optimization process가 필요한데, DQN은 action을 찾는 방 법이 action-value function을 최대화 하는 방법에 의존하고 있어서 continuous domain에 바로 적용하기 어 렵다. Solution: Actor-Critic 접근법에 기초한 DPG(Deterministic Policy Gradient) 알고리즘을 이용한다.
  • 26. 3. 알고리즘 – Actor-Critic DPG: Off-Policy Deterministic Policy Gradient [Gradient of performance objective]
  • 27. 3. 알고리즘 – Actor-Critic 다른 말로 말하자면, Action-value function을 approximation하는 q-learning과 같은 방법은 global optimum으로 간 다. Policy gradient 방법은 local optimum으로 가기 때문에 optimal policy를 찾는데에 더 좋다. 이 논문에서 설명하는 뉘앙스는 value based learning을 하는데, q-learning은 결국 globally hard-max Q value를 찾아야하고, 이를 위해서는 state-action space를 샅샅이 뒤져야한다는 단 점 이 있고, OffPAC은 사진의 빨간 부분을 구하는 것을 gradient approximation (논문에서 인용한 Degris 논 문)을 통해서 안할 수 있기 때문에 local optimum 이 guarantee 되기에 장점이 있다는 것을 의미 한다. Question. Global optimum of Q Learning vs Local optimum of Policy Gradient ? https://github.com/mch5048
  • 28. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 29. 3. 알고리즘 – Actor-Critic Problem: Correlations between samples 대부분의 optimization 알고리즘들은 sample 들을 iid(independently and identically distributed) 라고 가정하지만, 환경에서 연속적으로 exploring 통해서 sample 들이 생성될 때 가정이 성립되지 않는다. https://hunkim.github.io/ml/RL/rl07.pdf
  • 30. 3. 알고리즘 – Actor-Critic Solution: Replay Buffer Replay buffer is a finite sized cache. Transitions는 exploration policy와 replay buffer에 저장된 tuple을 따라서 환경으로부터 sample 된다. Replay buffer가 가득 차면, 오래된 sample들은 버려진다. 매 timestep 마다, actor와 critic은 buffer로부터 minibatch를 uniformly 하게 sampling 하면서 업 데이트 된다.
  • 31. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 32. 3. 알고리즘 – Actor-Critic Problem: Non-stationary targets Neural networks에 Q-Learning (eq.4) 을 바로 적용하는 것은 많은 환경 내에서 불안정하다는 것 이 증명되었다. [ddpg.eq.4] Target value (eq.5)를 계산 할 때 사용되는 network가 업데이트 되기 때문에, Q의 업데이트가 발 산하기 쉽습니다.
  • 33. 3. 알고리즘 – Actor-Critic Solution: "Soft" target update DQN에서 사용된 target network와 비슷하지만, weight를 직접 copy하는 대신에, actor-critic에 적용하기 위해서 "soft" target update로 변형하였다. target network의 weight은 학습된 network를 천천히 따라가며 업데이트 된다. 이는 target values들이 천천히 변화되게 하고, 학습의 안정성을 더 좋게 만든다. actor / critic networks 지수평균이동 식 Soft update가 DQN에서 사용했던 방식에 비해 어떤 장점이 있는지는 명확하게 설명되어있지 않지만, stochastic gradient descent와 같이 급격하게 학습이 진행되는 것을 막기 위해 사용되는 것 같습니다. [PG 여행 인용] https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/
  • 34. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 35. 3. 알고리즘 – Actor-Critic Problem: Different physical units of different components of the observation example) position versus velocities network의 효과적인 학습을 어렵게 한다 다른 scale의 state value를 가진 환경들을 generalize 하는 hyperparameter들을 찾는데 어려움을 갖게 한다.
  • 36. 3. 알고리즘 – Actor-Critic Solution: Batch Normalization feature 들을 manually 하게 환경과 units에 대해서 비슷한 range로 scale 하는 것이다. minibatch 안에 있는 sample들이 unit mean과 variance를 가지도록 하기 위해 normalize 한다. [network에서 covariance shift 최소화] https://blog.bigml.com/2014/01/03/simple-machine-learning-to-detect-covariate-shift/
  • 37. 3. 알고리즘 1. Actor-critic approach based on the DPG algorithm 2. Replay buffer 3. “Soft" target updates 4. Batch normalization 5. Add noise on policy to exploration
  • 38. 3. 알고리즘 – Actor-Critic Problem: Exploration Solution: Add noise sampled from a noise process N to our actor policy DDPG와 같은 off-policy 알고리즘의 장점은, exploration의 문제를 학습 알고리즘으로부터 독립 적으로 다룰 수 있다는 것이다. DDPG에서는 exploration을 위해서 output으로 나온 행동에 노이즈를 추가해준다.
  • 39. 3. 알고리즘 – Actor-Critic Problem: Exploration Solution: Add noise sampled from a noise process N to our actor policy DDPG와 같은 off-policy 알고리즘의 장점은, exploration의 문제를 학습 알고리즘으로부터 독립 적으로 다룰 수 있다는 것이다. DDPG에서는 exploration을 위해서 output으로 나온 행동에 노이즈를 추가해준다.
  • 40. 3. 알고리즘 – Actor-Critic [PG여행 인용] https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/
  • 42. 4. Pseudocode Initialize 1. Actor-Critic Network 2. Target Network 3. Replay Buffer
  • 43. 4. Pseudocode Add noise to policy Minibatch
  • 44. 4. Pseudocode Update 1. Critic Network 2. Actor Network
  • 45. 4. Pseudocode Soft Target Network Set Target Network
  • 48. 5. 결과 Target network + batch normalization (green)이 결과가 좋다.
  • 49. Reference 질문 답변해주신 철희님 감사합니다! DDPG https://reinforcement-learning-kr.github.io/2018/06/26/3_ddpg/ https://arxiv.org/pdf/1509.02971.pdf https://youtu.be/_pbd6TCjmaw http://pages.isir.upmc.fr/~sigaud/teach/ddpg.pdf https://github.com/kairproject/schedule/issues/13 DPG https://reinforcement-learning-kr.github.io/2018/06/27/2_dpg/ http://proceedings.mlr.press/v32/silver14.pdf Off-PAC https://arxiv.org/pdf/1205.4839.pdf https://hunkim.github.io/ml/