arxiv: v2 [cs.ai] 23 Nov 2018

Similar documents
Deep reinforcement learning. Dialogue Systems Group, Cambridge University Engineering Department

Driving a car with low dimensional input features

arxiv: v1 [cs.ne] 4 Dec 2015

Multiagent (Deep) Reinforcement Learning

Variational Deep Q Network

Reinforcement. Function Approximation. Learning with KATJA HOFMANN. Researcher, MSR Cambridge

Deep Q-Learning with Recurrent Neural Networks

Balancing and Control of a Freely-Swinging Pendulum Using a Model-Free Reinforcement Learning Algorithm

Introduction to Reinforcement Learning

Q-Learning in Continuous State Action Spaces

Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor

Lecture 1: March 7, 2018

Stochastic Video Prediction with Deep Conditional Generative Models

REINFORCE Framework for Stochastic Policy Optimization and its use in Deep Learning

The Supervised Learning Approach To Estimating Heterogeneous Causal Regime Effects

CS230: Lecture 9 Deep Reinforcement Learning

Forward Actor-Critic for Nonlinear Function Approximation in Reinforcement Learning

Generalization and Function Approximation

INF 5860 Machine learning for image classification. Lecture 14: Reinforcement learning May 9, 2018

Reinforcement Learning and Control

Autonomous Braking System via Deep Reinforcement Learning

CS599 Lecture 1 Introduction To RL

An Adaptive Clustering Method for Model-free Reinforcement Learning

arxiv: v1 [cs.lg] 28 Dec 2016

REINFORCEMENT LEARNING

Policy Gradient Methods. February 13, 2017

Christopher Watkins and Peter Dayan. Noga Zaslavsky. The Hebrew University of Jerusalem Advanced Seminar in Deep Learning (67679) November 1, 2015

Reinforcement Learning

arxiv: v1 [cs.ro] 28 Nov 2018

arxiv: v2 [cs.lg] 8 Aug 2018

The Markov Decision Process Extraction Network

Reinforcement Learning and NLP

Reinforcement Learning II. George Konidaris

CSC321 Lecture 22: Q-Learning

Learning Control Under Uncertainty: A Probabilistic Value-Iteration Approach

Reinforcement Learning II. George Konidaris

Supplementary Material: Control of Memory, Active Perception, and Action in Minecraft

1 Introduction 2. 4 Q-Learning The Q-value The Temporal Difference The whole Q-Learning process... 5

Prof. Dr. Ann Nowé. Artificial Intelligence Lab ai.vub.ac.be

Active Policy Iteration: Efficient Exploration through Active Learning for Value Function Approximation in Reinforcement Learning

Deep Reinforcement Learning: Policy Gradients and Q-Learning

Deep Reinforcement Learning SISL. Jeremy Morton (jmorton2) November 7, Stanford Intelligent Systems Laboratory

THE PREDICTRON: END-TO-END LEARNING AND PLANNING

Machine Learning I Reinforcement Learning

Deep Reinforcement Learning via Policy Optimization

CS 570: Machine Learning Seminar. Fall 2016

Reinforcement Learning

arxiv: v2 [cs.lg] 21 Jul 2017

RL 3: Reinforcement Learning

Open Theoretical Questions in Reinforcement Learning

An application of the temporal difference algorithm to the truck backer-upper problem

Supplementary Material for Asynchronous Methods for Deep Reinforcement Learning

Weighted Double Q-learning

arxiv: v1 [cs.lg] 30 Dec 2016

Comparing Deep Reinforcement Learning and Evolutionary Methods in Continuous Control

Neural Map. Structured Memory for Deep RL. Emilio Parisotto

CS599 Lecture 2 Function Approximation in RL

Notes on Tabular Methods

Introduction to Reinforcement Learning. CMPT 882 Mar. 18

A reinforcement learning scheme for a multi-agent card game with Monte Carlo state estimation

CS Machine Learning Qualifying Exam

arxiv: v1 [cs.lg] 31 May 2018

Learning Tetris. 1 Tetris. February 3, 2009

arxiv: v1 [cs.lg] 4 Feb 2016

Learning Control for Air Hockey Striking using Deep Reinforcement Learning

Reinforcement Learning. Odelia Schwartz 2016

Lecture 18: Reinforcement Learning Sanjeev Arora Elad Hazan

