Reinforcement Learning II: Q-learning

Similar documents
Reinforcement Learning by Comparing Immediate Reward

ISFA2008U_120 A SCHEDULING REINFORCEMENT LEARNING ALGORITHM

Exploration. CS : Deep Reinforcement Learning Sergey Levine

Introduction to Ensemble Learning Featuring Successes in the Netflix Prize Competition

Artificial Neural Networks written examination

Lecture 10: Reinforcement Learning

Python Machine Learning

Learning Optimal Dialogue Strategies: A Case Study of a Spoken Dialogue Agent for

ENME 605 Advanced Control Systems, Fall 2015 Department of Mechanical Engineering

(Sub)Gradient Descent

Discriminative Learning of Beam-Search Heuristics for Planning

TD(λ) and Q-Learning Based Ludo Players

Go fishing! Responsibility judgments when cooperation breaks down

Generative models and adversarial training

Machine Learning and Data Mining. Ensembles of Learners. Prof. Alexander Ihler

AMULTIAGENT system [1] can be defined as a group of

The Good Judgment Project: A large scale test of different methods of combining expert predictions

How People Learn Physics

Shockwheat. Statistics 1, Activity 1

Axiom 2013 Team Description Paper

Probabilistic Latent Semantic Analysis

High-level Reinforcement Learning in Strategy Games

Lecture 1: Machine Learning Basics

Cognitive Thinking Style Sample Report

The Evolution of Random Phenomena

12- A whirlwind tour of statistics

Regret-based Reward Elicitation for Markov Decision Processes

Lahore University of Management Sciences. FINN 321 Econometrics Fall Semester 2017

Speeding Up Reinforcement Learning with Behavior Transfer

Measurement. When Smaller Is Better. Activity:

Laboratorio di Intelligenza Artificiale e Robotica

System Implementation for SemEval-2017 Task 4 Subtask A Based on Interpolated Deep Neural Networks

Major Milestones, Team Activities, and Individual Deliverables

An OO Framework for building Intelligence and Learning properties in Software Agents

Assignment 1: Predicting Amazon Review Ratings

CS Machine Learning

Improving Conceptual Understanding of Physics with Technology

Genevieve L. Hartman, Ph.D.

Learning Structural Correspondences Across Different Linguistic Domains with Synchronous Neural Language Models

A Case Study: News Classification Based on Term Frequency

An Introduction to Simio for Beginners

Softprop: Softmax Neural Network Backpropagation Learning

Algebra 1, Quarter 3, Unit 3.1. Line of Best Fit. Overview

Improving Action Selection in MDP s via Knowledge Transfer

Entrepreneurial Discovery and the Demmert/Klein Experiment: Additional Evidence from Germany

Designing a Rubric to Assess the Modelling Phase of Student Design Projects in Upper Year Engineering Courses

Ryerson University Sociology SOC 483: Advanced Research and Statistics

The 9 th International Scientific Conference elearning and software for Education Bucharest, April 25-26, / X

BADM 641 (sec. 7D1) (on-line) Decision Analysis August 16 October 6, 2017 CRN: 83777

Learning Prospective Robot Behavior

Laboratorio di Intelligenza Artificiale e Robotica

A Model to Predict 24-Hour Urinary Creatinine Level Using Repeated Measurements

Evidence for Reliability, Validity and Learning Effectiveness

10.2. Behavior models

Self Study Report Computer Science

Probability and Game Theory Course Syllabus

Probability and Statistics Curriculum Pacing Guide

Challenges in Deep Reinforcement Learning. Sergey Levine UC Berkeley

Learning From the Past with Experiment Databases

CS 100: Principles of Computing

Learning Methods for Fuzzy Systems

Active Learning. Yingyu Liang Computer Sciences 760 Fall

Getting Started with Deliberate Practice

Meta-Cognitive Strategies

OPTIMIZATINON OF TRAINING SETS FOR HEBBIAN-LEARNING- BASED CLASSIFIERS

What to Do When Conflict Happens

Outline for Session III

Math 181, Calculus I

Testing A Moving Target: How Do We Test Machine Learning Systems? Peter Varhol Technology Strategy Research, USA

SIMPLY THE BEST! AND MINDSETS. (Growth or fixed?)

ECE-492 SENIOR ADVANCED DESIGN PROJECT

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

OCR for Arabic using SIFT Descriptors With Online Failure Prediction

