Driving Reinforcement Learning with Models

2019·Arxiv

Abstract

Abstract

In this paper we propose a new approach to complement reinforcement learning (RL) with model-based control (in particular, Model Predictive Control - MPC). We introduce an algorithm, the MPC augmented RL (MPRL) that combines RL and MPC in a novel way so that they can augment each other’s strengths. We demonstrate the effective-ness of the MPRL by letting it play against the Atari game Pong. For this task, the results highlight how MPRL is able to outperform both RL and MPC when these are used individually.

1 Introduction

Model-free reinforcement learning (RL in what follows) has become a popular paradigm to design autonomous agents [1,2,3,4]. Its key idea is that of learning a policy for a given task by interacting with the environment via a trial and error mechanism: essentially, the optimal policy is achieved by exploring the state space and by learning which actions are the best (based on some reward function) for a given state. Unfortunately, two key practical disadvantages of RL are its sample inefficiency and its lack of (e.g. safety) guarantees while learning [5,6]. This paper proposes an approach to drive the learning of RL that stems from the following observation: in many applications, such as applications requiring physical interactions between the agent and its environment, while a full model of the environment might not be available, at least parts of the model, for e.g. a subset of the state space, might be known/identifiable. Motivated by this, we explore how the availability of these partial models can be leveraged to drive, and indeed accelerate, the learning phase of RL.

1.1 Contributions

We propose a novel algorithm that complements the capabilities of RL with those of a well known and established model-based control method, Model Predictive Control (MPC). Our algorithm, the MPC augmented RL (MPRL in what follows), combines RL and MPC in a novel way so that they can augment each other’s strengths. The MPRL is inspired by the fact that, from a designer’s perspective, complex tasks can be often fulfilled by combining together a set of functionalities and, for some of these functionalities, either a mathematical model is known or it might be worth devising it. For example, functionalities for which it is worth to invest to build a model are these that are critical to satisfy safety requirements: in e.g. an automated driving context, these critical functionalities are those directly associated to the prevention of crashes and the braking dynamics of the car can be modeled via differential/difference equations. Given these considerations, the MPRL can be described as follows. At each iteration, it checks whether the environment is in a state for which a mathematical model is available (or can be identified). If this is the case, then the action that the agent will apply is computed by leveraging the model and using MPC to optimize a given cost function. If a model is not available, then MPRL makes use of RL (in particular, we will use Q-Learning) to compute a policy from data. The two counterparts (or components) of the MPRL, i.e. MPC and RL, are interlinked and interact within the algorithm. In particular, MPC both drives the state-space exploration and tunes the RL rewards in order to speed the learning process. To the best of our knowledge, this is a new approach to combine MPC and RL, which is complementary to the recent results on learning MPC [7,8,9]. A further exploration of the use of feedback control to enhance the performance of data-driven algorithms can also be found in [10], which proposes a different mechanism to complement RL with a feedback control loop. In order to illustrate the effectiveness of MPRL, we let it play the Atari game Pong and also control an inverted pendulum. The results highlight the ability of the algorithm to learn the task, outperforming both RL and MPC when these are used individually. The code of our experiments is available at the repository https://github.com/GIOVRUSSO/Control-Group-Code.

1.2 Related Work

We now briefly survey some related research threads.

Physics simulation. The idea of using models and simulation environments to develop intelligent reinforcement learning agents has recently been attracting much research attention, see e.g. [11,12]. For example, in [13] it is shown how a physical simulator can be embedded in a deep network, enabling agents to both learn parameters of the environment and improve the control performance of the agent. Essentially, this is done by simulating rigid body dynamics via a linear complementarity problem (LCP) technique [14], [15], [13], [16], [17]. LCP techniques are also used within other simulation environments such as MuJoCo [18], Bullet [19], and DART [20]. Instead, a complementary body of literature investigates the possibility of integrating into networks the mechanisms inspired by the intuitive human ability to understand physics (see e.g. [21], [22], [23], which leverage the ideas of [24], [25]).

Model-based RL. Although model-free methods, have achieved considerable successes in the recent years, many works suggest that a model-based approach can potentially achieve better performance [5], [26], [27]. The research in model-based RL is a very active area and it is focused on two main settings. The first one makes use of neural networks and a suitable loss function to simulate the dynamics of interest, whereas another approach makes use of more classical mathematical models closely resembling system identification [28].