The Reinforcement Learning Problem

STATE GENERALIZATION WITH SUPPORT VECTOR MACHINES IN REINFORCEMENT LEARNING. Ryo Goto, Toshihiro Matsui and Hiroshi Matsuo

Q-Learning for Markov Decision Processes*

Optimization of a Sequential Decision Making Problem for a Rare Disease Diagnostic Application.

This question has three parts, each of which can be answered concisely, but be prepared to explain and justify your concise answer.

Autonomous Helicopter Flight via Reinforcement Learning

Reinforcement learning an introduction

Human-level control through deep reinforcement. Liia Butler

Lecture 3: The Reinforcement Learning Problem

Chapter 3: The Reinforcement Learning Problem

Course 16:198:520: Introduction To Artificial Intelligence Lecture 13. Decision Making. Abdeslam Boularias. Wednesday, December 7, 2016

Temporal Difference Learning & Policy Iteration

Reinforcement Learning II

Replacing eligibility trace for action-value learning with function approximation

Approximation Methods in Reinforcement Learning

The Predictron: End-To-End Learning and Planning

Linear Least-squares Dyna-style Planning

Lecture 23: Reinforcement Learning

Machine Learning I Continuous Reinforcement Learning

Constrained Policy Optimization

Basics of reinforcement learning

Actor-Critic Reinforcement Learning with Neural Networks in Continuous Games

Deep Reinforcement Learning. STAT946 Deep Learning Guest Lecture by Pascal Poupart University of Waterloo October 19, 2017

An Introduction to Reinforcement Learning

Grundlagen der Künstlichen Intelligenz

Markov decision processes

Reinforcement Learning

Decision Theory: Q-Learning

MARKOV DECISION PROCESSES (MDP) AND REINFORCEMENT LEARNING (RL) Versione originale delle slide fornita dal Prof. Francesco Lo Presti

Reinforcement Learning

Today s s Lecture. Applicability of Neural Networks. Back-propagation. Review of Neural Networks. Lecture 20: Learning -4. Markov-Decision Processes

arxiv: v1 [cs.ai] 1 Jul 2015

Towards Fully-automated Driving

Transcription:

