Aprendizagem por Reforço

Controle Baseado em Dados

Prof. Dr. Raphael Teixeira

Universidade Federal do Pará

O que é Aprendizagem por Reforço?

Um agente aprende a agir sobre um ambiente por tentativa e erro, maximizando recompensa acumulada — sem que ninguém lhe diga a ação certa.

Processos de Decisão de Markov

Um MDP é a tupla \((\mathcal{S}, \mathcal{A}, P, r, \gamma)\): estados, ações, \(P(s'|s,a)\) (transição), \(r(s,a)\) (recompensa), \(\gamma\) (desconto).

Uma política \(\pi(a|s)\) mapeia estados em ações. Objetivo: maximizar \(\mathbb{E}\left[\sum_{k} \gamma^k r(s_k,a_k)\right]\).

Nota

Em controle: \(\mathcal{S}\) é o estado da planta, \(\mathcal{A}\) a entrada, \(-r\) o custo por estágio (Kaelbling; Littman; Moore, 1996).

Valor e Equação de Bellman

\(Q^\pi(s,a)\): retorno esperado seguindo \(\pi\) a partir de \((s,a)\).

A política ótima satisfaz (Bellman, 1957): \[ Q^\ast(s,a) = \mathbb{E}_{s'}\left[r(s,a) + \gamma \max_{a'} Q^\ast(s',a')\right] \] e \(\pi^\ast(s) = \arg\max_a Q^\ast(s,a)\).

Q-Learning

Q-learning (Watkins; Dayan, 1992) aprende \(Q^\ast\) só observando transições \((s,a,r,s')\):

\[ Q(s,a) \leftarrow Q(s,a) + \alpha \Big[ r + \gamma \max_{a'} Q(s',a') - Q(s,a) \Big] \]

  • Exploração \(\varepsilon\)-greedy: ação aleatória com prob. \(\varepsilon\);
  • Converge para \(Q^\ast\) sob condições brandas (Sutton; Barto, 2018).

RL Profundo

Para estados contínuos, tabelas viram redes neurais:

RL e Controle Ótimo: a Ponte

No fundo, o mesmo problema (Bertsekas, 2019):

Controle ótimo RL
Custo \(\ell(x,u)\) Recompensa \(-r(s,a)\)
Riccati / HJB Equação de Bellman
Programação dinâmica Iteração de valor/política
LQR Caso exatamente solúvel

Para controle contínuo, muito do que RL “descobre” já tem solução fechada na teoria clássica (Recht, 2019) — o exemplo a seguir mostra isso.

Referências

BELLMAN, Richard. Dynamic Programming. [S.l.]: Princeton University Press, 1957.
BERTSEKAS, Dimitri P. Reinforcement Learning and Optimal Control. [S.l.]: Athena Scientific, 2019.
KAELBLING, Leslie Pack; LITTMAN, Michael L.; MOORE, Andrew W. Reinforcement Learning: A Survey. Journal of Artificial Intelligence Research, v. 4, p. 237–285, 1996.
LILLICRAP, Timothy P. et al. Continuous Control with Deep Reinforcement Learning. International Conference on Learning Representations (ICLR), 2016.
MNIH, Volodymyr et al. Human-Level Control through Deep Reinforcement Learning. Nature, v. 518, p. 529–533, 2015.
RECHT, Benjamin. A Tour of Reinforcement Learning: The View from Continuous Control. Annual Review of Control, Robotics, and Autonomous Systems, v. 2, p. 253–279, 2019.
SCHULMAN, John et al. Proximal Policy Optimization Algorithms. arXiv preprint arXiv:1707.06347, 2017.
SUTTON, Richard S.; BARTO, Andrew G. Reinforcement Learning: An Introduction. 2. ed. [S.l.]: MIT Press, 2018.
WATKINS, Christopher J. C. H.; DAYAN, Peter. Q-Learning. Machine Learning, v. 8, p. 279–292, 1992.

Encerramento

Prof. Dr. Raphael Teixeira

Universidade Federal do Pará

raphaelbt@ufpa.br