Safe RL. The design of safe RL algorithms is a key research topic and different definitions of safety have been proposed in the literature (see e.g. [29], [30] and references therein). For example, in [31] the authors relate safety to a set of error states associated to dangerous/risky situations while in [32] risk adversion is specified in the reward. A complementary approach is the one of model-based RL where safety is formalized via state space constraints, see e.g. [33]. Examples of this approach include [34,5], where Lyapunov functions are used to show forward invariance of the safety set defined by the constraints. Finally, we note that other approaches include [35], where a priori knowledge of the system is used, in order to craft safe backup policies or [36] in which authors consider uncertain systems and enforce probabilistic guarantees on their performance.

2 Background

We now outline the two building blocks composing MPRL.

Model Predictive Control. MPC is a model-based control technique. Essentially, at each time-step, the algorithm computes a control action by solving an optimization problem having as constraint the dynamics of the system being controlled. In addition to the dynamics, other system requirements (e.g. safety or feasibility requirements) can also be formalized as constraints of the optimization problem [37]. Let be the state variable of the system at time k, be its control input and be some noise. In this letter we consider discrete-time dynamical systems of the form with initial condition and where the time-varying matrices have appropriate dimensions. For this system, formally the MPC algorithm generates the control input by solving the problem

with ) denoting the sequence (resp. ) and where: (i) A and X are sets modelling the constraints for the valid control actions and states; (ii) is the cost function being optimized,

i.e. the expected value of ); (iii) is a zero-mean white noise with constant and bounded variance. See e.g. [38] for more details.

Q-Learning and Markov Decision Processes. Q-Learning (Q-L) is a model free RL algorithm, whose aim is to find an optimal policy with respect to a finite Markov Decision Process (MDP). We adopt the standard formalism for MDPs. A MDP [39] is a discrete stochastic model defined by a tuple , where: (i) S is the set of states ; (ii) A is the set of actions ; (iii) P() is the probability of transitioning from state s to state under action a ; (iv) [0, 1) is the discount factor; (v) R(s, a) is the reward of choosing the action a in the state s. Upon performing an action, the agent receives the reward ). A policy, , specifies (for each state) the action that the agent will take and the goal of the agent is that of finding the policy that maximizes the expected discounted total reward. The value ), named Q-function, corresponding to the pair (s, a) represents the estimated expected future reward that can be obtained from (s, a) when using policy . The objective of Q-learning is to estimate the Q-function for the optimal policy ). Define the estimate as Q(s, a). The Q-learning algorithm works then as follows: after setting the initial values for the Q-function, at each time step, observe current state and select action , according to policy ). After receiving the reward ) update the corresponding value of the Q-function as follows:

where [0, 1] is called the learning rate. Notice that the Q-learning algorithm does not specify which policy ) should be considered. In theory, to converge the agent should try every possible action for every possible state many times. For practical reasons, a popular choice for the Q-learning policy is the -greedy policy, which selects its highest valued (greedy) action, ) = argmax), with probability 1 1)/k and randomly selects among all other k actions with probability [40].

3 The MPRL Algorithm

We are now ready to introduce the MPRL algorithm, the key steps of which are summarized as pseudo-code in Algorithm 1. The main intuition behind this algorithm is that, in many real world systems, tasks can be broken down into a set of functionalities and, for some of these, a mathematical model might be available. Given this set-up, the MPRL aims at combining the strengths of MPC and Q-L. Indeed: (i) within MPRL, MPC can directly control the agent whenever a model is available and, at the same time, it drives the state exploration of Q-L and adjusts its rewards; (ii) on the other hand, Q-L generates actions whenever no mathematical model is available and hence classic model-based control algorithm could not be used.

The algorithm takes as input the following design parameters: (i) the set of allowed actions, A; (ii) the time horizon and cost function used in (1); (iii) the constants r and r, used by MPC to fine tune the reward of Q-L; (iv) an initial matrix Q(s, a). Then, following Algorithm 1 the following steps are performed:

S1: at each time-step, MPRL checks whether a model is available. As we will see in Section 4, for the Pong game, a model can be identified when MPRL is

defending against attacks. Instead, in Section 5, for an inverted pendulum, we use a predefined action around certain operating conditions of the pendulum arm;

S2a: if a model is available, then the action applied by the agent is generated via MPC. Even if the action applied by the agent is given by MPC, the action that would have been obtained via Q-L is also computed. This is done to enable MPC to drive RL. Indeed, if the action from MPC and Q-L are the same, then the Q(s, a) matrix is updated by using the positive reward r. On the other hand, if the actions from MPC and Q-L differ from one another, then the Q(s, a) matrix is updated with a non-positive reward r;