Simulated Autonomous Driving in a Realistic Driving Environment using Deep Reinforcement Learning and a Deterministic Finite State Machine arxiv:1811.07868v2 [cs.ai] 23 Nov 2018 Patrick Klose Visual Sensorics & Information Processing Lab (CS Dept.) Goethe University Frankfurt, Germany ABSTRACT In the field of Autonomous Driving, the system controlling the vehicle can be seen as an agent acting in a complex environment and thus naturally fits into the modern framework of Reinforcement Learning. However, learning to drive can be a challenging task and current results are often restricted to simplified driving environments. To advance the field, we present a method to adaptively restrict the action space of the agent according to its current driving situation and show that it can be used to swiftly learn to drive in a realistic environment based on the Deep Q-Network algorithm. ACM Reference Format: Patrick Klose and Rudolf Mester. 2019. Simulated Autonomous Driving in a Realistic Driving Environment using Deep Reinforcement Learning and a Deterministic Finite State Machine. In Proceedings of Applications of Intelligent Systems (APPIS 19). ACM, New York, NY, USA, 6 pages. https: //doi.org/10.1145/nnnnnnn.nnnnnnn 1 INTRODUCTION In the last decade, the application of Reinforcement Learning (RL) has seen a tremendous growth with producing remarkable results in various fields. For example, Mnih et al. (2015) showed that RL can be used to let an agent learn to play various Atari games beyond the human level, Silver et al. (2016) showed that an agent can even learn to beat the world champion in the game of Go and Lillicrap et al. (2015) presented that RL can also produce meaningful results when applied to complex control tasks. This evolution is not only due to the computational resources now available, but also due to the recent theoretical advancement of RL mostly based on combining common RL concepts with deep neural networks (Deep RL). In the field of Autonomous Driving (AD), the RL framework is a promising choice for controlling the vehicle. In this context, some authors actually showed that RL can be used for learning to drive in yet simplified environments (e.g. Sallab et al. 2016). While the results of these studies are remarkable, the demand to make the environment more realistic (e.g. by using a realistic road network) can quickly require an unfeasible amount of training for the agent. To tackle this problem, we present a novel method, which is a combination of the Deep Q-Network algorithm (DQN; Mnih et al. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). 2019 Copyright held by the owner/author(s). ACM ISBN 978-x-xxxx-xxxx-x/YY/MM. https://doi.org/10.1145/nnnnnnn.nnnnnnn Rudolf Mester Norwegian Open AI Lab & CS Dept. (IDI) Norwegian University of Science and Technology Trondheim, Norway 2013) with the concept of a Deterministic Finite State Machine (DFSM; e.g. Hopcroft et al. 2013), to adaptively restrict the action space of the agent according to its current driving situation. While many studies showed that DQN is a powerful algorithm on its own, adaptively restricting the action space decreases the amount of computation needed and incorporates prior knowledge about which actions are reasonable in a specific situation to foster exploration and accelerate the training. We also present the results of an application of our method to show that RL is still an efficient approach to AD, even when the environments are getting more realistic. 2 RELATED WORK Work related to this paper ranges from systems which can only support a human driver to systems which can fully take over the control of a vehicle. Starting with the former, Desjardins and Chaibdraa (2011) proposed an RL system for controlling the (longitudinal) velocity of a vehicle according to another one which is followed. Similar to this study, Sallab et al. (2016) proposed an RL system for lane keeping assistance and showed results of using this system in the racing car simulator TORCS 1. Furthermore, in another study (Sallab et al. 2017), the same authors proposed an RL framework for also handling the partial observability of driving situations and the vast amount of information coming from the sensors of a vehicle. Focusing more on fully autonomous systems, Kuderer et al. (2015) stated in their study, that there is no common driving style among human drivers and therefore, it is difficult to define one global reward function. To overcome this problem, they showed that inverse RL can be used to previously learn the driving style of a human driver by adjusting parameters of a model which is then used to compute trajectories when in autonomous mode. Independent from particular driving styles, Shalev-Shwartz et al. (2016) emphasized that AD is usually a multi-agent problem, which in turn can violate the Markov assumption of RL and that functional safety should be treated separately from it (different methods to tackle these difficulties are presented). Similar to the previous study, Xiong et al. (2016) combined RL with artificial potential fields and a path tracking method to avoid collisions with other vehicles. Liaw et al. (2017) used the concept of hierarchical RL and showed that learning a meta-policy composed of already learned policies can be a promising approach to solve problems in the field of AD. The general idea of using a sub-policy according to the current driving situation of the agent is conceptually similar to our approach, since both methods adaptively focus only on a subset of all the possible behavior of the agent. 1 https://sourceforge.net/projects/torcs/

