Reinforcement Learning (1)

Slides:



Advertisements
Similar presentations
Reinforcement Learning
Advertisements

RL - Worksheet -worked exercise- Ata Kaban School of Computer Science University of Birmingham.
Markov Decision Process
Reinforcement Learning (II.) Exercise Solutions Ata Kaban School of Computer Science University of Birmingham 2003.
Worksheet I. Exercise Solutions Ata Kaban School of Computer Science University of Birmingham.
Decision Theoretic Planning
1 Reinforcement Learning Introduction & Passive Learning Alan Fern * Based in part on slides by Daniel Weld.
Markov Decision Processes
Planning under Uncertainty
Lehrstuhl für Informatik 2 Gabriella Kókai: Maschine Learning Reinforcement Learning.
Università di Milano-Bicocca Laurea Magistrale in Informatica Corso di APPRENDIMENTO E APPROSSIMAZIONE Lezione 6 - Reinforcement Learning Prof. Giancarlo.
Reinforcement Learning Tutorial
Reinforcement Learning
Reinforcement Learning
Reinforcement Learning Mitchell, Ch. 13 (see also Barto & Sutton book on-line)
1 Hybrid Agent-Based Modeling: Architectures,Analyses and Applications (Stage One) Li, Hailin.
1 Kunstmatige Intelligentie / RuG KI Reinforcement Learning Johan Everts.
Reinforcement Learning (2) Bob Durrant School of Computer Science University of Birmingham (Slides: Dr Ata Kabán)
1 Machine Learning: Symbol-based 9d 9.0Introduction 9.1A Framework for Symbol-based Learning 9.2Version Space Search 9.3The ID3 Decision Tree Induction.
Reinforcement Learning: Learning algorithms Yishay Mansour Tel-Aviv University.
Reinforcement Learning Yishay Mansour Tel-Aviv University.
Making Decisions CSE 592 Winter 2003 Henry Kautz.
Kunstmatige Intelligentie / RuG KI Reinforcement Learning Sander van Dijk.
CS Reinforcement Learning1 Reinforcement Learning Variation on Supervised Learning Exact target outputs are not given Some variation of reward is.
Utility Theory & MDPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart.
Machine Learning Chapter 13. Reinforcement Learning
Reinforcement Learning
General Polynomial Time Algorithm for Near-Optimal Reinforcement Learning Duke University Machine Learning Group Discussion Leader: Kai Ni June 17, 2005.
Reinforcement Learning (II.) Exercise Solutions Ata Kaban School of Computer Science University of Birmingham.
1 ECE-517 Reinforcement Learning in Artificial Intelligence Lecture 7: Finite Horizon MDPs, Dynamic Programming Dr. Itamar Arel College of Engineering.
Reinforcement Learning
Reinforcement Learning 主講人:虞台文 Content Introduction Main Elements Markov Decision Process (MDP) Value Functions.
Reinforcement Learning Ata Kaban School of Computer Science University of Birmingham.
© D. Weld and D. Fox 1 Reinforcement Learning CSE 473.
Decision Making Under Uncertainty Lec #8: Reinforcement Learning UIUC CS 598: Section EA Professor: Eyal Amir Spring Semester 2006 Most slides by Jeremy.
Reinforcement Learning Yishay Mansour Tel-Aviv University.
Kansas State University Department of Computing and Information Sciences CIS 732: Machine Learning and Pattern Recognition Thursday 29 October 2002 William.
Reinforcement Learning 主講人:虞台文 大同大學資工所 智慧型多媒體研究室.
MDPs (cont) & Reinforcement Learning
Reinforcement Learning
Reinforcement Learning Based on slides by Avi Pfeffer and David Parkes.
Reinforcement Learning: Learning algorithms Yishay Mansour Tel-Aviv University.
Possible actions: up, down, right, left Rewards: – 0.04 if non-terminal state Environment is observable (i.e., agent knows where it is) MDP = “Markov Decision.
Markov Decision Processes AIMA: 17.1, 17.2 (excluding ), 17.3.
Reinforcement Learning Guest Lecturer: Chengxiang Zhai Machine Learning December 6, 2001.
CS 188: Artificial Intelligence Spring 2007 Lecture 21:Reinforcement Learning: II MDP 4/12/2007 Srini Narayanan – ICSI and UC Berkeley.
Reinforcement Learning. Overview Supervised Learning: Immediate feedback (labels provided for every input). Unsupervised Learning: No feedback (no labels.
REINFORCEMENT LEARNING Unsupervised learning 1. 2 So far ….  Supervised machine learning: given a set of annotated istances and a set of categories,
Reinforcement Learning  Basic idea:  Receive feedback in the form of rewards  Agent’s utility is defined by the reward function  Must learn to act.
1 Markov Decision Processes Finite Horizon Problems Alan Fern * * Based in part on slides by Craig Boutilier and Daniel Weld.
Università di Milano-Bicocca Laurea Magistrale in Informatica Corso di APPRENDIMENTO AUTOMATICO Lezione 12 - Reinforcement Learning Prof. Giancarlo Mauri.
CS 5751 Machine Learning Chapter 13 Reinforcement Learning1 Reinforcement Learning Control learning Control polices that choose optimal actions Q learning.
1 Passive Reinforcement Learning Ruti Glick Bar-Ilan university.
Reinforcement Learning
Reinforcement Learning
Reinforcement learning (Chapter 21)
Markov Decision Processes
Planning to Maximize Reward: Markov Decision Processes
Announcements Homework 3 due today (grace period through Friday)
Chapter 3: The Reinforcement Learning Problem
Instructors: Fei Fang (This Lecture) and Dave Touretzky
CS 188: Artificial Intelligence Fall 2007
Chapter 3: The Reinforcement Learning Problem
Reinforcement Learning
Reinforcement Learning
Chapter 3: The Reinforcement Learning Problem
CS 188: Artificial Intelligence Spring 2006
Introduction to Reinforcement Learning and Q-Learning
Markov Decision Processes
Markov Decision Processes
Presentation transcript:

Reinforcement Learning (1) Bob Durrant School of Computer Science University of Birmingham (Slides: Dr Ata Kabán)

Reinforcement Learning (1) Learning by reinforcement State-action rewards Markov Decision Process Policies and Value functions Q-learning

Learning by reinforcement Examples: Learning to play Backgammon Robot learning to dock on battery charger Characteristics: No direct training examples – delayed rewards instead Need for exploration & exploitation The environment is stochastic and unknown The actions of the learner affect future rewards

Reinforcement Learning Supervised Learning Reinforcement Learning

Brief history & successes Minsky’s PhD thesis (1954): Stochastic Neural-Analog Reinforcement Computer Analogies with animal learning and psychology TD-Gammon (Tesauro, 1992) – big success story Job-shop scheduling for NASA space missions (Zhang and Dietterich, 1997) Robotic soccer (Stone and Veloso, 1998) – part of the world-champion approach ‘An approximate solution to a complex problem can be better than a perfect solution to a simplified problem’

The RL problem States Actions Immediate rewards Eventual reward Discount factor from any starting state

Markov Decision Process (MDP) MDP is a formal model of the RL problem At each discrete time point Agent observes state st and chooses action at Receives reward rt from the environment and the state changes to st+1 Markov assumption: rt=r(st,at) st+1=(st,at) i.e. rt and st+1 depend only on the current state and action In general, the functions r and  may not be deterministic and are not necessarily known to the agent

Agent’s Learning Task Execute actions in environment, observe results and Learn action policy that maximises from any starting state in S. Here is the discount factor for future rewards Note: Target function is There are no training examples of the form (s,a) but only of the form ((s,a),r)

Example: TD-Gammon Immediate reward: +100 if win -100 if lose 0 for all other states Trained by playing 1.5 million games against itself Now approximately equal to the best human player

Example: Mountain-Car States: position and velocity Actions: accelerate forward, accelerate backward, coast Rewards Reward=-1for every step, until the car reaches the top Reward=1 at the top, 0 otherwise, <1 The eventual reward will be maximised by minimising the number of steps to the top of the hill

Value function We will consider deterministic worlds first Given a policy (adopted by the agent), define an evaluation function over states: Property:

Example Grid world environment Six possible states Arrows represent possible actions G: goal state One optimal policy – denoted * What is the best thing to do when in each state? Compute the values of the states for this policy – denoted V*

Restated, the task is to learn the optimal policy r(s,a) (immediate reward) values: V*(s) values, with =0.9 one optimal policy: V*(s6) = 100 + 0.9*0 = 100 V*(s5) = 0 + 0.9*100 = 90 V*(s4) = 0 + 0.9*90 = 81 Restated, the task is to learn the optimal policy

The task, revisited We might try to have the agent learn the evaluation function V* It could then do a look ahead search to chose the best action from any state using … yes, if we knew both the transition function  and the reward function r. In general these are unknown to the agent, so it cannot choose actions this way  BUT: there is a way to do it!! 

Q function Define a new function very similar to V* What difference does this make? If the agent learns Q, then it can choose the optimal actions even without knowing  Let us see how.

Rewrite things replacing this new definition: Now, let denote the agent’s current approximation to Q. Consider the iterative update rule. Under some assumptions (<s,a> visited infinitely often), this will converge to the true Q:

Q Learning algorithm (in deterministic worlds) For each (s,a) initialise table entry Observe current state s Do forever: Select an action a and execute it Receive immediate reward r Observe new state s’ Update table entry as follows: s:=s’

Example updating Q given the Q values from a previous iteration on the arrows

Sketch of the convergence proof of Q-learning Consider the case of deterministic world, where each (s,a) is visited infinitely often. Define a full interval as an interval during which each (s,a) is visited. It can be easily shown, that during any such interval, the absolute value of the largest error in table is reduced by a factor of . Consequently, as <1, then after infinitely many updates, the largest error converges to zero. Go through the details from [Mitchell, sec. 13.3,6.]

An Observation As a consequence of the convergence proof, Q-learning need not train on optimal action sequences in order to converge to the optimal policy. It can learn the Q function (and hence the optimal policy) while training from actions chosen at random as long as the resulting training sequence visits every ordered (state, action) pair infinitely often.

Exploration versus Exploitation The Q-learning algorithm doesn’t say how we could choose an action If we choose an action that maximises our estimate of Q we could end up not exploring better alternatives To converge on the true Q values we must favour higher estimated Q values but still have a chance of choosing worse estimated Q values for exploration (see the convergence proof of the Q-learning algorithm in [Mitchell, sec. 13.3.4.]). An action selection function of the following form may employed, where k>0:

Nondeterministic case What if the reward and the state transition are not deterministic? – e.g. in Backgammon learning and playing depends on rolls of dice! Then V and Q need to be redefined using their expected values: Similar reasoning and convergent update iteration will apply Will continue next week.

Summary Reinforcement learning is suitable for learning in uncertain environments where rewards may be delayed and subject to chance The goal of a reinforcement learning program is to maximise the eventual reward Q-learning is a form of reinforcement learning that doesn’t require that the learner has prior knowledge of how its actions affect the environment