S2b: if a model is not available (or cannot be identified), then the agent’s action is generated by Q-L;

S3: all relevant quantities are saved within the main algorithm loop.

4 Using MPRL to learn Pong

We now illustrate the effectiveness of MPRL by letting it play against the Atari game Pong. Pong is a 2 player game where each player moves a paddle in order to bounce a ball to the opponent. A player scores a point when the opponent fails to bounce the ball back and the game ends when a player scores 21 points. In what follows, we give a thorough description of how Algorithm 1 has been implemented in order to allow MPRL to play against Pong.

4.1 The environment and data gathering

The environment of the game was set-up using the OpenAI gym library in Python. In particular, we used the PongDeterministic-v4 (with 4 frame skips) configuration of the environment, which is the one used to assess Deep QNetworks, see e.g. [41]. The configuration used has, as observation space, Box(210, 160, 3) (see Figure 1, left panel). Within our experiments, we first removed the part of the images that contained the game score and this yielded an observation space of Box(160, 160, 3) and then we down-sampled the resulting image to get a reduced observation space of Box(80, 80, 3) so that each frame consists of a matrix of 80 80 pixels. Within the image, a coordinate system is defined within the environment, with the origin of the x and y axes being in the bottom-right corner. Given the above observation space, both the position of the ball and the vertical position of the paddle moved by MPRL were extracted from each frame. In particular:

– At the beginning of the game, the centroid of the ball is found by iterating through the frame to find the location of all pixels with a value of 236 (this corresponds to the white color, i.e. the color of the ball in Pong). Then, once the ball is found the first time, the frame is only scanned in a window around the position of the ball previously found (namely, we used a window of 80 12 pixels, see Figure 1, right panel);

– Similarly the paddle’s centroid position is found by scanning the frame for pixels having value 92 (this corresponds to the green color, i.e. the color of the MPRL paddle).

4.2 Definition of the task and its functionalities

The agent’s task is that of winning the game, which essentially consists of two phases: (i) defense phase, where the agent needs to move the paddle to bounce the ball in order to avoid that the opponent makes a point; (ii) an attack phase, where the agent needs instead to properly bounce the ball in order to make the point. During the defense phase, MPRL used its MPC component (implemented

Fig. 1: Left panel: a typical frame from Pong. The paddle moved by MPRL is the green one. Right panel: a zoom illustrating the 80 12 pixels window used to extract the new position of the ball, given its previous position.

as described in Section 4.3) to move the paddle. Indeed, this phase is completely governed by the physics of the game and by the moves of our agent. This, in turn, makes it possible to identify, from pixels, both the ball and the paddle dynamics (Section 4.3). Instead, we used the Q-L component of MPRL during the attack phase. Indeed, even if a mathematical model describing the evolution of the position of the ball could be devised, there is no difference equation that could predict what our opponent would do in response (as we have no control over it). Therefore, in the attack phase, we let the Q-L counterpart of our algorithm learn how to score a point.

4.3 Implementing MPC

We describe the MPC implementation used within MPRL to play Pong by first introducing the mathematical model serving as the constraint in (1). This model describes both the dynamics of the ball and of the paddle moved by MPRL.

Ball dynamics. We denote by and the x and y coordinates of the centroid of the ball at time t. The mathematical model describing the dynamics of the ball is then:

where and are the predicted next coordinates at time t + 1 and where the speeds at time t, i.e. and are computed from the positions extracted from the current and the two previous frames, i.e. and

. In particular, this is done by first computing the quantities and as follows:

Consider now the speed along the x axis. If there is no impact between the ball and the paddle, we set = 0([]) = ¯(where var(a) denotes the variance of the generic vector a and is a white noise with zero mean and variance var ([])). Instead, along the y axis, we have = 0) + var ([]) = ¯(with being a white noise with zero mean and variance var ([])) if there has been no impact and if there has been an impact of the ball with one of the walls.

Paddle dynamics. In the gym environment used for the experiments, the only control action that can be applied by MPRL at time t, i.e. is that of moving its paddle. In particular, the agent can either move the paddle up (= 1) or down (1) or simply not moving the paddle (= 0). It follows that, given the vertical position of the centroid of the paddle at time t, say , its dynamics can be modeled by