3 THEORETICAL BACKGROUND 3.1 Reinforcement Learning In the modern RL framework (Sutton and Barto 1998) which is often represented as a (finite) Markov Decision Process (MDP), an agent interacts with an environment E in discrete time steps and at each time step t, the agent receives a representation of the environment state S t S (further: state), where S describes the (finite) set of all possible states in E. Based on S t, the agent chooses from a set of possible actions in that state, i.e., there is a function A : S P(A + ) \ mapping a state to an element of the power set P of A + (with the empty set being excluded), whereby A + is in turn defined as the (finite) set of all possible actions in E. Which particular action of A(S t ) is then chosen is controlled by the (stochastic) policy of the agent defined as the function π(. S t ) : A(S t ) R 0, whereby ξ A(S t ) π(ξ S t ) = 1. Hence, π is a conditional probability distribution, i.e., π(a S t ) represents the probability of taking action a A(S t ) in state S t. Let A t be the action, the agent has actually taken in S t. Then, in time step t + 1, the agent makes a transition into a new state S t+1 and receives a numerical reward R t+1 R R from the (finite) set of all rewards R as a consequence of its decision about A t in S t. These dynamics are described by the (stochastic) environment function P(.,. S t, A t ) : S R R 0, where it holds that ξ S ζ R P(ξ, ζ S t, A t ) = 1. Hence, P(s, r S t, A t ) represents the conditional joint probability for transitioning into state s and receiving reward r when deciding upon action A t in state S t. Here, the particular dynamics of the environment in time step t only depend on S t and A t (Markov property; Sutton and Barto 1998). Let (R t, R t+1,..., R T ) be a particular reward sequence from time step t to time step T where it can be assumed that in the case of an episodic task, T is a terminal state with T < and in the case of an infinite task, T = holds (Sutton and Barto 1998). The return G t is then defined as a function over this reward sequence, i.e., G t f (R t, R t+1,..., R T ) and the formal goal of many RL algorithms is to find an optimal policy π defined as π arg max π E S i 0,R j 1 P,A k 0 π (G 1 ), where S 0 is drawn from P which in this case represents a start distribution over S (Lillicrap et al. 2015). One popular definition for f, which we also used in this study, is to sum up the discounted future rewards, i.e., f (R t, R t+1,..., R T ) Tξ =t γ ξ t R ξ with γ [0, 1) being the discount factor. To find π, many RL algorithms try to learn the state-action value function Q π (S t, A t ) E Si >t,r j >t P,A k >t π (G t+1 S t, A t ) (policy evaluation; Lillicrap et al. 2015, Sutton and Barto 1998). In other words, Q π (S t, A t ) represents the expected return of taking action A t in S t and subsequently following policy π (Sutton and Barto 1998). The idea behind this function is that once (approximately) determined for π, it can be used as guidance to improve the policy towards π (policy improvement; Sutton and Barto 1998). Beside the fact that many RL algorithms have been proven to converge to π via General Policy Iteration (GPI; Sutton and Barto 1998), most of them rely on a table-based representation of Q π and hence cannot be effectively applied to real world tasks, where at least S is often very large (Sutton and Barto 1998). To overcome this limitation, some RL algorithms insteadly approximate Q π based on parameterized functions. In this context, the DQN algorithm which Patrick Klose and Rudolf Mester is also used in this study, is based on ordinary Q-Learning (Watkins 1989) but represents Q π with a neural network. Furthermore, since working with function approximation in RL can be unstable (Sutton and Barto 1998), DQN also uses a replay buffer (Lin 1993) to which the experiences of the agent are saved and from which random mini-batches are drawn for the training. This method eliminates the strong dependency between subsequent experiences of the agent and shifts the RL problem into the direction of a supervised one for which stable algorithms exist (Mnih et al. 2013, Mnih et al. 2015). 3.2 Deterministic Finite State Machine A DFSM is similar to the concept of a MDP, i.e., it is also defined on the basis of states, actions (further: inputs) and related transition dynamics but is fully deterministic and provides no reward signals. A DFSM is commonly used as a structure to solve various computational problems and can be defined as the 5-tuple M (W, Σ, δ,w 0, F), where W is the (finite) set of states, Σ is the (finite) set of inputs, δ : W Σ W is representing the transition dynamics and w 0 W as well as F W are describing the starting state and the (finite) set of accepting states, respectively. Based on this setting, the DFSM starts in w 0 and while receiving a sequence of inputs (σ 0, σ 1,..., σ n 1 ) Σ n, it makes transitions according to δ from state to state. If the DFSM transitioned after i inputs (0 < i n) into an accepting state (e.g. w 3 with w 3 F), then the last j inputs with 0 < j i fulfilled the computation and the DFSM is set back to w 0. While using the concept of accepting states is flexible and powerful, we only use the broader concept of a DFSM in this study, i.e., having different states in which some computation can be done as well as having inputs which trigger deterministic transitions between those states. 4 DRIVING ENVIRONMENT 4.1 Realistic Road Network To model the driving environment truly realistic, we decided to use Open Street Maps (OSM) 2 as the data provider for the realistic road network. Using this data has the advantage that the agent will not only face common and simple but also complex and rare driving situations which may not be present if we would rely on an artificially generated road network. To map the OSM data into a suitable 3D model, we used the trial version of an OSM to 3D model converter. Since this study focuses on learning to drive, we decided to map the OSM data directly into a fully semantically-colored 3D model. This assumes the complementary step of perception to be solved and allows to fully focus on the acting problem. After mapping the OSM data into the 3D model, we used Unity 3 as the 3D engine in which the agent has to drive the vehicle. This software provides a well-engineered physics engine to let the agent also face a physically well-behaving vehicle (see below). As the region of driving, we chose the small city Gelnhausen 4 which provides all types of roads, i.e., straight and curved roads as well as intersections and roundabouts (an extract is shown in Figure 1). 2 https://www.openstreetmap.org 3 https://www.unity.com 4 Geographical coordinates (center): 50.202975N, 9.190527E

