Utility Theory & MDPs Tamara Berg CS 590-133 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart.

Slides:



Advertisements
Similar presentations
Markov Decision Processes (MDPs) read Ch utility-based agents –goals encoded in utility function U(s), or U:S  effects of actions encoded in.
Advertisements

Markov Decision Process
Value Iteration & Q-learning CS 5368 Song Cui. Outline Recap Value Iteration Q-learning.
Announcements  Homework 3: Games  Due tonight at 11:59pm.  Project 2: Multi-Agent Pacman  Has been released, due Friday 2/21 at 5:00pm.  Optional.
Decision Theoretic Planning
Games Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
MDP Presentation CS594 Automated Optimal Decision Making Sohail M Yousof Advanced Artificial Intelligence.
1 Reinforcement Learning Introduction & Passive Learning Alan Fern * Based in part on slides by Daniel Weld.
Markov Decision Processes
Planning under Uncertainty
Announcements Homework 3: Games Project 2: Multi-Agent Pacman
91.420/543: Artificial Intelligence UMass Lowell CS – Fall 2010
91.420/543: Artificial Intelligence UMass Lowell CS – Fall 2010 Lecture 16: MEU / Utilities Oct 8, 2010 A subset of Lecture 8 slides of Dan Klein – UC.
KI Kunstmatige Intelligentie / RuG Markov Decision Processes AIMA, Chapter 17.
Planning in MDPs S&B: Sec 3.6; Ch. 4. Administrivia Reminder: Final project proposal due this Friday If you haven’t talked to me yet, you still have the.
CS 188: Artificial Intelligence Fall 2009 Lecture 10: MDPs 9/29/2009 Dan Klein – UC Berkeley Many slides over the course adapted from either Stuart Russell.
Department of Computer Science Undergraduate Events More
More RL. MDPs defined A Markov decision process (MDP), M, is a model of a stochastic, dynamic, controllable, rewarding process given by: M = 〈 S, A,T,R.
Instructor: Vincent Conitzer
MAKING COMPLEX DEClSlONS
Reinforcement Learning
Reinforcement Learning  Basic idea:  Receive feedback in the form of rewards  Agent’s utility is defined by the reward function  Must learn to act.
Reinforcement Learning Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart.
Utility Theory & MDPs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell,
Games Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
Computer Science CPSC 502 Lecture 14 Markov Decision Processes (Ch. 9, up to 9.5.3)
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
Quiz 6: Utility Theory  Simulated Annealing only applies to continuous f(). False  Simulated Annealing only applies to differentiable f(). False  The.
CS 188: Artificial Intelligence Spring 2007 Lecture 21:Reinforcement Learning: I Utilities and Simple decisions 4/10/2007 Srini Narayanan – ICSI and UC.
MDPs (cont) & Reinforcement Learning
Decision Theoretic Planning. Decisions Under Uncertainty  Some areas of AI (e.g., planning) focus on decision making in domains where the environment.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
CPS 570: Artificial Intelligence Markov decision processes, POMDPs
Announcements  Upcoming due dates  Wednesday 11/4, 11:59pm Homework 8  Friday 10/30, 5pm Project 3  Watch out for Daylight Savings and UTC.
CSE 473Markov Decision Processes Dan Weld Many slides from Chris Bishop, Mausam, Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer.
Department of Computer Science Undergraduate Events More
MDPs and Reinforcement Learning. Overview MDPs Reinforcement learning.
Comparison Value vs Policy iteration
Department of Computer Science Undergraduate Events More
QUIZ!!  T/F: Optimal policies can be defined from an optimal Value function. TRUE  T/F: “Pick the MEU action first, then follow optimal policy” is optimal.
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.
CS 188: Artificial Intelligence Spring 2007 Lecture 21:Reinforcement Learning: II MDP 4/12/2007 Srini Narayanan – ICSI and UC Berkeley.
Announcements  Homework 3: Games  Due tonight at 11:59pm.  Project 2: Multi-Agent Pacman  Has been released, due Friday 2/19 at 5:00pm.  Optional.
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 Passive Reinforcement Learning Ruti Glick Bar-Ilan university.
CS 188: Artificial Intelligence Fall 2008 Lecture 8: MEU / Utilities 9/23/2008 Dan Klein – UC Berkeley Many slides over the course adapted from either.
Markov Decision Process (MDP)
Announcements Grader office hours posted on course website
Markov Decision Processes II
Making complex decisions
Markov Decision Processes
CS 188: Artificial Intelligence
CAP 5636 – Advanced Artificial Intelligence
Quiz 6: Utility Theory Simulated Annealing only applies to continuous f(). False Simulated Annealing only applies to differentiable f(). False The 4 other.
CS 188: Artificial Intelligence Fall 2007
CS 188: Artificial Intelligence Fall 2008
CS 188: Artificial Intelligence Fall 2008
13. Acting under Uncertainty Wolfram Burgard and Bernhard Nebel
CS 188: Artificial Intelligence Fall 2007
Chapter 17 – Making Complex Decisions
CS 188: Artificial Intelligence Spring 2006
CS 188: Artificial Intelligence Spring 2006
CS 188: Artificial Intelligence Fall 2007
CS 416 Artificial Intelligence
Announcements Homework 2 Project 2 Mini-contest 1 (optional)
Warm-up as You Walk In Given Set actions (persistent/static)
CS 416 Artificial Intelligence
Markov Decision Processes
Markov Decision Processes
Presentation transcript:

