Reinforcement Learning

Similar documents
Chapter 3: The Reinforcement Learning Problem

Lecture 3: The Reinforcement Learning Problem

Chapter 3: The Reinforcement Learning Problem

CS599 Lecture 1 Introduction To RL

Reinforcement Learning. Up until now we have been

Course basics. CSE 190: Reinforcement Learning: An Introduction. Last Time. Course goals. The website for the class is linked off my homepage.

Reading Response: Due Wednesday. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction 1

Lecture 2: Learning from Evaluative Feedback. or Bandit Problems

Reinforcement Learning (1)

ARTIFICIAL INTELLIGENCE. Reinforcement learning

Edward L. Thorndike #1874$1949% Lecture 2: Learning from Evaluative Feedback. or!bandit Problems" Learning by Trial$and$Error.

CS788 Dialogue Management Systems Lecture #2: Markov Decision Processes

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

Machine Learning. Reinforcement learning. Hamid Beigy. Sharif University of Technology. Fall 1396

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

Reinforcement learning an introduction

Reinforcement Learning

Lecture 25: Learning 4. Victor R. Lesser. CMPSCI 683 Fall 2010

Lecture 23: Reinforcement Learning

Autonomous Helicopter Flight via Reinforcement Learning

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

Rewards and Value Systems: Conditioning and Reinforcement Learning

Basics of reinforcement learning

The Reinforcement Learning Problem

Grundlagen der Künstlichen Intelligenz

Computational Reinforcement Learning: An Introduction

Introduction to Reinforcement Learning. CMPT 882 Mar. 18

CS 570: Machine Learning Seminar. Fall 2016

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

Chapter 7: Eligibility Traces. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction 1

Reinforcement Learning (1)

Introduction to Reinforcement Learning. Part 6: Core Theory II: Bellman Equations and Dynamic Programming

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

Elements of Reinforcement Learning

Reinforcement Learning. Introduction

CMU Lecture 12: Reinforcement Learning. Teacher: Gianni A. Di Caro

Reinforcement Learning

Machine Learning I Reinforcement Learning

Reinforcement Learning. Machine Learning, Fall 2010

RL 3: Reinforcement Learning

CMU Lecture 11: Markov Decision Processes II. Teacher: Gianni A. Di Caro

Monte Carlo is important in practice. CSE 190: Reinforcement Learning: An Introduction. Chapter 6: Temporal Difference Learning.

Machine Learning. Machine Learning: Jordan Boyd-Graber University of Maryland REINFORCEMENT LEARNING. Slides adapted from Tom Mitchell and Peter Abeel

Lecture 1: March 7, 2018

Reinforcement Learning Active Learning

Reinforcement Learning II

Temporal Difference. Learning KENNETH TRAN. Principal Research Engineer, MSR AI

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

Probabilistic Planning. George Konidaris

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

Planning in Markov Decision Processes

Reinforcement Learning. Spring 2018 Defining MDPs, Planning

CS 188: Artificial Intelligence

Reinforcement Learning (1)

Introduction to Reinforcement Learning

Reinforcement Learning

Reinforcement Learning

Reinforcement Learning: An Introduction

Reinforcement Learning for Continuous. Action using Stochastic Gradient Ascent. Hajime KIMURA, Shigenobu KOBAYASHI JAPAN

Lecture 15: Bandit problems. Markov Processes. Recall: Lotteries and utilities

The Book: Where we are and where we re going. CSE 190: Reinforcement Learning: An Introduction. Chapter 7: Eligibility Traces. Simple Monte Carlo

6 Reinforcement Learning

Some AI Planning Problems

Q-Learning in Continuous State Action Spaces

Reinforcement Learning. Yishay Mansour Tel-Aviv University

Internet Monetization

Administration. CSCI567 Machine Learning (Fall 2018) Outline. Outline. HW5 is available, due on 11/18. Practice final will also be available soon.

Introduction to Reinforcement Learning

Sequential decision making under uncertainty. Department of Computer Science, Czech Technical University in Prague

Open Theoretical Questions in Reinforcement Learning

Q-learning. Tambet Matiisen

Reinforcement Learning

REINFORCEMENT LEARNING

MDP Preliminaries. Nan Jiang. February 10, 2019

Reinforcement Learning and Control

Q-Learning for Markov Decision Processes*

Machine Learning and Bayesian Inference. Unsupervised learning. Can we find regularity in data without the aid of labels?