Simulated Autonomous Driving in a Realistic Driving Environment using Deep Reinforcement Learning and a Deterministic Finite State Machine Figure 1: An extract from the realistic road network Figure 2: The vehicle with its simplified LiDAR system 4.2 Vehicle To implement the vehicle, we decided to use the model of a BMW M3 from Bonecracker Games 5. This model can be seamlessly integrated into Unity and fully uses the built-in physics engine to provide a realistic driving behavior. The possible inputs to the vehicle are a brake, throttle and steering command with the former two between 0 and 1 and the steering command between -1 and +1. To simplify the task for the agent, we have implemented a mapping routine merging the brake and throttle command such that a positive value is a throttle command setting the brake command to 0 and a negative value is a brake command setting the throttle command to 0 (the steering command is independent of this routine). 4.3 Sensors To implement the sensors of the vehicle, we decided upon measuring the longitudinal velocity of the vehicle v [ m s ], its angular velocity v [ r ad s ], and in analogy to a realistic LiDAR system, a number of distances d from the vehicle to the curb of the road in m which we call a circogram (see Figure 2 for the simplified LiDAR system). Furthermore, we implemented a collider generating the true-valued boolean collision signal c when the vehicle hit the curb of the road. This signal is used to let the agent learn to avoid these undesired situations and as a trigger to respawn the vehicle after a collision to one of 64 places distributed across the road network with the selection being randomly (uniform). 5 ARCHITECTURE 5.1 Overview This section provides an overview of the architecture of our system, which we call the Reinforcement Learning based Driving System (RLDS; see Figure 3), to explain the dataflow between the driving 5 https://www.bonecrackergames.com environment and the modules of the agent. The subsequent sections then provide the implementation details of each module. While the Unity module is providing the driving environment E, all the other modules are belonging to the agent in a broad sense. In time step t, the agent receives from Unity the four measurements v t, v t, d t, and c t. The first three values are processed by the Memorizer where a history of already received values is maintained. Using not only immediate measurements but also historical ones can improve the degree to which the Markov property of the states of the agent is fulfilled. After adding the current measurements to the history, all the currently saved values are transfered to the State Generator where the state S t is generated. This state is then transfered to the Navigator which adaptively generates A(S t ), i.e., the reasonable actions for the agent in time step t. Both, S t and A(S t ) are then forwarded to the Neural Network which sequentially calculates (one a A(S t ) and ˆQ π (S t, a) at a time) the corresponding state-action values. All these state-action values are then transfered to the Maximizer which selects the action A t with the highest state-action value. To encourage exploration, A(S t ) is also forwarded to the Explorer which finally decides on the chosen action A t by either staying with A t or by selecting some random action (uniform) out of A(S t ). In either way, the chosen action A t is then sent to the Sequencer which creates a sequence of commands ranging from the previous chosen action A t n to the current one (in n time steps) since in the real world, actions can also not be executed without a delay. Note that after creating the sequence, there will be no further action selection by the agent between time step t and t + n and the agent just sends the commands from the created sequence to Unity. In parallel to this process, the current state S t and the chosen action A t are also used to build up a SARS tuple6. In time step t +n, after the Sequencer has executed A t, it is decided upon A t+n based on S t+n and the reward R t+n of the just experienced transition is 6 SARS is an akronym for State, Action, Reward, State.

