Acceso abierto al contenido del libro
Libro disponible en versión papel (18.45 €) y versión Kindle ( 9.80 €)
Content
- [Nota sobre la generación de esta versión abierta]
- [Nota sobre el alojamiento de esta versión abierta]
- [English abstract]
- [“Deep Reinforcement Learning Explained” en Medium]
- PORTADA y CRÉDITOS
- ÍNDICE DE CONTENIDOS
- PRÓLOGO
- PREFACIO
- ACERCA DE ESTE LIBRO
- PARTE 1: FUNDAMENTOS DEL APRENDIZAJE POR REFUERZO
- 1 INTRODUCCIÓN AL APRENDIZAJE POR REFUERZO
- 2 FORMALIZACIÓN DEL APRENDIZAJE POR REFUERZO
- 3 FUNCIONES DE VALOR Y LA ECUACIÓN DE BELLMAN
- PARTE 2: ALGORITMOS CLÁSICOS DE APRENDIZAJE POR REFUERZO
- 4 PROGRAMACIÓN DINÁMICA
- 5 EVALUACIÓN DE POLÍTICAS CON MONTE CARLO
- 6 OBTENCIÓN DE POLÍTICAS ÓPTIMAS
- PARTE 3: APRENDIZAJE PROFUNDO
- 7 INTRODUCCIÓN AL APRENDIZAJE PROFUNDO
- 8 PYTORCH BÁSICO
- PARTE 4: APRENDIZAJE POR REFUERZO PROFUNDO
- 9 MÉTODOS VALUE-BASED: DEEP Q-NETWORK
- 10 MÉTODOS POLICY-BASED: REINFORCE
- 11 FRAMEWORKS DE APRENDIZAJE POR REFUERZO: RAY+RLLIB
- CLAUSURA: SOMOS RESPONSABLES DE NUESTROS PROGRAMAS
- APÉNDICE: TERMINOLOGÍA BÁSICA
- AGRADECIMIENTOS
- OTROS RECURSOS EN INTERNET
- Fe de erratas
- [Notas de prensa]
- GALERIA DE FOTOGRAFÍAS DEL LIBRO DURANTE SU CAMPAÑA DE LANZAMIENTO 🙂
[Nota sobre la generación de esta versión abierta]
En el proceso semiautomático de generación de esta versión abierta del libro en HTML, a partir de la versión del libro en papel, algunos elementos que componen este manuscrito han quedado «desalineados» en relación a su versión en papel. Además, se han perdido algunos formatos de tipografía de texto y se han modificado algunos tamaños de letra/figuras. En algunos casos, ante la limitación de poder expresar en HTML correctamente algunas fórmulas matemáticas o nomenclatura, se ha optado por transformarlas en imágenes insertadas en el texto. A pesar de estas limitaciones de conversión, el resultado permite aprender sin dificultades de esta versión abierta.
[Nota sobre el alojamiento de esta versión abierta]
En este sitio web pongo a disposición de cualquier estudiante el contenido de este y otros libros, además de varios recursos académicos que uso en mis clases. Por este motivo, este sitio web recibe muchos accesos, a menudo simultáneos, que pueden presentar tiempos de respuesta «lentos» (según los «estándares» a que nos tienen acostumbrados empresas como Google). Esto es debido a que torres.ai lo tengo alojado en un servidor, bueno y potente, pero de páginas personales.
Para reducir estas situaciones de saturación en el acceso a los contenidos de la web torres.ai, he subido una copia de los capítulos de la versión abierta del libro a la plataforma Medium, cuyo servidor no presenta estas limitaciones.
Ahora bien, si no se es miembro de Medium solo se tiene acceso a un número determinado de capítulos al mes. Por ello, he puesto a su disposición una segunda copia local en este servidor que, aunque más lento, continúa siendo de acceso totalmente ilimitado.
[English abstract]
Deep Reinforcement Learning is the field of Artificial Intelligence with more potential in the coming years. It enables algorithms to learn from their environment to achieve diverse goals, thereby overcoming the limitations found in traditional machine learning algorithms for machines to learn on their own.
However, due to the complexity of Reinforcement Learning science and the lack of books on the subject in Spanish (none so far), there are often difficulties in establishing a suitable route to start, as it is not easy to jump the barrier of entry to this exciting field of innovation.
Therefore, the objective of this book is to be an initiation guide for those who want to know the theoretical foundations of the area. At the same time, from the Python implementation and detailed explanation of all the algorithms presented in the book, working knowledge of the fundamentals is provided.
In the first part of the book, the topic is formalized around two key elements in Reinforcement Learning, such as the Markov Decision Process and the Bellman equation.
From here, in the second part of the book, following a classic approach to books dedicated to the subject, the three fundamental approaches to solving a Reinforcement Learning problem are reviewed. It begins by presenting Dynamic Programming, which assumes that the transition dynamics of the environment are known. However, in most Reinforcement Learning problems, these are not known, and Monte Carlo methods were introduced to solve these cases, which learn through interaction with the environment. Finally, Temporal Difference learning is treated as an improvement over Monte Carlo methods; Specifically, two important methods are described, the on-policy SARSA method and the off-policy Q-learning method, which are the basis of many current algorithms.
In the third part of the book, both the basic concepts of Deep Learning are presented very briefly, as well as the practical version of these concepts using the PyTorch library.
Currently, Deep Learning is used for Reinforcement Learning to have a more effective approach; This is what we call Deep Reinforcement Learning, which is presented in the fourth part of the book. In this last part, two families of methods are given, Value-based and Policy-based, with which the reader should be familiar because the fundamental concepts derived from these methods are those that underpin all current Deep Reinforcement Learning methods. Specifically, to see the main properties of these two approaches, the Deep Q-Learning and REINFORCE methods are presented. The last chapter presents how these advanced methods can be used through Reinforcement Learning frameworks, showing a concrete example of use with one of the best current options, the RLlib library in the Ray framework.
The book concludes with a closing chapter that appeals to the responsibility of the engineers who use this type of technology. Because the future that we will “invent” is a choice we make together, not something that happens.
[“Deep Reinforcement Learning Explained” en Medium]
PORTADA y CRÉDITOS
ÍNDICE DE CONTENIDOS
PRÓLOGO
PREFACIO
ACERCA DE ESTE LIBRO
A quién va dirigido el libro
Organización del libro
Acerca de WATCH THIS SPACE
GitHub del libro (código)
PARTE 1: FUNDAMENTOS DEL APRENDIZAJE POR REFUERZO
1 INTRODUCCIÓN AL APRENDIZAJE POR REFUERZO
Contexto
Aprendizaje por refuerzo
Modelización de un problema
En qué se diferencia el aprendizaje
2 FORMALIZACIÓN DEL APRENDIZAJE POR REFUERZO
Proceso de decisión de Markov
Piezas de un proceso de decisión de Markov
Entornos deterministas y estocásticos
Configuración del problema a resolver
3 FUNCIONES DE VALOR Y LA ECUACIÓN DE BELLMAN
Funciones de valor
La ecuación de Bellman
La ecuación de Bellman óptima
Resumen de la terminología
PARTE 2: ALGORITMOS CLÁSICOS DE APRENDIZAJE POR REFUERZO
4 PROGRAMACIÓN DINÁMICA
Método Value Iteration
Implementación del método Value Iteration
Análisis del comportamiento del agente
Estimación de la función de transición y recompensas
5 EVALUACIÓN DE POLÍTICAS CON MONTE CARLO
Métodos Monte Carlo
Algoritmo de predicción Monte Carlo
Métodos de predicción Monte Carlo para la función V
Métodos de predicción Monte Carlo para la función Q
6 OBTENCIÓN DE POLÍTICAS ÓPTIMAS
Dilema exploración-explotación
Método de control Monte Carlo constant-alpha
Implementación del método de control Monte Carlo
Aprendizaje por diferencia temporal: SARSA y Q-Learning
PARTE 3: APRENDIZAJE PROFUNDO
7 INTRODUCCIÓN AL APRENDIZAJE PROFUNDO
[Acceso local]
Redes neuronales
Proceso de aprendizaje de una red neuronal
Hiperparámetros en redes neuronales
Tipos de redes neuronales
8 PYTORCH BÁSICO
[Acceso local]
Introducción a PyTorch
Programación de una red neuronal con PyTorch
Configuración del entrenamiento de una red neuronal en Pytorch
Entrenamiento de una red neuronal en PyTorch
PARTE 4: APRENDIZAJE POR REFUERZO PROFUNDO
9 MÉTODOS VALUE-BASED: DEEP Q-NETWORK
[Acceso local]
Q-Learning con redes neuronales
Experience Replay y Target Network
Algoritmo Deep Q-Learning
Entrenamiento de un modelo Deep Q-Learning
10 MÉTODOS POLICY-BASED: REINFORCE
[Acceso local]
Métodos Policy-based
Método REINFORCE
Programación del método REINFORCE
Limitaciones de los métodos Policy-based
11 FRAMEWORKS DE APRENDIZAJE POR REFUERZO: RAY+RLLIB
[Acceso local]
Conocimientos básicos del aprendizaje por refuerzo profundo
Frameworks de aprendizaje por refuerzo
Aprendizaje por refuerzo escalable con Ray
Resolviendo el entorno Cart-pole con RLlib
CLAUSURA: SOMOS RESPONSABLES DE NUESTROS PROGRAMAS
[Acceso local]
APÉNDICE: TERMINOLOGÍA BÁSICA
[Acceso local]
AGRADECIMIENTOS
Escribir un libro requiere motivación, pero también requiere mucho tiempo, y por ello quiero empezar agradeciendo a mi familia el apoyo y la comprensión que ha mostrado ante el hecho de que un portátil compartiera con nosotros las largas noches de confinamiento, los fines de semana desde hace muchos meses y todos los días de las pasadas vacaciones de Navidad.
Mi agradecimiento a los miembros del equipo de investigación Emerging Technologies for Artificial Intelligence del Barcelona Supercomputing Center, que me han acompañado en este viaje de descubrimiento de este apasionante mundo del aprendizaje por refuerzo. En especial, mi más sincero agradecimiento a Juan Luis Domínguez y Oriol Aranda, con quienes he discutido varios puntos de este libro, y quienes me han ayudado a darle estructura y a revisar el código, respectivamente. Pero también al resto del equipo que de una manera u otra han contribuido en esta obra, Victor Campos, Xavier Giró-i-Nieto, Míriam Bellver, Raúl García, Miquel Escobar y Daniel Cano.
Han sido muchos los expertos en este tema que no conozco personalmente pero que también has sido esenciales a la hora de escribir este libro, permitiéndome compartir sus conocimientos escritos y sus códigos compartidos en GitHub. Por ello, menciono en detalle las fuentes en los apartados correspondientes, más como muestra de agradecimiento que como consulta obligatoria para el lector o lectora.
Finalmente, mi mayor agradecimiento a mi universidad, la Universitat Politècnica de Catalunya – UPC Barcelona Tech y a mi centro de investigación Barcelona Supercomputing Center – Centro Nacional de Computación (BSC). Un entorno de excelencia que me ha permitido realizar mi investigación sobre estos temas y acumular los conocimientos que aquí quiero compartir. Y, entre todos, quiero destacar a los tres profesores más excelentes: Mateo Valero, Jesús Labarta y Eduard Ayguadé. Sin el soporte que siempre me han prestado —y, sobre todo, su paciencia conmigo—, yo nunca habría podido explorar e iniciarme en este tema tan apasionante.
OTROS RECURSOS EN INTERNET
Libros
- Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction, by MIT Press, 2018. [on-line available from incompleteideas.net]. Related independent repo of Python code.
- Miguel Morales. Grokking Deep Reinforcement Learning. MANNING, 2020.
- Alexander Zai and Brandon Brown. Deep Reinforcement Learning in Action. MANNING, 2020.
- Maxim Lapan. Deep Reinforcement Learning Hands-on. Packt Publishing Ltd., 2nd edition, 2020.
- Micheal Lanham. Hands-on Reinforcement Learning for Games. Packt Publishing, 2020.
- Phil Winder. Reinforcement Learning, Industrial Applications and Intelligent Agents. O’Really Media Inc., 2020.
- Sudharsan Ravichandiran. Deep Reinforcement Learning with Python. Packt Publishing Ltd., 2nd edition, 2020.
Cursos y blogs destacados
- UCL Course on RL by David Silver
- UC Berkeley CS 285 by Sergey Levine
- DeepMind & UCL by Hado Van Hasselt
- Stanford CS234 by Emma Brunskill
- UPC Barcelona Tech by Mario Martin
- University of Waterloo CS 885 by Pascal Poupart
- Berkeley DRL Bootcamp by Pieter Abbeel et all
- UPC Barcelona Tech by Xavier Giró-i-Nieto et all
- OpenAI by Josh Achiam
- Lilian Weng: A (Long) Peek into Reinforcement Learning
- Papers with code
- Alex Irpan: Sorta Insightful: Deep Reinforcement Learning Doesn’t Work Yet
- Andrej Karpathy Blog: Deep Reinforcement Learning from Pixels
Fe de erratas
Pendiente
[Notas de prensa]
- Barcelona Supercomputing Center (BSC-CNS): English – Català – Castellano
- Facultat d’Informàtica de Barcelona (FIB/UPC): English – Català – Castellano
GALERIA DE FOTOGRAFÍAS DEL LIBRO DURANTE SU CAMPAÑA DE LANZAMIENTO 🙂
Celebrando Sant Jordi 2021:
Visitando a lectores:
Paseando por el campo:
Con el decano de la FIB y gran amigo del autor:
De visita en la FIB:
De visita al Torre Girona:
Conversando con Marenostrum:
Conversando con Marenostrum:
Conversando con Marenostrum:
Conversando con Marenostrum: