
The image of the world around us, which we carry in our head, is just a model. Nobody in his head imagines all the world, government or country. He has only selected concepts, and relationships between them, and uses those to represent the real system.
- Jay Write Forrester, 1971*
일상 생활을 할 때 어떠한 의사 결정을 하기 위해서는, 논리적인 흐름을 따를 때도 있지만 본능적이고 반사적으로 행동해야 할 때가 있음.

본 논문의 저자는 위와 같은 관점에서 강화학습 문제를 바라보고 해결하고자 하였음.
💡 Agent model은 세 개의 요소로 이루어져 있음.
(1) Vision model : Image Observation을 Memory RNN에 넣어주기 위해 image frame을 small latent vector z 로 변환해주는 component
(2) Memory RNN model : historical information 기반으로 미래를 예측하는 component
(3) Controller model : 이러한 예측에 따른 최적의 행동을 결정하는 component

본 논문에서 Vision model로 VAE(Variational Autoencoder)를 이용하여 state image로 부터 중요한 정보를 추출함.

Observation을 small latent vector로 압축하는 것이 Vision model의 역할이라면, Memory RNN은 시간이 지남에 따라서 어떤 상황이 발생하는지를 예측하는 역할을 함.

MDN 관련 좋은 설명 reference

[예시]

Contoller model은 최적의 행동을 결정하는 Policy임.
일반적인 강화학습과 다르게, MDN-RNN의 이전 시점의 정보들을 포함하고 있는 hidden state h를 함께 사용하여서 action을 결정하게 됨.
Evolution strategy는 최적화 알고리즘 중 하나로 많은 후보 솔루션 중 “좋은 솔루션”을 선택하는 과정을 반복하면서 최적해를 찾는 알고리즘임.
env = gym.make('worlddomination-v0')
# use our favourite ES
solver = EvolutionStrategy()
while True:
# ask the ES to give set of params
solutions = solver.ask()
# create array to hold the results
fitlist = np.zeros(solver.popsize)
# evaluate for each given solution
for i in range(solver.popsize):
# init the agent with a solution
agent = Agent(solutions[i])
# rollout env with this agent
fitlist[i] = rollout(agent, env)
# give scores results back to ES
solver.tell(fitness_list)
# get best param & fitness from ES
bestsol, bestfit = solver.result()
# see if our task is solved
if bestfit > MY_REQUIREMENT:
break

def rollout(controller):
’’’ env, rnn, vae are ’’’
’’’ global variables ’’’
obs = env.reset()
h = rnn.initial_state()
done = False
cumulative_reward = 0
while not done:
z = vae.encode(obs)
a = controller.action([z, h])
obs, reward, done = env.step(a)
cumulative_reward += reward
h = rnn.forward([a, z, h])
return cumulative_reward
Car Racing 예제는 3개의 continuous actions을 control하는 agent 를 학습시킴.

학습 순서는 아래와 같으며, 이때 reward information 을 Controller 학습 시에만 reward information을 사용한다고 함.
💡 Procedure:
(1) Collect 10,000 rollout from a random policy.
(2) Train VAE (V) to encode frames into .
(3) Train MDN-RNN (M) to model .
(4) Evolve linear controller (C) to maximize the expected cumulative reward of a rollout.
학습 결과를 보면, 기존 RL 방법론들 보다도 Full World Model을 사용했을 때 가장 average score가 높은 것을 확인할 수 있음.

[Car Racing Dream]
이때 앞서 설명했던 를 조절하면서 M을 통해 생성된 environment에 대한 uncertainty를 control 했다고 함.


학습 순서는 아래와 같음.
앞서 봤던 car racing 예제와 다른 점으로는 M model이 next 외에도 agent가 죽었는지 아닌지에 대한 를 함께 예측한다는 것임.
💡 Procedure:
(1) Collect 10,000 rollout from a random policy.
(2) Train VAE (V) to encode frames into .
(3) Train MDN-RNN (M) to model .
(4) Evolve linear controller (C) to maximize the expected survival time inside the virtual environment.
(5) Deploy learned policy from (4) on actual environment.
[Temperature 실험]
💡 Ha, D. and Eck, D. A neural representation of sketch drawings. ArXiv preprint, April 2017. URL https://magenta.tensorflow.org/ sketch-rnn-demo.
https://openreview.net/pdf?id=Hy6GHpkCW
Model에서 를 생성할 때 uncertainty를 조절하기 위한 방법으로 parameter 를 조절함.

지금까지의 experiments는 굉장히 단순한 tasks이라고 볼 수 있으나, 실제 문제들은 그렇게 단순하지 않음.
💡 Procedure:
(1) Initialize M, C with random model parameters.
(2) Rollout to actual environment N times. Save all actions and observations during
rollouts to storage.
(3) Train M to model model and train C to optimize expected reward inside of M.
(4) Go back to (2) if task has not been completed.
위 Procedure에서 볼 수 있듯, 앞선 experiments와는 다르게 M model은 (1)이 아닌 (2) 인 x, r, a, d를 예측하고 있음.
이와 관련하여서 복잡하고 정밀한 제어가 필요한 task를 배우는 경우, C model이 어떻게 행동할지 또한 M model이 예측하게 하여 C model이 보다 복잡한 환경에 잘 적응할 수 있도록 도울 수 있다고 함.
Reference
좋은 리뷰 해주셔서 감사합니다.