Utility Theory & MDPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore, Percy Liang, Luke Zettlemoyer

Announcements An edited version of HW2 was released on the class webpage today –Due date is extended to Feb 25 (but make sure to start before the exam!) As always, you can work in pairs and submit 1 written/coding solution (pairs don’t need to be the same as HW1)

Review from last class

A more abstract game tree Terminal utilities (for MAX) A two-ply game

A more abstract game tree Minimax value of a node: the utility (for MAX) of being in the corresponding state, assuming perfect play on both sides Minimax strategy: Choose the move that gives the best worst-case payoff 322 3

Computing the minimax value of a node Minimax(node) =  Utility(node) if node is terminal  max action Minimax(Succ(node, action)) if player = MAX  min action Minimax(Succ(node, action)) if player = MIN 322 3

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree 3 33

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree 3 33 22

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree 3 33 22  14

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree 3 33 22 55

Alpha-beta pruning It is possible to compute the exact minimax decision without expanding every node in the game tree 3 3 22 2

Games of chance How to incorporate dice throwing into the game tree?

Games of chance

Why MEU?

Human Utilities How much do people value their lives? –How much would you pay to avoid a risk, e.g. Russian roulette with a million-barreled revolver (1 micromort)? –Driving in a car for 230 miles incurs a risk of 1 micromort.

Measuring Utilities Worst possible catastrophe Best possible prize

Stochastic, sequential environments (Chapter 17) Image credit: P. Abbeel and D. Klein Markov Decision Processes

Components: –States s, beginning with initial state s 0 –Actions a Each state s has actions A(s) available from it –Transition model P(s’ | s, a) Markov assumption: the probability of going to s’ from s depends only on s and a and not on any other past actions or states –Reward function R(s) Policy  (s): the action that an agent takes in any given state –The “solution” to an MDP

Overview First, we will look at how to “solve” MDPs, or find the optimal policy when the transition model and the reward function are known Second, we will consider reinforcement learning, where we don’t know the rules of the environment or the consequences of our actions

Game show A series of questions with increasing level of difficulty and increasing payoff Decision: at each step, take your earnings and quit, or go for the next question –If you answer wrong, you lose everything Q1Q2Q3Q4 Correct Incorrect: $0 Correct Incorrect: $0 Quit: $100 Correct Incorrect: $0 Quit: $1,100 Correct: $61,100 Incorrect: $0 Quit: $11,100 $100 question $1,000 question $10,000 question $50,000 question

