DOC PREVIEW
Berkeley COMPSCI 188 - Agents

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CS 188: Artificial IntelligenceSpring 2007Lecture 2: Agents1/18/2007SriniNarayanan –ICSI and UC BerkeleyMany slides from Dan Klein, Mitch MarcusAdministrivia§ Reminder:§ Sections and Office hours start next week.§ Schedules posted soon.§ Accommodation issues§ Assignment 0 part 1 is the tutorial (not graded) which should be up. Part 1 will be up by Friday and is a written assignment covering the first two weeks of lecture. Due 11:59 PM on 1/30.§ Course workload curveToday§ Agents and Environments§ Reflex Agents§ Environment Types§ Problem-Solving AgentsAgents and Environments§ Agents include:§ Humans§ Robots§ Softbots§ Thermostats§ …§ The agent function maps from percept histories to actions:§ An agent program running on the physical architecture to produce the agent function.The line between agent and environment depends on the level of abstraction.Always think of the environment as a black box, completely external to the agent –even if it’s simulated by local code.Agents§ An agent is anything that can be viewed as § perceiving its environment through sensors and § acting upon that environment through actuators§ Human agent: § Sensors: eyes, ears, ...§ Actuators: hands, legs, mouth, …§ Robotic agent: § Sensors: cameras and infrared range finders § Actuators: various motorsPDF created with pdfFactory Pro trial version www.pdffactory.com2Example: A Vacuum-cleaner agent§ Percepts:locationand contents, e.g. [A, dirty]§ (Idealization: locations are discrete)§ Actions: LEFT, RIGHT, SUCK, NOPA BA Reflex Vacuum-CleanerPython code for agentloc_A, loc_B= (0, 0), (1, 0) # The two locations for the Vacuum world class ReflexVacuumAgent(Agent): "A reflex agent for the two-state vacuum environment. [Fig. 2.8]"def __init__(self): Agent.__init__(self) def program((location, status)): if status == 'Dirty': return 'Suck'eliflocation == loc_A: return 'Right'eliflocation == loc_B: return 'Left'self.program= programSimple reflex agentfunction REFLEX_VACUUM_AGENT( percept )returns an action(location,status) = UPDATE_STATE( percept )if status = DIRTY then return SUCK;else if location = A then return RIGHT;else if location = B then return LEFT; Simple Reflex Agents§ Does this ever make sense as a design?Table-Lookup Agents?§ Complete map from percept (histories) to actions§ Drawbacks:§ Huge table!§ No autonomy§ Even with learning, need a long time to learn the table entries§ How would you build a spam filter agent?§ Most agent programs produce complex behaviors from compact specificationsPDF created with pdfFactory Pro trial version www.pdffactory.com3Reflex Agents with State§ When would this be appropriate?§ How do we update state?Rationality§ A fixed performance measure evaluates the environment sequence§ One point per clean square at time T?§ One point per clean square per time step, minus one per move?§ Penalize for > k dirty squares?§ Reward should indicate success, not steps to success§ A rational agent chooses whichever action maximizes the expected value of the performance measure given the percept sequence to date§ Rational ≠ omniscient: percepts may not supply all information§ Rational ≠ clairvoyant: action outcomes may not be as expected§ Hence, rational ≠ successfulRationality and Goals§ Let’s say we have a game:§ Flip a biased coin (probability of heads is h)§ Tails = loose $1§ Heads = win $1§ What is the expected winnings?§ (1)(h) + (-1)(1-h) = 2h -1§ Rational to play?§ What if performance measure is total money?§ Why might a human play this game at expected loss?Goal-Based Agents§ These agents usually first find plans then execute them.§ How is this different from a goal-based agent?Utility-Based Agents More Rationality§ Remember: rationality depends on:§ Performance measure§ Agent’s (prior) knowledge§ Agent’s percepts to date§ Available actions§ Is it rational to inspect the street before crossing?§ Is it rational to try new things?§ Is it rational to update beliefs?§ Is it rational to construct conditional plans in advance?§ Rationality gives rise to: exploration, learning, autonomyPDF created with pdfFactory Pro trial version www.pdffactory.com4The Road Not (Yet) Taken§ At this point we could go directly into:§ Empirical risk minimization(statistical classification)§ Expected return maximization(reinforcement learning)§ These are mathematical approaches that let us derive algorithms for rational action for reflex agents under nasty, realistic, uncertain conditions§ But we’ll have to wait until week 5, when we have enough probability to work it all through§ Instead, we’ll first consider more general goal-based agents, but under nice, deterministic conditionsTask environment§ To design a rational agent we need to specify a task environment § a problem specification for which the agent is a solution§ PEAS: to specify a task environment§ Performance measure§ Environment§ Actuators§ SensorsPEAS: Specifying an automated taxi driverPerformance measure: § ?Environment: § ?Actuators: § ?Sensors: § ?PEAS: Specifying an automated taxi driverPerformance measure: § safety, speed, legal, comfortable, maximize profitsEnvironment: § ?Actuators: § ?Sensors: § ?PEAS: Specifying an automated taxi driverPerformance measure: § safe, fast, legal, comfortable, maximize profitsEnvironment: § roads, other traffic, pedestrians, customersActuators: § ?Sensors: § ?PEAS: Specifying an automated taxi driverPerformance measure: § safe, fast, legal, comfortable, maximize profitsEnvironment: § roads, other traffic, pedestrians, customersActuators: § steering, accelerator, brake, signal, hornSensors: § ?PDF created with pdfFactory Pro trial version www.pdffactory.com5PEAS: Specifying an automated taxi driverPerformance measure: § safe, fast, legal, comfortable, maximize profitsEnvironment: § roads, other traffic, pedestrians, customersActuators: § steering, accelerator, brake, signal, hornSensors: § cameras, sonar, speedometer, GPSPEAS: Internet Shopping Agent§ Specifications:§ Performance measure: price, quality, appropriateness, efficiency§ Environment: current and future WWW sites, vendors, shippers§ Actuators: display to user, follow URL, fill in form§ Sensors: HTML pages (text, graphics, scripts)PEAS: Spam Filtering Agent§ Specifications:§ Performance measure: spam block, false positives, false negatives§ Environment: email client or server§ Actuators: mark as spam, transfer


View Full Document

Berkeley COMPSCI 188 - Agents

Documents in this Course
CSP

CSP

42 pages

Metrics

Metrics

4 pages

HMMs II

HMMs II

19 pages

NLP

NLP

23 pages

Midterm

Midterm

9 pages

Lecture 4

Lecture 4

53 pages

CSPs

CSPs

16 pages

Midterm

Midterm

6 pages

MDPs

MDPs

20 pages

mdps

mdps

2 pages

Games II

Games II

18 pages

Load more
Download Agents
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Agents and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Agents 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?