Reinforcement Learning with Function Approximation. Joseph Christian G. Noel

Reinforcement Learning. George Konidaris

Reinforcement Learning

Chapter 6: Temporal Difference Learning

Reinforcement Learning

The Markov Decision Process (MDP) model

15-780: Graduate Artificial Intelligence. Reinforcement learning (RL)

Reinforcement Learning

, and rewards and transition matrices as shown below:

CS 4100 // artificial intelligence. Recap/midterm review!

Reinforcement Learning

Temporal Difference Learning & Policy Iteration

Chapter 6: Temporal Difference Learning

Lecture 3: Policy Evaluation Without Knowing How the World Works / Model Free Policy Evaluation

15-780: ReinforcementLearning

Reinforcement Learning and NLP

Reinforcement Learning: the basics

Dual Memory Model for Using Pre-Existing Knowledge in Reinforcement Learning Tasks

An Introduction to Reinforcement Learning

Today s Outline. Recap: MDPs. Bellman Equations. Q-Value Iteration. Bellman Backup 5/7/2012. CSE 473: Artificial Intelligence Reinforcement Learning

Q-learning Tutorial. CSC411 Geoffrey Roeder. Slides Adapted from lecture: Rich Zemel, Raquel Urtasun, Sanja Fidler, Nitish Srivastava

Marks. bonus points. } Assignment 1: Should be out this weekend. } Mid-term: Before the last lecture. } Mid-term deferred exam:

An Adaptive Clustering Method for Model-free Reinforcement Learning

Transcription:

Reinforcement Learning 1 Reinforcement Learning Mainly based on Reinforcement Learning An Introduction by Richard Sutton and Andrew Barto Slides are mainly based on the course material provided by the same authors http://www.cs.ualberta.ca/~sutton/book/the-book.html

Reinforcement Learning 2 Learning from Experience Plays a Role in Artificial Intelligence Psychology Reinforcement Learning (RL) Control Theory and Operations Research Neuroscience Artificial Neural Networks

What is Reinforcement Learning? Learning from interaction Goal-oriented learning Learning about, from, and while interacting with an external environment Learning what to do how to map situations to actions so as to maximize a numerical reward signal Reinforcement Learning 3

Reinforcement Learning 4 Supervised Learning Training Info = desired (target) outputs Inputs Supervised Learning System Outputs Error = (target output actual output)

Reinforcement Learning 5 Reinforcement Learning Training Info = evaluations ( rewards / penalties ) Inputs RL System Outputs ( actions ) Objective: get as much reward as possible

Key Features of RL Learner is not told which actions to take Trial-and-Error search Possibility of delayed reward (sacrifice short-term gains for greater long-term gains) The need to explore and exploit Considers the whole problem of a goal-directed agent interacting with an uncertain environment Reinforcement Learning 6

Complete Agent Temporally situated Continual learning and planning Object is to affect the environment Environment is stochastic and uncertain Environment state action reward Agent Reinforcement Learning 7

Reinforcement Learning 8 Elements of RL Policy: what to do Reward: what is good Value: what is good because it predicts reward Model: what follows what Policy Reward Value Model of environment

Reinforcement Learning 9 An Extended Example: Tic-Tac-Toe X X X X X X O X X O X O X O X O X O X O X O X O O O O X x o x x........................... o x x o x } x s move } o s move } x s move } o s move Assume an imperfect opponent: he/she sometimes makes mistakes } x s move x o x x o

.................. An RL Approach to Tic-Tac-Toe 1. Make a table with one entry per state: State V(s) estimated probability of winning.5? x.5? x x x o o 1 win 2. Now play lots of games. To pick our moves, look ahead one step: x o o x o o x o o x x x o o 0 loss 0 draw * current state various possible next states Just pick the next state with the highest estimated prob. of winning the largest V(s); a greedy move. But 10% of the time pick a move at random; an exploratory move. Reinforcement Learning 10

RL Learning Rule for Tic-Tac-Toe Exploratory move s s the the state state before our greedy move after our greedy move We increment eachv( s )toward V( s ) a backup : V( s ) V( s ) + α [ V( s ) V( s )] a small positive fraction,e.g., α =. 1 the step - size parameter Reinforcement Learning 11

How can we improve this T.T.T. player? Take advantage of symmetries representation/generalization How might this backfire? Do we need random moves? Why? Do we always need a full 10%? Can we learn from random moves? Can we learn offline? Pre-training from self play? Using learned models of opponent?... Reinforcement Learning 12