The MPC model and the cost function. Combining the models in (3) - (5) yields the dynamical system serving as constraint in (1). Note that the resulting model can be formally written as the system in (1) once the state is defined as = [. Finally, in the implementation of the MPC algorithm, we used as cost function . That is, with this choice of cost function the algorithm seeks to regulate the paddle’s position so that the distance between the position of the ball at time t and the position of the MPRL paddle at time t + T is minimised. Note that the time horizon, T, used in the above cost function is obtained by propagating the ball model (3) in order to estimate after how many iterates the ball will hit the border protected by the MPRL paddle.

4.4 Implementing Q-L

We implemented the Q-L algorithm outlined in Section 4. The set of actions available to the agent were +1}, while the state at time was defined as the 5-dimensional vector containing: (i) the coordinates of the position at time time t of the ball (in pixels); (ii) the velocity of the ball (rounded to the closest integer) across the x and y axes; (iii) the position of the paddle moved by MPRL. The reward was obtained from the game environment: our agent was given a reward of +1, each time the opponent missed to hit the ball, and 1 each time our agent missed to hit the ball. Finally, the values of the Q-table were initialized to 0. In the experiments, the state-action pair was updated whenever a point was scored and a greedy policy was used to select the action. Also, in the experiments we set both and in (2) to 0.7. Moreover, following Algorithm 1, the Q-function was also updated when our agent was defending (i.e. when MPRL was using MPC to move the paddle). In particular, within the experiments we assigned: (i) a positive reward, r, whenever the action from Q-L and MPC were the same; (ii) a non-positive reward, r, whenever the actions were not the same. In this way, within MPRL, the Q-L component is driven to learn defence tactics too.

4.5 Handover between MPRL components

Finally, we now describe how the handover between the MPC and RL components of MPRL was implemented in the experiments. Intuitively, the paddle was moved by the MPC component when the ball was coming towards the MPRL paddle and, at the same time, the future vertical position of the ball (predicted via the model) was far from the actual position of the agent’s paddle. That is, MPC was used whenever the following conditions were simultaneously satisfied: 0, . In all the other situations the paddle was moved by actions generated by the Q-L component. Note that: (i) is estimated from the game frames as described above (in the environment negative velocities along the x axis mean that the ball is coming towards the green paddle); (ii) the computation of relies on simulating the model describing the ball’s dynamics (3); (iii) is a threshold and this is a design parameter.

4.6 Results

We are now ready to present the results obtained by letting MPRL play Pong. The results are quantified by plotting the game reward as a function of the number of episodes played by MPRL. An episode consists of as many rounds of pong it takes for one of the players to reach 21 points, while the game reward is defined to be the difference between the points scored by MPRL within the episode and the points scored by the opponent within the episode. Essentially, a negative game reward means that MPRL lost that episode; the lowest possible value that can be attained is 21 and this happens when MPRL is not able to score any point. Viceversa, a positive game reward means that the agent was able to beat the opponent; the maximum value that can be obtained is +21, when the opponent did not score any point.

As a first experiment, we implemented an agent that would only use MPC or the Q-L algorithm (without prior training). We let this agent play Pong for 50 episodes and, as the left panel in Figure 2 shows, as expected, the Q-L agent did not obtain good rewards in the first 50 episodes, consistently loosing games with a difference in the scores of about 20 points. Instead, when the agent used the MPC described in Section 4 better performance were obtained. These performance, however, were not comparable with those obtained via a trained Q-L agent and the reason for this is that, while MPC allows the agent to defend, it does not allow for the learning of an attack strategy to consistently obtain points. Using MPRL allowed to overcome the shortcomings of the MPC and Q-L agents. In particular, as shown in the right panel of Figure 2, when the MPRL agent played against Pong, it was able to consistently beat the game (note the agent never lost a game) while quickly learning an attack strategy to obtain high game rewards. Indeed, note how the agent is able to consistently obtain rewards of about 20 within 50 episodes.

Fig. 2: Left panel: episode rewards as a function of the number of episodes played when either MPC or Q-L are used. Right panel: episode rewards as a function of the number of episodes played by MPRL. Parameters of MPRL were set as follows: r = 0.1, r = 0, = 5.

Fig. 3: Left panel: rewards obtained by the MPRL when is perturbed. All the other parameters were kept unchanged (i.e. r = 0.1, r = 0). Middle panel: rewards obtained by MPRL when r is perturbed. In this experiment, = 5 and r = 0. Right panel: rewards obtained by MPRL when r is perturbed. In the experiment, = 5 and r = 0.1.

