ROKO
[CS234] Reinforcement Learning: Lecture 5 본문
[CS234] Reinforcement Learning: Lecture 5
RO_KO 2024. 7. 29. 16:18
복습 겸 DQN에 관련한 문제를 풀어보자. 위 문제의 정답은 1번과 2번이다. 1번의 경우 Monte carlo sampling에 의해 수렴할 것이 보장된다. 2번의 경우 무한히 많은 tuple이 있으므로 population과 같다고 볼 수 있어 estimated dynamics model을 통한 policy evaluation은 같은 결과를 나타낼 것이다. 3번의 경우 experience replay는 temporal correlation을 줄이기 위한 방법이지 convergence를 보장하기 위한 방법이 아니다.
Policy Gradient
Policy gradient methods have been very influential
- Sequence Level Training with Recurrent Neural Networks built on REINFORCE
- End-to-End Training of Deep Visuomotor Policies

이전 강좌에서는 value or action value function을 approximate하였는데 이번에는 policy를 바로 생성하는 방법론에 대해 살펴볼 것이다.

System 자체가 markov가 아니기 때문에 deterministic policy는 올바른 해결책이 아니다. 오히려 uniform random policy인 Nash equilibrium이 optimal이다.
Policy based reinforcement learning은 최적화 문제를 푸는것과 같다. 왜냐하면 value 값
Gradient free optimization
- Hill climbing
- Simplex / amoeba / Nelder Mead
- Genetic algorithms
- Cross-entropy method (CEM)
- Covariance Matrix Adaptation (CMA)
Simple baseline으로 시도하기 좋고 병렬화하기 쉽다. Sample을 비효율적으로 활용하고 temporal structure를 반영하지 못한다.
Evolution strategies (ES) 참고자료
https://ropiens.tistory.com/137
Evolutionary strategy 1 - Simple Gaussian Evolution
최근 RL관련 논문이나 구루들의 토의 영상들을 보면 evolution strategy(혹은 evolution algorithm)이란 단어가 심심치 않게 등장한다. Evolution algorithm은 Black box optimization의 일종이다. Black box optimization은 우
ropiens.tistory.com
Gradient optimization
- Gradient descent
- Conjugate gradient
- Quasi-newton
Policy gradient


Score functions and Policy gradient
1. Differentiable policies
- Compute the policy gradient analytically
- Assume policy
is differentiable whenever it is non-zero - Assume can calculate gradient
analytically - Many choices of differentiable policy classes including:
- Softmax
- Gaussian
- Neural networks
Policy value:
Likelihood Ratio Policies


Decomposing the Trajectories into States and Actions

Score function
A score function is the derivative of the log of a parameterized probability / likelihood. Let
softmax policy

Gaussian policy


정답은 None of the above이다. (a)는 위 미분한 결과를 보면 알겠지만 reward나 dynamic model이 수식에 포함되지 않는다. (b)는 해당 알고리즘은 MDP뿐만아니라 length가 1보다 큰 episodic 환경에서도 적용가능하다. (c)는 단순한 반례로 값이 너무 커져 발산하는 경우가 생길 수 있기 때문에 항상 유용하지는 않다.
Policy Gradient Theorem

2. Temporal Structure
episode를 활용하는 학습의 단점은 unbiased하지만 noise가 많다는 것이다. practical하게 사용되기 위해서 temporal structure와 baseline을 적용해 이를 완화한다.


어떤 과정을 거친건지 간단히 말하면 시간을 고려한 수식으로 변환한 것이라고 보면 된다.
Monte-Carlo Policy Gradient (REINFORCE)

지금까지 알아본 방법을 통합해 만든 알고리즘이 REINFORCE이다. 하지만 여전히 노이즈가 많아 다른 방법을 추가하여 사용한다.
3. Baseline

* Baseline b(s) does not introduce bias-derivation

Baseline은 일종의 정규화 역할을 해주어 학습의 안정성을 높여준다. 위의 증명에서 보이든 baseline 추가 term이 gradient를 구하는 과정에 영향을 주지 않는것을 보여준다.
Baseline으로 사용하기 위한 적절한 함수는 어떤것이 있을까?

4. Alternatives to MC returns


MC return값이 아닌 다른 값을 target 하는 방법이다. action-value와 value값의 차이를 구하면 특정 행동이 평균적으로 얼마나 더 좋은지에 대한 결과값을 얻을 수 있다.

N-step estimators

"Vanilla" Policy gradient algorithm

'Artificial Intelligence > Deep Learning' 카테고리의 다른 글
Tmux 란 무엇인가? (0) | 2024.12.05 |
---|---|
HuggingFace datasets은 dict 형태가 아니다 [?] (0) | 2024.11.23 |
[CS234] Reinforcement Learning: Lecture 4 (0) | 2024.07.17 |
[CS234] Reinforcement Learning: Lecture 3 (0) | 2024.07.16 |