Reinforcement Learning 13 e.g. Generalization Table Generalizing Function Approximator State V State V s s s... 1 2 3 Train here s N

How is Tic-Tac-Toe Too Easy? Finite, small number of states One-step look-ahead is always possible State completely observable Reinforcement Learning 14

Some Notable RL Applications TD-Gammon: Tesauro world s best backgammon program Elevator Control: Crites & Barto high performance down-peak elevator controller Dynamic Channel Assignment: Singh & Bertsekas, Nie & Haykin high performance assignment of radio channels to mobile telephone calls Reinforcement Learning 15

Reinforcement Learning 16 TD-Gammon Tesauro, 1992 1995 Value Action selection by 2 3 ply search Effective branching factor 400 TD error V t+1 V t Start with a random network Play very many games against self Learn a value function from this simulated experience This produces arguably the best player in the world

Reinforcement Learning 17 10 floors, 4 elevator cars Elevator Dispatching Crites and Barto, 1996 STATES: button states; positions, directions, and motion states of cars; passengers in cars & in halls ACTIONS: stop at, or go by, next floor REWARDS: roughly, 1 per time step for each person waiting 22 Conservatively about 10 states

Performance Comparison Reinforcement Learning 18

Reinforcement Learning 19 Evaluative Feedback Evaluating actions vs. instructing by giving correct actions Pure evaluative feedback depends totally on the action taken. Pure instructive feedback depends not at all on the action taken. Supervised learning is instructive; optimization is evaluative Associative vs. Nonassociative: Associative: inputs mapped to outputs; learn the best output for each input Nonassociative: learn (find) one best output n-armed bandit (at least how we treat it) is: Nonassociative Evaluative feedback

Reinforcement Learning 20 The n-armed Bandit Problem Choose repeatedly from one of n actions; each choice is called a play After each play, you get a reward, where E a t rt at = Q * ( a These are unknown action values Distribution of depends only on Objective is to maximize the reward in the long term, e.g., over 1000 plays To solve the n-armed bandit problem, you must explore a variety of actions and then exploit the best of them. r t t ) r t a t

The Exploration/Exploitation Dilemma Suppose you form estimates Q t (a) Q * (a) The greedy action at t is action value estimates a t* = argmax a Q t (a) a t = a t * exploitation a t a t* exploration You can t exploit all the time; you can t explore all the time You can never stop exploring; but you should always reduce exploring Reinforcement Learning 21

Reinforcement Learning 22 Action-Value Methods Methods that adapt action-value estimates and nothing else, e.g.: suppose by the t-th play, action a had been chosen k a times, producing rewards r 1,r 2, K, then rk a, Q t ( a ) = r 1 + r 2 + L+ k a r k a sample average lim Q t( a ) = k a * Q ( a )