In order to further investigate the performance of MPRL, we also evaluate its performance when the parameters r, r and are changed. We first take in consideration; determines when the handover between MPC and RL takes place. As Figure 3 (left panel) illustrates, MPRL is still able to consistently obtain high rewards when is perturbed, i.e. . Notice that when = 4, while MPRL is still able to beat the game, it also experiences some drops in the rewards. This phenomenon, which will be further investigated in future studies, might be due to the fact that restricting the space of movements of the Q-L component of the algorithm also restricts its learning capabilities. Instead, when the manoeuvre space of the Q-L is bigger (= 6), the algorithm, due to the increased flexibility in the moves, is able to learn better moves faster. As a further experiment, we fixed = 5 and perturbed the algorithm parameter r so that . The results of this experiment are shown in the middle panel of Figure 3. It can be noted that smaller values of r (i.e. r = 0.1 and r = 0.3) lead to a more consistent performance as compared to the higher values of r which lead to negative spikes in the performance. This behaviour might be due to the fact that higher values of r essentially imply that MPRL trusts more the MPC actions than Q-L actions, hence penalizing the ability of MPRL to quickly learn the attack strategy. Intuitively, simulations show that, while the MPC component is important for enhancing the agent’s defense, too much influence of this component on the Q-L can reduce the attack performance of the agent (this, in turn, is essential in order to score higher points). Consistently, the same behaviour can be observed when r is perturbed (= 5, r = 0.1 and ), as shown in Figure 3 (right panel), where it can be observed that the most negative values r lead to dips in performance.

5 MPRL to control an inverted pendulum

An additional experiment was carried out to test the capability of the MPRL algorithm in a different domain. This experiment involved balancing an inverted pendulum in a virtual environment using MPRL and comparing its results against using Q-L only. Specifically, the goal of the MPRL was to move the cart by controlling its speed so that the pendulum would stay in its upright position at 180 degrees (see Figure 4).

In our experiments, the reward was specified to be +1 if the pendulum was within 175 and 185 degrees for each time step and -1 if the pendulum went outside this range. Moreover, in our experiments we considered the region between 135 and 225 degrees as a safe region and we wanted the MPRL to keep the arm of the pendulum within this region, see Figure 5. In order to handle this safety requirement, in our MPRL we used an MPC-like algorithm whenever the pendulum arm was outside the region 135 - 225 degrees. In particular: (i) if the arm position was at 135 degrees (or smaller), then the cart speed was adjusted by MPRL to move the cart to the left; (ii) if the arm position was at 225 degrees or higher, then the cart was moved by MPRL to the right. By doing so, the numerical results showed that MPC component of MPRL was able to bring the arm within the safety region (i.e. between 135 and 225 degrees). Inside this region, the Q-L component of MPRL was active.

Fig. 4: Inverted pendulum in its balanced state within the safety limits at 135 and 225 degrees.

Again, as shown in Figure 5, the results confirm the capability of the MPRL to quickly learn how to balance the pendulum. Moreover, when compared to the results obtained via Q-Learning, the MPRL dramatically reduces the violation of the safety constraints (i.e. the number of times when the pendulum is outside the safe region) and learns faster. This again shows that MPC, and more generally models, can augment the performance of purely data-driven techniques.

6 Conclusions and Future Work

We investigated the possibility of combining Q-L and model-based control so that they can augment each other’s capabilities. In doing so, we introduced a novel algorithm, the MPRL that: (i) leverages MPC when a mathematical model is available and Q-L otherwise; (ii) uses MPC to both drive the state-space exploration of Q-L and to fin tune its rewards. We first illustrated the effectiveness of our algorithm by letting it play against Pong and by analysing its performance when the algorithm parameters are perturbed. Interestingly, the experiments highlight how the algorithm is able to outperform both Q-L and MPC when these are used individually. Moreover, we also tested MPRL in a different domain and showed how it quickly learns to balance an inverted pendulum, while reducing the number of violations of safety constraints. Our future work will include the implementation of the MPRL in different settings, the study of its convergence properties and the design of optimal handover strategies.

References

1. M. Breyer, F. Furrer, T. Novkovic, R. Siegwart, and J. Nieto, “Comparing task simplifications to learn closed-loop object picking using deep reinforcement learn-