IMGD Technical Game Development I: Iterative Development Techniques. by Robert W. Lindeman

Foothill College Summer 2016

Improving Fairness in Memory Scheduling

Learning Cases to Resolve Conflicts and Improve Group Behavior

Introduction to Simulation

Quantitative analysis with statistics (and ponies) (Some slides, pony-based examples from Blase Ur)

Penn State University - University Park MATH 140 Instructor Syllabus, Calculus with Analytic Geometry I Fall 2010

Lecture 2: Quantifiers and Approximation

Instructor: Matthew Wickes Kilgore Office: ES 310

Managerial Decision Making

Software Maintenance

Sociology 521: Social Statistics and Quantitative Methods I Spring 2013 Mondays 2 5pm Kap 305 Computer Lab. Course Website

Using focal point learning to improve human machine tacit coordination

Objective: Total Time. (60 minutes) (6 minutes) (6 minutes) starting at 0. , 8, 10 many fourths? S: 4 fourths. T: (Beneat , 2, 4, , 14 , 16 , 12

MGT/MGP/MGB 261: Investment Analysis

ACTL5103 Stochastic Modelling For Actuaries. Course Outline Semester 2, 2014

Grade 6: Correlated to AGS Basic Math Skills

Hentai High School A Game Guide

Mathematics Program Assessment Plan

A Reinforcement Learning Variant for Control Scheduling

Preparing a Research Proposal

Discovering Statistics

C O U R S E. Tools for Group Thinking

CS177 Python Programming

Navigating the PhD Options in CMS

9.85 Cognition in Infancy and Early Childhood. Lecture 7: Number

Learning and Transferring Relational Instance-Based Policies

Transcription:

1 Hal Daumé III (me@hal3.name) Reinforcement Learning II: Q-learning Hal Daumé III Computer Science University of Maryland me@hal3.name CS 421: Introduction to Artificial Intelligence 28 Feb 2012 Many slides courtesy of Dan Klein, Stuart Russell, or Andrew Moore

2 Hal Daumé III (me@hal3.name) Midcourse survey, quantitative

3 Hal Daumé III (me@hal3.name) Midcourse survey, qualitative (3) Too much class time on minutiae of homeworks (2) Project 1 not discussed much: made heuristics hard (2) More motivating examples (products or research) (2) Practice problems for exams, more HW examples (2) Reduce overall number of topics, or point toward important ones (2) Handin link should be at the top of the web page (1) Textbook too wordy with too few visuals (1) Talk about (dis)advantages of approaches in class (1) More time going over algos in class (1) Make sure exam stuff is on slides (1) Tweak homeworks toward readings

4 Hal Daumé III (me@hal3.name) Example: TD Policy Evaluation (1,1) up -1 (1,1) up -1 (1,2) up -1 (1,2) up -1 (1,2) up -1 (1,3) right -1 (1,3) right -1 (2,3) right -1 (2,3) right -1 (3,3) right -1 (3,3) right -1 (3,2) up -1 (3,2) up -1 (4,2) exit -100 (3,3) right -1 (done) (4,3) exit +100 (done) Take γ = 1, α = 0.5

5 Hal Daumé III (me@hal3.name) Problems with TD Value Learning TD value leaning is model-free for policy evaluation However, if we want to turn our value estimates into a policy, we re sunk: a s, a s s,a,s s Idea: learn Q-values directly Makes action selection model-free too!

6 Hal Daumé III (me@hal3.name) Active Learning Full reinforcement learning You don t know the transitions T(s,a,s ) You don t know the rewards R(s,a,s ) You can choose any actions you like Goal: learn the optimal policy (maybe values) In this case: Learner makes choices! Fundamental tradeoff: exploration vs. exploitation This is NOT offline planning!

7 Hal Daumé III (me@hal3.name) Model-Based Learning In general, want to learn the optimal policy, not evaluate a fixed policy Idea: adaptive dynamic programming Learn an initial model of the environment: Solve for the optimal policy for this model (value or policy iteration) Refine model through experience and repeat Crucial: we have to make sure we actually learn about all of the model

8 Hal Daumé III (me@hal3.name) Example: Greedy ADP Imagine we find the lower path to the good exit first Some states will never be visited following this policy from (1,1) We ll keep re-using this policy because following it never collects the regions of the model we need to learn the optimal policy??

9 Hal Daumé III (me@hal3.name) What Went Wrong? Problem with following optimal policy for current model: Never learn about better regions of the space if current policy neglects them?? Fundamental tradeoff: exploration vs. exploitation Exploration: must take actions with suboptimal estimates to discover new rewards and increase eventual utility Exploitation: once the true optimal policy is learned, exploration reduces utility Systems must explore in the beginning and exploit in the limit

10 Hal Daumé III (me@hal3.name) Q-Value Iteration Value iteration: find successive approx optimal values Start with V 0* (s) = 0, which we know is right (why?) Given V i*, calculate the values for all states for depth i+1: But Q-values are more useful! Start with Q 0* (s,a) = 0, which we know is right (why?) Given Q i*, calculate the q-values for all q-states for depth i+1:

11 Hal Daumé III (me@hal3.name) Q-Learning [DEMO Grid Q s] Learn Q*(s,a) values Receive a sample (s,a,s,r) Consider your old estimate: Consider your new sample estimate: Incorporate the new estimate into a running average:

12 Hal Daumé III (me@hal3.name) Q-Learning Properties [DEMO Grid Q s] Will converge to optimal policy If you explore enough If you make the learning rate small enough But not decrease it too quickly! Basically doesn t matter how you select actions (!) Neat property: learns optimal q-values regardless of action selection noise (some caveats) S E S E

13 Hal Daumé III (me@hal3.name) Exploration / Exploitation [DEMO RL Pacman] Several schemes for forcing exploration Simplest: random actions (ε greedy) Every time step, flip a coin With probability ε, act randomly With probability 1-ε, act according to current policy Problems with random actions? You do explore the space, but keep thrashing around once learning is done One solution: lower ε over time Another solution: exploration functions

14 Hal Daumé III (me@hal3.name) Exploration Functions When to explore Random actions: explore a fixed amount Better idea: explore areas whose badness is not (yet) established Exploration function Takes a value estimate and a count, and returns an optimistic utility, e.g. (exact form not important)

15 Hal Daumé III (me@hal3.name) Q-Learning [DEMO Crawler Q s] Q-learning produces tables of q-values:

16 Hal Daumé III (me@hal3.name) Q-Learning In realistic situations, we cannot possibly learn about every single state! Too many states to visit them all in training Too many states to hold the q-tables in memory Instead, we want to generalize: Learn about some small number of training states from experience Generalize that experience to new, similar states This is a fundamental idea in machine learning, and we ll see it over and over again

17 Hal Daumé III (me@hal3.name) Example: Pacman Let s say we discover through experience that this state is bad: In naïve q learning, we know nothing about this state or its q states: Or even this one!

18 Hal Daumé III (me@hal3.name) Feature-Based Representations Solution: describe a state using a vector of features Features are functions from states to real numbers (often 0/1) that capture important properties of the state Example features: Distance to closest ghost Distance to closest dot Number of ghosts 1 / (dist to dot) 2 Is Pacman in a tunnel? (0/1) etc. Can also describe a q-state (s, a) with features (e.g. action moves closer to food)

19 Hal Daumé III (me@hal3.name) Linear Feature Functions Using a feature representation, we can write a q function (or value function) for any state using a few weights: Advantage: our experience is summed up in a few powerful numbers Disadvantage: states may share features but be very different in value!

20 Hal Daumé III (me@hal3.name) Function Approximation Q-learning with linear q-functions: Intuitive interpretation: Adjust weights of active features E.g. if something unexpectedly bad happens, disprefer all states with that state s features Formal justification: online least squares

21 Hal Daumé III (me@hal3.name) Example: Q-Pacman

22 Hal Daumé III (me@hal3.name) Linear regression 40 26 24 20 22 20 0 0 10 20 30 20 10 0 0 10 20 30 40 Given examples Predict given a new point

23 Hal Daumé III (me@hal3.name) Linear regression 40 26 24 20 22 20 0 0 20 30 20 10 0 0 10 20 30 40 Prediction Prediction

24 Hal Daumé III (me@hal3.name) Ordinary Least Squares (OLS) Observation Prediction Error or residual 0 0 20

25 Hal Daumé III (me@hal3.name) Minimizing Error Value update explained:

26 Hal Daumé III (me@hal3.name) Overfitting 30 25 20 Degree 15 polynomial 15 10 5 0-5 -10-15 0 2 4 6 8 10 12 14 16 18 20