Patrick Klose and Rudolf Mester Figure 3: The architecture of RLDS calculated via the Reward Function. With having R t+n and S t+n, the previously started SARS tuple can be completed and saved (together with c t+n and A(S t+n )) to the Replay Buffer. Note that since there is no action selection between time step t and t + n, the measurements v i, v i, and d i with t < i < t + n are not transfered to the Memorizer but simply skipped such that states can only contain measurements saved at time steps where there was an action selection by the agent. This is important because in any physical system, an action that stimulates the system can only lead to an observable effect if the action is applied for longer than a system-specific time interval. The actual learning is achieved by adjusting the weights of the Neural Network based on the DQN algorithm. 5.2 Unity As already stated, this module is representing the environment E for the agent and is also defining its corresponding environment function P. Regarding the vehicle, the simplified LiDAR system has three parameters to adjust, i.e., α, β, and d. Here, α 12 represents the maximum distance of a raycast in m, β 180 represents the angle from the leftmost to the rightmost raycast in and d 25 represents the number of (equally distributed) raycasts. 5.3 Memorizer and State Generator The Memorizer is implemented based on three queues (first-in-firstout) to separately save the historical values of v, v, and d. However, we found that the agent learns best if we set the length of each queue to 1, i.e., when no historical experiences are saved. The State Generator uses the output of the Memorizer (only the current measurements in this study) and generates the state for the agent. Here, we decided to use all the measurements available, i.e., v, v, and d as well as a fixed target velocity v 8[ m s ] such that the state of the agent in time step t is represented by [v t,v t, v, d t ]. 5.4 Set of Actions To exclude extreme commands and to discretize the action space, we decided to provide the agent with 20 values equally distributed between -0.5 and 0.5 for the combined brake and throttle command (A 1 + ) and with 100 values equally distributed between -0.8 and 0.8 for the steering command (A 2 + ). Hence, the set of all actions A + A 1 + A+ 2 R2 is represented by 2,000 real-valued pairs. 5.5 Navigator This module is implemented based on the concept of a DFSM and the general idea is to adaptively restrict A + by generating A(S t ) according to S t and the desired driving direction for the vehicle. In this context, adaptively restricting the action space has at least three advantages, i.e., first, since our method ensures that A(S t ) < A + for all the relevant time steps t, the corresponding state-action values never have to be calculated for all the 2,000 actions in a time step. Second, our method allows to use a navigation system guiding the agent along the road network, whereby we kept it as simple as possible in this study, i.e., it decides randomly (uniform) where to drive next when a decision can be made. Finally, incorporating prior knowledge such that A(S t ) only contains reasonable actions is meaningful because it accelerates the training (some state-action combinations are not considered at all) and additionally fosters exploration, since the agent is sometimes coerced to handle (approximately) the same state with a different set of actions. In each time step t, in which the agent has to choose an action, the module firstly extracts drivable directions from the circogram d t (contained in S t ; see Figure 4) by searching over ψ 5 regions for modes consisting of the longest raycasts (eligible modes). Afterwards, the module decides - based on the DFSM - upon one particular mode and outputs reasonable actions for the agent. The reason for using a DFSM is that once the module decided upon a particular mode, it should be retained until the agent has driven the