Game show Consider $50,000 question –Probability of guessing correctly: 1/10 –Quit or go for the question? What is the expected payoff for continuing? 0.1 * 61, * 0 = 6,110 What is the optimal decision? Q1Q2Q3Q4 Correct Incorrect: $0 Correct Incorrect: $0 Quit: $100 Correct Incorrect: $0 Quit: $1,100 Correct: $61,100 Incorrect: $0 Quit: $11,100 $100 question $1,000 question $10,000 question $50,000 question 9/103/41/2 1/10

Game show What should we do in Q3? –Payoff for quitting: $1,100 –Payoff for continuing: 0.5 * $11,100 = $5,550 What about Q2? –$100 for quitting vs. $4,162 for continuing What about Q1? Q1Q2Q3Q4 Correct Incorrect: $0 Correct Incorrect: $0 Quit: $100 Correct Incorrect: $0 Quit: $1,100 Correct: $61,100 Incorrect: $0 Quit: $11,100 $100 question $1,000 question $10,000 question $50,000 question 9/103/41/2 1/10 U = $11,100U = $5,550U = $4,162U = $3,746

Grid world R(s) = for every non-terminal state Transition model: Source: P. Abbeel and D. Klein

Goal: Policy Source: P. Abbeel and D. Klein

Grid world R(s) = for every non-terminal state Transition model:

Grid world Optimal policy when R(s) = for every non-terminal state

Grid world Optimal policies for other values of R(s):

Solving MDPs MDP components: –States s –Actions a –Transition model P(s’ | s, a) –Reward function R(s) The solution: –Policy  (s): mapping from states to actions –How to find the optimal policy?

Maximizing expected utility The optimal policy should maximize the expected utility over all possible state sequences produced by following that policy: How to define the utility of a state sequence? –Sum of rewards of individual states –Problem: infinite state sequences

Utilities of state sequences Normally, we would define the utility of a state sequence as the sum of the rewards of the individual states Problem: infinite state sequences Solution: discount the individual state rewards by a factor  between 0 and 1: –Sooner rewards count more than later rewards –Makes sure the total utility stays bounded –Helps algorithms converge

Utilities of states Expected utility obtained by policy  starting in state s: The “true” utility of a state, is the expected sum of discounted rewards if the agent executes an optimal policy starting in state s

Finding the utilities of states U(s’) Max node Chance node P(s’ | s, a) What is the expected utility of taking action a in state s? How do we choose the optimal action? What is the recursive expression for U(s) in terms of the utilities of its successor states?

The Bellman equation Recursive relationship between the utilities of successive states: End up here with P(s’ | s, a) Get utility U(s’) (discounted by  ) Receive reward R(s) Choose optimal action a

The Bellman equation Recursive relationship between the utilities of successive states: For N states, we get N equations in N unknowns –Solving them solves the MDP –We can solve them algebraically –Two methods: value iteration and policy iteration

Method 1: Value iteration Start out with every U(s) = 0 Iterate until convergence –During the i th iteration, update the utility of each state according to this rule: In the limit of infinitely many iterations, guaranteed to find the correct utility values –In practice, don’t need an infinite number of iterations…

Value iteration What effect does the update have? Value iteration demo

Values vs Policy Basic idea: approximations get refined towards optimal values Policy may converge long before values do

Method 2: Policy iteration Start with some initial policy  0 and alternate between the following steps: –Policy evaluation: calculate U  i (s) for every state s –Policy improvement: calculate a new policy  i+1 based on the updated utilities

Policy evaluation Given a fixed policy , calculate U  (s) for every state s The Bellman equation for the optimal policy: –How does it need to change if our policy is fixed? –Can solve a linear system to get all the utilities! –Alternatively, can apply the following update:

Looking ahead

Reinforcement Learning Components: –States s, beginning with initial state s 0 –Actions a Each state s has actions A(s) available from it –Transition model P(s’ | s, a) –Reward function R(s) Policy  (s): the action that an agent takes in any given state –The “solution” New twist: don’t know Transition model or Reward function ahead of time! –Have to actually try actions and states out to learn