Reinforcement Learning 23 ε-greedy Action Selection Greedy action selection: * at = at = arg maxq ( a t a ) ε-greedy: a t = { a * t with probability 1 ε random action with probability ε... the simplest way to try to balance exploration and exploitation

Reinforcement Learning 24 10-Armed Testbed n = 10 possible actions Each Q * ( a ) is chosen randomly from a normal distribution: N( 0, 1) r t each is also normal: 1000 plays N( Q * ), 1) repeat the whole thing 2000 times and average the results Evaluative versus instructive feedback ( a t

ε-greedy Methods on the 10-Armed Testbed Average reward 1.5 1 0.5 = 0.1 = 0.01 0 0 250 500 750 1000 Plays 100% 80% = 0.1 % Optimal action 60% 40% 20% = 0 (greedy) = 0.01 0% 0 250 500 750 1000 Plays Reinforcement Learning 25

Softmax Action Selection Softmax action selection methods grade action probs. by estimated values. The most common softmax uses a Gibbs, or Boltzmann, distribution: Choose action a on play t with probability e n b =1 Q ( a ) τ t e Q ( b ) t τ, where τ is the computational temperature Reinforcement Learning 26

Evaluation Versus Instruction Suppose there are K possible actions and you select action number k. Evaluative feedback would give you a single score f, say 7.2. Instructive information, on the other hand, would say that action k, which is eventually different from action k, have actually been correct. Obviously, instructive feedback is much more informative, (even if it is noisy). Reinforcement Learning 27

Binary Bandit Tasks Suppose you have just two actions: a t = 1 or a t = 2 and just two rewards: r t = success or r t = failure Then you might infer a target or desired action: d t = { a t if success the other action if failure and then always play the action that was most often the target Call this the supervised algorithm. It works fine on deterministic tasks but is suboptimal if the rewards are stochastic. Reinforcement Learning 28

Reinforcement Learning 29 Contingency Space The space of all possible binary bandit tasks:

Reinforcement Learning 30 Linear Learning Automata Let π t (a) = Pr{ a t = a} be the only adapted parameter L R I (Linear, reward - inaction) On success : π t +1 (a t ) = π t (a t ) + α (1 π t (a t )) 0 < α <1 (the other action probs. are adjusted to still sum to 1) On failure : no change L R-P (Linear, reward - penalty) On success : π t +1 (a t ) = π t (a t ) + α (1 π t (a t )) 0 < α <1 (the other action probs. are adjusted to still sum to 1) On failure : π t +1 (a t ) = π t (a t ) + α (0 π t (a t )) 0 < α <1 For two actions, a stochastic, incremental version of the supervised algorithm

Performance on Binary Bandit Tasks A and B Reinforcement Learning 31

Reinforcement Learning 32 Incremental Implementation Recall the sample average estimation method: The average of the first k rewards is (dropping the dependence on ): a Q k = r 1 + r 2 +Lr k k Can we do this incrementally (without storing all the rewards)? We could keep a running sum and count, or, equivalently: Q 1 k + 1 k + 1 = Qk + k + 1 [ r Q ] This is a common form for update rules: NewEstimate = OldEstimate + StepSize[Target OldEstimate] k

Reinforcement Learning 33 Computation Q k+ 1 1 = k + 1 k + 1 i= 1 r 1 = r + k i k+ 1 i + 1 i= 1 k r 1 = ( r ) k+ 1 + kqk + Qk Qk k + 1 1 = Q [ ] k + rk+ 1 Qk k + 1 Stepsize constant or changing with time

Reinforcement Learning 34 Tracking a Nonstationary Problem Choosing Q k to be a sample average is appropriate in a stationary problem, i.e., when none of the Q * (a) change over time, But not in a nonstationary problem. Better in the nonstationary case is: Q k +1 = Q k +α[ r k +1 Q k ] for constant α, 0< α 1 = (1 α) k Q 0 + α(1 α) k i r i k i =1 exponential, recency-weighted average

Reinforcement Learning 35 Computation Use Q = Q + α[ r Q ] k+ 1 k k+ 1 k Then Q = Q + α[ r Q ] k k 1 k k 1 = αr + (1 α) Q k 1 = αr + (1 α) αr + (1 α) Q 2 k k 1 k 2 k = (1 α) Q + α(1 α) 0 i= 1 In general : convergence if satisfied for α k k 2 αk( a) and αk( a) k= 1 k= 1 1 = but not for fixed α k k k i = < r i Notes: 1. k i= 1 α( 1 α ) k i = 1 2. Step size parameter after the k-th application of action a

Reinforcement Learning 36 Optimistic Initial Values All methods so far depend on Q 0 ( a ), i.e., they are biased. Suppose instead we initialize the action values optimistically, i.e., on the 10-armed testbed, use Q ( a ) 5 for all a. 0 = Optimistic initialization can force exploration behavior!

Reinforcement Learning 37 The Agent-Environment Interface Agent and environment interact at discrete time steps : Agent observes state at step t : produces action at step t gets resulting reward : and resulting next state : : t t+ 1 R r s a t+ 1 s t A( s S t ) t = 012,,, K... r s t +1 r t s t +2 a t +1 s t a t +2 t +1 a r t +3 s... t +3 t +2 a t +3

Reinforcement Learning 38 The Agent Learns a Policy Policy at step t, π : a mapping from states to action probabilities π ( s,a ) = probability that t t a t = a when s t = s Reinforcement learning methods specify how the agent changes its policy as a result of experience. Roughly, the agent s goal is to get as much reward as it can over the long run.

Getting the Degree of Abstraction Right Time steps need not refer to fixed intervals of real time. Actions can be low level (e.g., voltages to motors), or high level (e.g., accept a job offer), mental (e.g., shift in focus of attention), etc. States can low-level sensations, or they can be abstract, symbolic, based on memory, or subjective (e.g., the state of being surprised or lost ). An RL agent is not like a whole animal or robot, which consist of many RL agents as well as other components. The environment is not necessarily unknown to the agent, only incompletely controllable. Reward computation is in the agent s environment because the agent cannot change it arbitrarily. Reinforcement Learning 39

Goals and Rewards Is a scalar reward signal an adequate notion of a goal? maybe not, but it is surprisingly flexible. A goal should specify what we want to achieve, not how we want to achieve it. A goal must be outside the agent s direct control thus outside the agent. The agent must be able to measure success: explicitly; frequently during its lifespan. Reinforcement Learning 40

Returns Suppose the sequence of rewards after step t is : r t +1, r t+ 2, r t + 3, K What do we want to maximize? In general, we want to maximize the expected return, E{ R t }, for each step t. Episodic tasks: interaction breaks naturally into episodes, e.g., plays of a game, trips through a maze. R t = r t +1 + r t +2 +L + r T, where T is a final time step at which a terminal state is reached, ending an episode. Reinforcement Learning 41

Reinforcement Learning 42 Returns for Continuing Tasks Continuing tasks: interaction does not have natural episodes. Discounted return: k =0 R t = r t +1 +γ r t+ 2 + γ 2 r t +3 +L = γ k r t + k +1, where γ,0 γ 1, is the discount rate. shortsighted 0 γ 1 farsighted

Reinforcement Learning 43 An Example Avoid failure: the pole falling beyond a critical angle or the cart hitting end of track. As an episodic task where episode ends upon failure: reward = +1 for each step before failure return = number of steps before failure As a continuing task with discounted return: reward = 1 upon failure; 0 otherwise return = γ k, for k steps before failure In either case, return is maximized by avoiding failure for as long as possible.

Reinforcement Learning 44 Another Example Get to the top of the hill as quickly as possible. reward = 1 for each step where not at top of hill return = number of steps before reaching top of hill Return is maximized by minimizing number of steps reach the top of the hill.

A Unified Notation In episodic tasks, we number the time steps of each episode starting from zero. We usually do not have distinguish between episodes, so we write s t instead of s t, j for the state at step t of episode j. Think of each episode as ending in an absorbing state that always produces reward of zero: We can cover all cases by writing k t = γ rt + k + 1, k = 0 where γ can be 1 only if a zero reward absorbing state is always reached. Reinforcement Learning 45 R

Reinforcement Learning 46 The Markov Property By the state at step t, the book means whatever information is available to the agent at step t about its environment. The state can include immediate sensations, highly processed sensations, and structures built up over time from sequences of sensations. Ideally, a state should summarize past sensations so as to retain all essential information, i.e., it should have the Markov Property: Pr { s } t s + 1 =,r t+ 1 = r st,a t,r t,s t 1,at 1, K,r1,s0,a0 = Pr{ s = s,r = r s,a } for all s, r, and histories s t, a t, s t-1, a t-1,, r 1, s 0, a 0. t + 1 t + 1 t t

Markov Decision Processes If a reinforcement learning task has the Markov Property, it is basically a Markov Decision Process (MDP). If state and action sets are finite, it is a finite MDP. To define a finite MDP, you need to give: state and action sets one-step dynamics defined by transition probabilities: P s s a = Pr s t +1 = s s t = s,a t = a reward probabilities: a R s { } for all s, { } for all s, = Er t +1 s t = s,a t = a,s t +1 = s s S, a A(s). s S, a A(s). Reinforcement Learning 47

An Example Finite MDP Recycling Robot At each step, robot has to decide whether it should (1) actively search for a can, (2) wait for someone to bring it a can, or (3) go to home base and recharge. Searching is better but runs down the battery; if runs out of power while searching, has to be rescued (which is bad). Decisions made on basis of current energy level: high, low. Reward = number of cans collected Reinforcement Learning 48

Reinforcement Learning 49 Recycling Robot MDP S = A( low { high, low} ) = { search, wait} ) = { search, wait, recharge} A( high R R search wait = expected no.of cans while searching = expected no.of cans while waiting R search > R wait 1, R wait wait 1 β, 3 search β, R search high 1, 0 recharge low search wait α, R search 1 α, R search 1, R wait

Transition Table Reinforcement Learning 50

Reinforcement Learning 51 Value Functions The value of a state is the expected return starting from that state; depends on the agent s policy: State - value function for policy π : V π (s) = E { π R t s t = s}= E π γ k r t +k +1 s t = s k =0 The value of taking an action in a state under policy π is the expected return starting from that state, taking that action, and thereafter following π : Action - value function for policy π : Q π (s, a) = E { π R t s t = s, a t = a}= E π γ k r t + k +1 s t = s,a t = a k = 0

Reinforcement Learning 52 Bellman Equation for a Policy π The basic idea: R t = r t +1 + γ r t +2 +γ 2 r t + 3 +γ 3 r t + 4 L = r t +1 + γ( r t +2 + γ r t +3 + γ 2 r t + 4 L) = r t +1 + γ R t +1 So: V π (s) = E π R t s t = s { } { } = E π r t +1 + γ Vs ( t +1 )s t = s Or, without the expectation operator: V π (s) = π(s,a) P s s a s a [ + γ V π ( s )] a R s s

Reinforcement Learning 53

Reinforcement Learning 54 More on the Bellman Equation V π (s) = π(s,a) P s s a s a [ + γ V π ( s )] This is a set of equations (in fact, linear), one for each state The value function for π is its unique solution. Backup diagrams: a R s s (a) s (b) s,a a r s' r s' a' for V π for Q π

Gridworld Actions: north, south, east, west; deterministic. If would take agent off the grid: no move but reward = 1 Other actions produce reward = 0, except actions that move agent out of special states A and B as shown. State-value function for equiprobable random policy; γ = 0.9 Reinforcement Learning 55

Reinforcement Learning 56 Golf State is ball location Reward of 1 for each stroke until the ball is in the hole Value of a state? Actions: putt (use putter) driver (use driver) putt succeeds anywhere on the green

Reinforcement Learning 57 Optimal Value Functions For finite MDPs, policies can be partially ordered: π π if and only if V π (s) V π (s) for all s S There is always at least one (and possibly many) policies that is better than or equal to all the others. This is an optimal policy. We denote them all π *. Optimal policies share the same optimal state-value function: V (s) = maxv π (s) for all s S π Optimal policies also share the same optimal actionvalue function: Q (s,a) = maxq π (s, a) for all s S and a A(s) π This is the expected return for taking action a in state s and thereafter following an optimal policy.

Optimal Value Function for Golf We can hit the ball farther with driver than with putter, but with less accuracy Q*(s,driver) gives the value or using driver first, then using whichever actions are best Reinforcement Learning 58

Reinforcement Learning 59 Bellman Optimality Equation for V* The value of a state under an optimal policy must equal the expected return for the best action from that state: V (s) = max Q π (s,a) a A(s) = max Er { t +1 + γ V (s t +1 ) s t = s, a t = a} a A(s) = max a A(s) P a s R a s s s s [ + γ V ( s )] The relevant backup diagram: (a) max s a r s' V is the unique solution of this system of nonlinear equations.

Reinforcement Learning 60 Bellman Optimality Equation for Q* Q (s,a) = E r = { } + maxq (s,a )s = s,a = a s t+ 1 P a ss γ t+ 1 a [ ] a R + γ maxq (s,a ) ss a t t The relevant backup diagram: (b) s,a r s' max a' * Q is the unique solution of this system of nonlinear equations.

Reinforcement Learning 61 Why Optimal State-Value Functions are Useful Any policy that is greedy with respect to V is an optimal policy. Therefore, given V, one-step-ahead search produces the long-term optimal actions. E.g., back to the gridworld:

Reinforcement Learning 62 What About Optimal Action-Value Functions? Given Q *, the agent does not even have to do a one-step-ahead search: π (s) = arg max a A(s) Q (s,a)

Solving the Bellman Optimality Equation Finding an optimal policy by solving the Bellman Optimality Equation requires the following: accurate knowledge of environment dynamics; we have enough space an time to do the computation; the Markov Property. How much space and time do we need? polynomial in number of states (via dynamic programming methods; Chapter 4), BUT, number of states is often huge (e.g., backgammon has about 10**20 states). We usually have to settle for approximations. Many RL methods can be understood as approximately solving the Bellman Optimality Equation. Reinforcement Learning 63

Summary Agent-environment interaction States Actions Rewards Policy: stochastic rule for selecting actions Return: the function of future rewards agent tries to maximize Episodic and continuing tasks Markov Property Markov Decision Process Transition probabilities Expected rewards Value functions State-value function for a policy Action-value function for a policy Optimal state-value function Optimal action-value function Optimal value functions Optimal policies Bellman Equations The need for approximation Reinforcement Learning 64