Fig. 5: Angle of the inverted pendulum against time when MPRL is used and when Q-learning is used. The upright position is 180 degrees and the constraints at 135 and 225 degrees are the angles past which the pendulum is highly likely to fall over.

ing,” IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 1549–1556, 2019.

2. S. Hoppe, Z. Lou, D. Hennes, and M. Toussaint, “Planning approximate explo- ration trajectories for model-free reinforcement learning in contact-rich manipulation,” IEEE Robotics and Automation Letters, vol. 4, no. 4, pp. 4042–4047, 2019.

3. B. Liu, L. Wang, and M. Liu, “Lifelong federated reinforcement learning: A learning architecture for navigation in cloud robotic systems,” IEEE Robotics and Automation Letters, vol. 4, no. 4, pp. 4555–4562, 2019.

4. X. Tan, C. Chng, Y. Su, K. Lim, and C. Chui, “Robot-assisted training in la- paroscopy using deep reinforcement learning,” IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 485–492, 2019.

5. F. Berkenkamp, M. Turchetta, A. Schoellig, and A. Krause, “Safe model-based reinforcement learning with stability guarantees,” Advances in Neural Information Processing Systems 30, pp. 908–918, 2017.

6. M. Pfeiffer, S. Shukla, M. Turchetta, C. Cadena, A. Krause, R. Siegwart, and J. Ni- eto, “Reinforced imitation: Sample efficient deep reinforcement learning for mapless navigation by leveraging prior demonstrations,” IEEE Robotics and Automation Letters, vol. 3, no. 4, pp. 4423–4430, Oct 2018.

7. U. Rosolia and F. Borrelli, “Learning model predictive control for iterative tasks. a data-driven control framework,” IEEE Transactions on Automatic Control, vol. 63, no. 7, pp. 1883–1896, July 2018.

8. B. Thananjeyan, A. Balakrishna, U. Rosolia, F. Li, R. McAllister, J. E. Gonzalez, S. Levine, F. Borrelli, and K. Goldberg, “Safety augmented value estimation from

demonstrations (saved): Safe deep model-based rl for sparse cost robotic tasks,” 2019.

9. U. Rosolia, X. Zhang, and F. Borrelli, “Data-driven predictive control for au- tonomous systems,” Annual Review of Control, Robotics, and Autonomous Systems, vol. 1, no. 1, pp. 259–286, 2018.

10. F. D. Lellis, F. Auletta, G. Russo, and M. di Bernardo, “Control-tutored reinforce- ment learning: an application to the herding problem,” 2019.

11. M. Pecka, K. Zimmermann, M. Petrl´ık, and T. Svoboda, “Data-driven policy trans- fer with imprecise perception simulation,” IEEE Robotics and Automation Letters, vol. 3, no. 4, pp. 3916–3921, 2018.

12. M. Hazara and V. Kyrki, “Transferring generalizable motor primitives from sim- ulation to real world,” IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 2172–2179, 2019.

13. F. de Avila Belbute-Peres, K. Smith, K. Allen, J. Tenenbaum, and J. Z. Kolter, “End-to-end differentiable physics for learning and control,” Advances in Neural Information Processing Systems 31, pp. 7178–7189, 2018.

14. R. W. Cottle, “Linear complementarity problem,” in Encyclopedia of Optimization, C. A. Floudas and P. M. Pardalos, Eds. Boston, MA: Springer US, 2009, pp. 1873– 1878.

15. M. B. Cline, “Rigid body simulation with contact and constraints,” Ph.D. disser- tation, 2002.

16. J. Degrave, M. Hermans, J. Dambre, and F. wyffels, “A differentiable physics engine for deep learning in robotics,” Frontiers in Neurorobotics, vol. 13, p. 6, 2019.

17. A. Lerer, S. Gross, and R. Fergus, “Learning physical intuition of block towers by example,” in 33rd International Conference on Machine Learning, vol. 48, 2016, pp. 430–438.

18. E. Todorov, T. Erez, and Y. Tassa, “MuJoCo: a physics engine for model-based control,” in 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, Oct 2012, pp. 5026–5033.

19. J. Lee, M. X. Grey, S. Ha, T. Kunz, S. Jain, Y. Ye, S. S. Srinivasa, M. Stilman, and C. K. Liu, “DART: Dynamic animation and robotics toolkit,” The Journal of Open Source Software, vol. 3, no. 22, p. 500, Feb 2018.

