Download presentation
Presentation is loading. Please wait.
Published byLenard Carpenter Modified over 8 years ago
1
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 1 Frege Notes In order to use many of the Java math functions in Frege, you need to import the corresponding library: import Prelude.Math If you need to convert a Double to an Int, use round: round 7.6 8 To convert an Int to a Double, use.double : x = 5 y.double 5.0
2
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 2 Assignment #1 Notes If you prefer, you can use the Haskell Platform and write Haskell code instead of Frege code. But note that later you will have to write Frege code for the game tournament. You can use as many helper functions as you want for any of the homework questions. You just need to put a file named A1.fr or A1.hs into your CS470/670 directory. No notes or memos are necessary. Please submit your code before Thursday’s class so that we can discuss the solutions in class.
3
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 3 A Trip to Grid-Space World Grid-space world is an extremely simple model of our own world. It is a three-dimensional space with a floor that is divided into cells by a two-dimensional grid. The cells can be empty or contain objects or agents. There can be walls between sets of cells. The agents are confined to the floor and can move from cell to cell. A robot in grid-space world can sense whether neighboring cells are empty or not.
4
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 4 Perception and Action Organisms in the real world have to do two basic things in order to survive: They have to gather information about their environment (perception) and based on this information, they have to manipulate their environment (including themselves) in a way that is advantageous to them (action). The action in turn may cause a change in the organism’s perception, which can lead to a different type of action. We call this the perception-action cycle.
5
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 5 Perception and Action Complex organisms do not just perceive and act, but they also have an internal state that changes based on the success of previous perception-action cycles. This is the mechanism of learning. We will first consider a very simple robot that lives in grid-space world and has no internal state. The grid has no tight spaces, that is, spaces between objects and boundaries that are only one cell wide.
6
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 6 Perception and Action The robot is supposed to find a cell next to a boundary or object and then follow that boundary forever. As we said, the robot can perceive the state of its neighboring cells: s1s1s1s1 s2s2s2s2 s3s3s3s3 s8s8s8s8 s4s4s4s4 s7s7s7s7 s6s6s6s6 s5s5s5s5
7
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 7 Perception and Action The robot can move to a free adjacent cell in its column or row. Consequently, there are four possible actions that it can take: north: moves the robot one cell up east:moves the robot one cell to the right south:moves the robot one cell down west:moves the robot one cell to the left
8
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 8 Immediate Perception-Action Now that we specified the robot’s capabilities, its environment, and its task, we need to give “life” to the robot. In other words, we have to specify a function that maps sensory inputs to movement actions so that the robot will carry out its task. Since we do not want the robot to remember or learn anything, one such function would be sufficient. However, it is useful to decompose it in the following way (next slide):
9
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 9 Immediate Perception-Action 0 0 1 1 0 0 … … … 1 Action function Sensory input Action Feature vector X Perceptual processing
10
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 10 Immediate Perception-Action The functional decomposition has two advantages: Multiple action functions can be added that receive the same feature vector as their input, It is possible to add an internal state to the system to implement memory and learning.
11
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 11 The Robot’s Perception For our robot, we define four different features x 1, …, x 4 that are important to it. Each feature has value 1 if and only if at least one of the shaded cells is not free: s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x1x1x1x1 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x2x2x2x2 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x3x3x3x3 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x4x4x4x4
12
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 12 The Robot’s Action To execute action, we define an ordered set of rules: if x 1 = 0 and x 2 = 0 and x 3 = 0 and x 4 = 0 move north if x 1 = 1 and x 2 = 0move east if x 2 = 1 and x 3 = 0move south if x 3 = 1 and x 4 = 0move west if x 4 = 1 and x 1 = 0move north s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x1x1x1x1 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x2x2x2x2 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x3x3x3x3 s5s5s5s5 s6s6s6s6 s7s7s7s7 s4s4s4s4 s8s8s8s8 s3s3s3s3 s2s2s2s2 s1s1s1s1 x4x4x4x4
13
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 13 Task Completion 1 5 52 3 3222 5 5 5 54444444 3 3 3 321 1 1 1 1 1 1 12 3 3 3 3222 3 3444 3 3 3 344 5 544 Rules 1 2 3 4 5
14
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 14 Production Systems Production systems are a standardized way to represent action functions. A production system consists of an ordered list of production rules (productions). Each rule is written in the form condition action. A production system is therefore written like: c 1 a 1 c 2 a 2 c m a m The action of the first rule whose condition evaluates to 1 is executed.
15
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 15 Production Systems Using Boolean notation, the production system for our boundary-following robot looks like this: x 4 x 1 north x 3 x 4 west x 2 x 3 south x 1 x 2 east 1 north
16
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 16 Search in State Spaces
17
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 17 Search in State Spaces Many problems in Artificial Intelligence can be mapped onto searches in particular state spaces.Many problems in Artificial Intelligence can be mapped onto searches in particular state spaces. This concept is especially useful if the system (our “world”) can be defined as having a finite number of states, including an initial state and one or more goal states.This concept is especially useful if the system (our “world”) can be defined as having a finite number of states, including an initial state and one or more goal states. Optimally, there are a finite number of actions that we can take, and there are well-defined state transitions that only depend on our current state and current action.Optimally, there are a finite number of actions that we can take, and there are well-defined state transitions that only depend on our current state and current action.
18
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 18 Search in State Spaces To some extent, it is also possible to account for state changes that the algorithm itself does not initiate.To some extent, it is also possible to account for state changes that the algorithm itself does not initiate. For example, a chess playing program can consider its opponent’s future moves.For example, a chess playing program can consider its opponent’s future moves. However, it is necessary that the set of such actions and their consequences are well-defined.However, it is necessary that the set of such actions and their consequences are well-defined. While computers are able to play chess at a very high level, it is impossible these days to build a robot that, for instance, is capable of reliably carrying out everyday tasks such as going to a supermarket to buy groceries.While computers are able to play chess at a very high level, it is impossible these days to build a robot that, for instance, is capable of reliably carrying out everyday tasks such as going to a supermarket to buy groceries.
19
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 19 Search in State Spaces Let us consider an easy task in a very simple world with our robot being the only actor in it: The world contains a floor and three toy blocks labeled A, B, and C. The world contains a floor and three toy blocks labeled A, B, and C. The robot can move a block (with no other block on top of it) onto the floor or on top of another block. The robot can move a block (with no other block on top of it) onto the floor or on top of another block. These actions are modeled by instances of a schema, move(x, y). These actions are modeled by instances of a schema, move(x, y). Instances of the schema are called operators. Instances of the schema are called operators.
20
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 20 Search in State Spaces The robot’s task is to stack the toy blocks so that A is on top of B, B is on top of C, and C is on the floor.The robot’s task is to stack the toy blocks so that A is on top of B, B is on top of C, and C is on the floor. For us it is clear what steps have to be taken to solve the task.For us it is clear what steps have to be taken to solve the task. The robot has to use its world model to find a solution.The robot has to use its world model to find a solution. Let us take a look at the effects that the robot’s actions exert on its world.Let us take a look at the effects that the robot’s actions exert on its world.
21
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 21 Search in State Spaces Effects of moving a block (illustration and list-structure iconic model notation)
22
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 22 Search in State Spaces In order to solve the task efficiently, the robot should “look ahead”, that is, simulate possible actions and their outcomes.In order to solve the task efficiently, the robot should “look ahead”, that is, simulate possible actions and their outcomes. Then, the robot can carry out a sequence of actions that, according to the robot’s prediction, solves the problem.Then, the robot can carry out a sequence of actions that, according to the robot’s prediction, solves the problem. A useful structure for such a simulation of alternative sequences of action is a directed graph.A useful structure for such a simulation of alternative sequences of action is a directed graph. Such a graph is called a state-space graph.Such a graph is called a state-space graph.
23
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 23 State-Space Graphs
24
February 9, 2016Introduction to Artificial Intelligence Lecture 5: Perception & Action 24 State-Space Graphs To solve a particular problem, the robot has to find a path in the graph from a start node (representing the initial state) to a goal node (representing a goal state).To solve a particular problem, the robot has to find a path in the graph from a start node (representing the initial state) to a goal node (representing a goal state). The resulting path indicates a sequence of actions that solves the problem.The resulting path indicates a sequence of actions that solves the problem. The sequence of operators along a path to a goal is called a plan.The sequence of operators along a path to a goal is called a plan. Searching for such a sequence is called planning.Searching for such a sequence is called planning. Predicting a sequence of world states from a sequence of actions is called projecting.Predicting a sequence of world states from a sequence of actions is called projecting.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.