Simulated Autonomous Driving in a Realistic Driving Environment using Deep Reinforcement Learning and a Deterministic Finite State Machine vehicle along this part of the road. Otherwise, when continuously switching between eligible modes, a collision of the vehicle cannot be avoided in many cases. To implement the DFSM, we decided to use M (W, Σ, δ,w 0, F) with W {w 0,w 1,w 2 }, Σ {σ 0, σ 1 }, (w 0, σ 0 ) w 0 (w 0, σ 1 ) w 1 (w 1, σ 0 ) w 0 δ (w 1, σ 1 ) w 2 (w 2, σ 0 ) w 0 (w 2, σ 1 ) w 2 and F. Here, w 0 represents the state in which the unique eligible mode is selected, w 1 represents the state in which one of the multiple eligible modes is randomly (uniform) selected, and w 2 represents the state in which the previously chosen mode is selected again. As the inputs of the DFSM, σ 0 represents the input signal of having only one eligible mode in the circogram and σ 1 represents the input signal of having more than one eligible mode. For instance, let the agent be in time step t while facing a circogram d t containing only one eligible mode as well as let the DFSM be in state w 0 (the starting state) such that the DFSM just selects that mode. If the next circogram d t+n contains more than one eligible mode, the DFSM (now in state w 1 ) will randomly (uniform) select one of them. In subsequent time steps (t + 2n, t + 3n,...), the DFSM will try to reselect this chosen mode as long as the circograms contain more than one eligible mode (state w 2 ) and will otherwise transition back to w 0 with behavior as explained. The reselection of a mode is accomplished by calculating the distances (based on indices) from the center of each eligible mode in the current circogram to the center of the previous chosen mode, whereby the mode with the minimum distance is selected again. Regarding the generation of reasonable actions for a chosen mode, we decided to only make the steering commands subject to a restriction. Hence, the agent can freely choose among the full set of combined brake and throttle commands A 1 +, but only among the restricted set of reasonable steering commands A 2 + (S t ) A 2 + such that A(S t ) can be defined as A(S t ) A 1 + A+ 2 (S t ). The basis for the definition of A 2 + (S t ) is to additionally separate A 2 + into the same number ψ of ordered and equally-sized subsets as well as to adaptively define A 2 + (S t ) as the subset of A 2 + which corresponds to the region of d t containing the center of the currently chosen mode. In other words, if the desired driving direction (i.e. the chosen mode) is located strongly on the left-hand side in d t, then A 2 + (S t ) only contains steering commands for driving left. 5.6 Neural Network To represent the state-action values, we decided upon using a fullyconnected neural network with two hidden layers having 400 and 300 neurons, respectively. The dimension of the input layer was set to 30 and the dimension of the output layer was set to 1. As the activation functions, we chose LeakyReLU (Maas et al. 2013) with a negative slope coefficient of 0.3 for the whole neural network except for the output layer, where a linear function was used. All the weights of the neural network were randomly (1) initialized based on the normal distribution N(0, 0.05). For the adjustment of the weights, the mean squared error as the optimization criterion and Adam (Kingma and Ba 2014) as the optimizer were chosen as well as the learning rate was set to 0.0005. 5.7 Explorer After receiving A t, this module directly returns this action with probability 1 p t and decides to explore with probability p t. Between t = 0 and t = 100, 000, p t was set to one (full exploration) and it got reduced according to p t 0.99999 (t 100000) afterwards. In case of exploring the environment in time step t, a random action (uniform) out of A (S t ) A(S t ) was selected, whereby A (S t ) is the subset only containing actions with a combined brake and thottle command larger than zero. This procedure encourages the agent to explore the behavior of E when not standing still. 5.8 Sequencer The Sequencer is implemented based on two separate arrays since the action space is two-dimensional. Let A t n and A t be the previously and currently chosen action, let a 1 and b 1 be the first and second value of the pair A t n as well as let a 2 and b 2 be the first and second value of the pair A t. Then, the Sequencer creates one array leading in n 1 steps from a 1 to a 2, i.e., [a 1, a 1 + a 2 a 1 n 1,..., a 2] and another one leading in n 1 steps from b 1 to b 2, i.e., [b 1,b 1 + b 2 b 1 n 1,...,b 2] (linear interpolation). Both arrays are then used for the actual command selection until time step t +n in which two new arrays are generated. In this study, n was set to 10 which was found to be large enough to provide enough differences between subsequent states and small enough to let the agent control the vehicle with a meaningful frequency. 5.9 Reward Function If the agent let the vehicle collide, the reward function returned a constant value of -20. Otherwise, the reward for time step t was calculated according to R t R 1 t + R2 t + R3 t 3 with R i t exp ( 0.5 ( x i t θ i ) 2 ). (2) Here, xt 1 is defined as the absolute difference in the angular velocities between time step t n and t, i.e., xt 1 v t n v t. Furthermore, if the width of the road is smaller than 2 d with d 2 [m], xt 2 is defined as the absolute difference between the leftmost and rightmost distance to the curb of the road in time step t, i.e., xt 2 d1 t d25 t and otherwise, xt 2 represents the absolute difference between d and the rightmost distance to the curb of the road, i.e., xt 2 d dt 25. Finally, xt 3 is defined as the absolute difference between the current and the target velocity of the vehicle in time step t, i.e., xt 3 v t v. The parameters θ 1, θ 2, and θ 3 were set to 0.4, 1, and 3, respectively. 5.10 Remaining Parameters We decided to use a warm-up time of 500 SARS tuples to stabilize the training as well as set the batch size for training to 16 SARS tuples and the discount factor δ to 0.95. Furthermore, we set the length of the replay buffer to 1,000 SARS tuples.