20. M. Hermans, B. Schrauwen, P. Bienstman, and J. Dambre, “Automated design of complex dynamic systems,” PLOS ONE, vol. 9, no. 1, pp. 1–11, 01 2014.

21. M. B. Chang, T. Ullman, A. Torralba, and J. B. Tenenbaum, “A compositional object-based approach to learning physical dynamics,” in 5th International Conference on Learning Representations, 2017.

22. P. Battaglia, R. Pascanu, M. Lai, D. J. Rezende, and K. Kavukcuoglu, “Interaction networks for learning about objects, relations and physics,” in Proceedings of the 30th International Conference on Neural Information Processing Systems, 2016, pp. 4509–4517.

23. P. W. Battaglia, J. B. Hamrick, and J. B. Tenenbaum, “Simulation as an engine of physical scene understanding,” Proceedings of the National Academy of Sciences, vol. 110, no. 45, pp. 18 327–18 332, 2013.

24. K. A. Smith and E. Vul, “Sources of uncertainty in intuitive physics,” Topics in Cognitive Science, vol. 5, no. 1, pp. 185–199, 2013.

25. P. J. Werbos, “Neural networks for control and system identification,” in Proceedings of the 28th IEEE Conference on Decision and Control, Dec 1989, pp. 260–265 vol.1.

26. C. G. Atkeson and J. C. Santamaria, “A comparison of direct and model-based reinforcement learning,” in International Conference on Robotics and Automation, 1997, pp. 3557–3564.

27. T. Kurutach, I. Clavera, Y. Duan, A. Tamar, and P. Abbeel, “Model-ensemble trust-region policy optimization,” in International Conference on Learning Representations, 2018.

28. M. Pecka and T. Svoboda, “Safe exploration techniques for reinforcement learning – an overview,” in Modelling and Simulation for Autonomous Systems, J. Hodicky, Ed., 2014, pp. 357–375.

29. J. Garc´ıa and F. Fern´andez, “A comprehensive survey on safe reinforcement learn- ing,” Journal of Machine Learning Research, vol. 16, pp. 1437–1480, 2015.

30. S. P. Coraluppi and S. I. Marcus, “Risk-sensitive and minimax control of discrete- time, finite-state markov decision processes,” Automatica, vol. 35, no. 2, pp. 301 – 309, 1999.

31. P. Geibel and F. Wysotzki, “Risk-sensitive reinforcement learning applied to con- trol under constraints,” J. Artif. Int. Res., vol. 24, pp. 81–108, 2005.

32. A. Tamar, S. Mannor, and H. Xu, “Scaling up robust mdps using function approxi- mation,” in Proceedings of the 31st International Conference on Machine Learning, vol. 32, 2014, pp. 181–189.

33. C. D. McKinnon and A. P. Schoellig, “Learn fast, forget slow: Safe predictive learning control for systems with unknown and changing dynamics performing repetitive tasks,” IEEE Robotics and Automation Letters, vol. 4, no. 2, pp. 2180– 2187, 2019.

34. V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis, “Human-level control through deep reinforcement learning,” Nature, vol. 518, no. 7540, pp. 529–533, Feb. 2015.

35. J. Garc´ıa and F. Fern´andez, “Safe exploration of state and action spaces in rein- forcement learning,” J. Artif. Int. Res., vol. 45, pp. 515–564, 2012.

36. D. Sadigh and A. Kapoor, “Safe control under uncertainty with probabilistic signal temporal logic,” in Robotics: Science and Systems XII, 2016.

37. C. E. Garc´ıa, D. M. Prett, and M. Morari, “Model predictive control: Theory and practice—a survey,” Automatica, vol. 25, no. 3, pp. 335 – 348, 1989.

38. F. Borrelli, A. Bemporad, and M. Morari, Predictive Control for Linear and Hybrid Systems, 1st ed. New York, NY, USA: Cambridge University Press, 2017.

39. R. S. Sutton and A. G. Barto, Introduction to Reinforcement Learning, 1st ed. Cambridge, MA, USA: MIT Press, 1998.

40. M. Wunder, M. L. Littman, and M. Babes, “Classes of multiagent Q-learning dynamics with epsilon-greedy exploration,” in Proceedings of the 27th International Conference on Machine Learning, 2010, pp. 1167–1174.

41. V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller, “Playing atari with deep reinforcement learning,” in NIPS Deep Learning Workshop, 2013.

designed for accessibility and to further open science