Patrick Klose and Rudolf Mester Figure 4: A circogram separated into five regions Figure 5: The smoothed average performance 6 RESULTS AND CONCLUSION Figure 5 shows the smoothed average performance of 10 instances of the agent and it can be seen that its performance improved strongly after starting to decrease the probability of exploration p (due to smoothing, the threshold is slightly shifted to the left). After about 5 million time steps which corresponds to about 40 hours on a Core i5 with GPU acceleration (GeForce GTX 1070 Ti), the agent controlled the vehicle along the road network nearly collision-free. These results include learning to (approximately) drive at the target velocity v whenever it is possible as well as reducing the velocity of the vehicle before narrow curves and intersections. Furthermore, we also saw the agent reducing the velocity on straight but narrow roads which is a remarkable result because it requires a proper perception of difficult situations. However, sometimes the agent let the vehicle still collide, whereby we ascribe this not to the agent as such but rather to the sensors of the agent and the chosen value of v. This is because in most of the collisions, d does not provided the agent with the necessary information on time to avoid them. To summarize, we have shown in this study that our method of adaptively restricting the action space of the agent can be used to let an agent swiftly learn to drive a physically well-behaving vehicle nearly collision-free along a realistic road network based on the DQN algorithm. Worth mentioning is that these results were produced based on an architecture in which almost all of the chosen parameters were not optimized at all. To conclude, there are at least three avenues for future work, i.e., enhancing the Unity module to provide the agent with additional sensors, completely replacing it by another simulation software, as well as optimizing the parameters to accelerate the training. ACKNOWLEDGMENTS The authors would like to thank Jacopo Lottero and Hanan Abou Hamdan for developing most of the Unity module. The authors would also like to thank Christoph Gaudl for implementing the simplified LiDAR system of the vehicle. REFERENCES [1] C. Desjardins and B. Chaib-draa. 2011. Cooperative Adaptive Cruise Control: A Reinforcement Learning Approach. IEEE Transactions on Intelligent Transportation Systems 12, 4 (2011), 1248 1260. [2] J. E. Hopcroft, R. Motwani, and J. D. Ullman. 2013. Introduction to Automata Theory, Languages, and Computation. Pearson Education. [3] D. P. Kingma and J. L. Ba. 2014. Adam: A Method for Stochastic Optimization. arxiv:1412.6980 (2014). [4] M. Kuderer, S. Gulati, and W. Burgard. 2015. Learning Driving Styles for Autonomous Vehicles from Demonstration. Proceedings of the 2015 IEEE International Conference on Robotics and Automation (ICRA) (2015). [5] R. Liaw, S. Krishnan, A. Garg, D. Crankshaw, J. E. Gonzalez, and K. Goldberg. 2017. Composing Meta-Policies for Autonomous Driving Using Hierarchical Deep Reinforcement Learning. arxiv:1711.01503 (2017). [6] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. 2015. Continuous Control with Deep Reinforcement Learning. 1509.02971 (2015). [7] L.-J. Lin. 1993. Reinforcement Learning for Robots Using Neural Networks. Dissertation (Carnegie Mellon University Pittsburgh) (1993). http://www.dtic.mil/ get-tr-doc/pdf?ad=ada261434 [8] A. L. Maas, A. Y. Hannun, and A. Y. Ng. 2013. Rectifier Nonlinearities Improve Neural Network Acoustic Models. Proceedings of the 30th International Conference on Machine Learning (2013). [9] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. 2013. Playing Atari with Deep Reinforcement Learning. arxiv:1312.5602 (2013). [10] 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. 2015. Human-level Control through Deep Reinforcement Learning. Nature 518, 7540 (2015), 529âĂŞ533. [11] A. E. Sallab, M. Abdou, E. Perot, and S. Yogamani. 2016. End-to-End Deep Reinforcement Learning for Lane Keeping Assist. arxiv:1612.04340 (2016). [12] A. E. Sallab, M. Abdou, E. Perot, and S. Yogamani. 2017. Deep Reinforcement Learning Framework for Autonomous Driving. Electronic Imaging, Autonomous Vehicles and Machines 7 (2017), 70 76. [13] S. Shalev-Shwartz, S. Shammah, and A. Shashua. 2016. Safe, Multi-Agent, Reinforcement Learning for Autonomous Driving. arxiv:1610.03295 (2016). [14] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis. 2016. Mastering the Game of Go with Deep Neural Networks and Tree Search. Nature 529, 7587 (2016), 484 489. [15] R. S. Sutton and A. G. Barto. 1998. Reinforcement Learning: An Introduction. The MIT Press. [16] C. J. C. H. Watkins. 1989. Learning from Delayed Rewards. Dissertation (King s College London) (1989). [17] X. Xiong, J. Wang, F. Zhang, and K. Li. 2016. Combining Deep Reinforcement Learning and Safety Based Control for Autonomous Driving. arxiv:1612.00147 (2016).