AI Unit 1 PDF, BPSY121-4 Artificial Intelligence

Document Details

QuaintGreatWallOfChina

Uploaded by QuaintGreatWallOfChina

CHRIST Deemed to be University

Dr. Suganthi J

Tags

artificial intelligence AI agents introduction to AI

Summary

This document is a lecture on artificial intelligence, covering concepts like intelligent agents, environments, problem-solving, and various types of agents. The document is from the BPSY121-4 course at CHRIST Deemed to be University.

Full Transcript

BPSY121- 4:Artificial Intelligence Dr. Suganthi J MISSION VISION CORE VALUES CHRIST is a nurturing ground for an individual’s Excellenc...

BPSY121- 4:Artificial Intelligence Dr. Suganthi J MISSION VISION CORE VALUES CHRIST is a nurturing ground for an individual’s Excellence and Service Faith in God | Moral Uprightness holistic development to make effective contribution to Love of Fellow Beings CHRIST Deemed to be University BPSY121- 4 Artificial Intelligence Unit I: Introduction Introduction to AI: Basic concepts; Intelligent Agents: Agents and Environments, Good behavior, Nature of environments; Structure of Agents; Problem solving: Problem solving agents, Example of problems Excellence and Service CHRIST Deemed to be University Introduction to AI Artificial: Made by humans, especially in imitation of something natural Excellence and Service CHRIST Deemed to be University What is Artificial in AI? Artificial intelligence leverages computers and machines to mimic the problem-solving and decision- making capabilities of the human mind. Excellence and Service CHRIST Deemed to be University What is Intelligence? Ability to acquire and apply knowledge and skills What is Artificial Intelligence? Artificial Intelligence is a method of making a computer, a computer-controlled robot, or a software think intelligently like the human mind Excellence and Service CHRIST Deemed to be University Excellence and Service CHRIST Deemed to be University Basic Concepts: Intelligent agents: Agents in Artificial Intelligence Excellence and Service CHRIST Deemed to be University What is an Agent? An agent can be anything that perceive its environment through sensors and act upon that environment through actuators. An Agent runs in the cycle of perceiving, thinking, and acting. An intelligent agent is an autonomous entity which act upon an environment using sensors and actuators for achieving goals. Excellence and Service CHRIST Deemed to be University An agent can be: Human-Agent: A human agent has eyes, ears, and other organs which work for sensors and hand, legs, vocal tract work for actuators. Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for sensors and various motors for actuators. Software Agent: Software agent can have keystrokes, file contents as sensory input and act on those inputs and display output on the screen. Hence the world around us is full of agents such as thermostat, cellphone, camera, and even we are also agents. Excellence and Service CHRIST Deemed to be University Sensor: Sensor is a device which detects the change in the environment and sends the information to other electronic devices. An agent observes its environment through sensors. Actuators: Actuators are the component of machines that converts energy into motion. The actuators are only responsible for moving and controlling a system. An actuator can be an electric motor, gears, rails, etc. An Actuator is the actual mechanism that enables the effector to execute an action. Actuators typically include electric motors, hydraulic or pneumatic cylinders, etc. Excellence and Service CHRIST Deemed to be University Effectors: Effectors are the devices which affect the environment. Effectors can be legs, wheels, arms, fingers, wings, fins, and display screen. An Effector is any device that affects the physical environment. The terms effector and actuator are often used interchangeably to mean "whatever makes the robot take an action.“ Mechanisms for acting on the world Effectors can range from legs and wheels to arms and fingers. Excellence and Service CHRIST Deemed to be University Agent Computer program or system that is designed to perceive its environment, The agents sense the environment through sensors and act on their environment through actuators. AI system is the study of the rational agent and its environment. Excellence and Service CHRIST Deemed to be University Environment An environment is everything in the world which surrounds the agent, but it is not a part of an agent itself. An environment can be described as a situation in which an agent is present. Excellence and Service CHRIST Deemed to be University What are Agent and Environment? An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators An agent’s behavior is described by the agent function that maps any given percept sequence to an action. Excellence and Service CHRIST Deemed to be University Agent Terminology Performance Measure of Agent − It is the criteria, which determines how successful an agent is. Behavior of Agent − It is the action that agent performs after any given sequence of percepts. Percept − It is agent’s perceptual inputs at a given instance. Percept Sequence − It is the history of all that an agent has perceived till date. Agent Function − It is a map from the percept sequence to an action. Excellence and Service CHRIST Deemed to be University GOOD BEHAVIOR: THE CONCEPT OF RATIONALITY Rational Agents: Logic or Reason Systems that can reasonably be called intelligent Rationality can be judged on the basis of following points: ❖ The performance measure that defines the criterion of success. ❖ The agent’s prior knowledge of the environment. ❖ The actions that the agent can perform. ❖ The agent’s percept sequence to date. Excellence and Service CHRIST Deemed to be University Four Main Rules of an AI Agent Rule 1: An AI agent must have the ability to perceive the environment. Rule 2: The observation must be used to make decisions. Rule 3: Decision should result in an action. Rule 4: The action taken by an AI agent must be a rational action. Task of AI is to design an agent program which implements the agent function Excellence and Service CHRIST Deemed to be University Omniscience, Learning and Autonomy Omniscience: An omniscient agent knows the actual outcome of its actions and can act accordingly Learning: a rational agent not only to gather information but also to learn as much as possible from what it perceives. The agent’s initial configuration could reflect some prior knowledge of the environment Autonomy: A rational agent should be autonomous - it should learn what it can to compensate for partial or incorrect prior knowledge. Excellence and Service CHRIST Deemed to be University Environment An environment is everything in the world which surrounds the agent, but it is not a part of an agent itself. The environment is where agent lives, operate and provide the agent with something to sense and act upon it. An environment is mostly said to be non-feministic. Excellence and Service CHRIST Deemed to be University Nature of Environments As per Russell and Norvig, an environment can have various features from the point of view of an agent: 1) Fully observable vs Partially Observable 2) Static vs Dynamic 3) Discrete vs Continuous 4) Deterministic vs Stochastic 5) Single-agent vs Multi-agent 6) Episodic vs Sequential 7) Known vs Unknown 8) Accessible vs Inaccessible Excellence and Service CHRIST Deemed to be University 1. Fully observable vs Partially Observable: If an agent sensor can sense or access the complete state of an environment at each point of time then it is a fully observable environment, else it is partially observable. A fully observable environment is easy as there is no need to maintain the internal state to keep track history of the world. An agent with no sensors in all environments then such an environment is called as unobservable. Excellence and Service CHRIST Deemed to be University 2. Deterministic vs Stochastic: If an agent's current state and selected action can completely determine the next state of the environment, then such environment is called a deterministic environment. A stochastic environment is random in nature and cannot be determined completely by an agent. In a deterministic, fully observable environment, agent does not need to worry about uncertainty. Excellence and Service CHRIST Deemed to be University 3. Episodic vs Sequential: In an episodic environment, there is a series of one-shot actions, and only the current percept is required for the action. However, in Sequential environment, an agent requires memory of past actions to determine the next best actions. Excellence and Service CHRIST Deemed to be University 4. Single-agent vs Multi-agent However, if If only one agent is involved in an environment, and operating by itself then such an environment is called single agent environment. Multiple agents are operating in an environment, then such an environment is called a multi-agent environment. The agent design problems in the multi-agent environment are different from single agent environment. Excellence and Service CHRIST Deemed to be University 5. Static vs Dynamic: If the environment can change itself while an agent is deliberating then such environment is called a dynamic environment else it is called a static environment. Static environments are easy to deal because an agent does not need to continue looking at the world while deciding for an action. However for dynamic environment, agents need to keep looking at the world at each action. Taxi driving is an example of a dynamic environment whereas Crossword puzzles are an example of a static environment. Excellence and Service CHRIST Deemed to be University 6. Discrete vs Continuous: If in an environment there are a finite number of percepts and actions that can be performed within it, then such an environment is called a discrete environment else it is called continuous environment. A chess gamecomes under discrete environment as there is a finite number of moves that can be performed. A self-driving car is an example of a continuous environment. Excellence and Service CHRIST Deemed to be University 7. Known vs Unknown Known and unknown are not actually a feature of an environment, but it is an agent's state of knowledge to perform an action. In a known environment, the results for all actions are known to the agent. While in unknown environment, agent needs to learn how it works in order to perform an action. It is quite possible that a known environment to be partially observable and an Unknown environment to be fully observable. Excellence and Service CHRIST Deemed to be University 8. Accessible vs Inaccessible If an agent can obtain complete and accurate information about the state's environment, then such an environment is called an Accessible environment else it is called inaccessible. An empty room whose state can be defined by its temperature is an example of an accessible environment. Information about an event on earth is an example of Inaccessible environment. Excellence and Service CHRIST Deemed to be University Structure of an AI Agent Excellence and Service CHRIST Deemed to be University Structure of Agent Agent = Architecture + Agent Program Architecture is the machinery that the agent executes on. It is a device with sensors and actuators, for example, a robotic car, a camera, and a PC An agent program is an implementation of an agent function An agent function is a map from the percept sequence(history of all that an agent has perceived to date) to an action. f : P* → A Excellence and Service CHRIST Deemed to be University Types - Structure of agents Simple reflex agents Model-based reflex agents Goal-based agents Utility-based agents Excellence and Service CHRIST Deemed to be University Simple reflex agents Responds directly to percepts i.e. these agent select actions on the basis of the current percept, ignoring the rest of the percept history. An agent describes about how the condition action rules allow the agent to make the connection from percept to action. Condition action rule: if condition then action Ex: if car-in-front-is-braking then initiate-braking Excellence and Service CHRIST Deemed to be University Model-based reflex agents (Agents that keep track of the world) The most effective way to handle partial observability is for the agent ― to keep track of the part of the world. That is, the agent which combines the current percept with the old internal state to generate updated description of the current state. Excellence and Service CHRIST Deemed to be University Goal-based agents An agent knows the description of current state and also needs some sort of goal information that describes situations that are desirable. The action matches with the current state is selected depends on the goal state. Excellence and Service CHRIST Deemed to be University Utility-based agents An agent generates a goal state with high – quality behavior (utility) that is, if more than one sequence exists to reach the goal state then the sequence with more reliable, safer, quicker and cheaper than others to be selected. Excellence and Service CHRIST Deemed to be University Learning Agent Excellence and Service CHRIST Deemed to be University Learning Agent Type of agent that can learn from its past experiences or it has learning capabilities. It starts to act with basic knowledge and then is able to act and adapt automatically through learning. 1. Learning element: It is responsible for making improvements by learning from the environment. 2. Critic: The learning element takes feedback from critics which describes how well the agent is doing with respect to a fixed performance standard. 3. Performance element: It is responsible for selecting external action. 4. Problem Generator: This component is responsible for suggesting actions that will lead to new and informative experiences. Excellence and Service CHRIST Deemed to be University Learning Agent Excellence and Service CHRIST Deemed to be University PEAS Representation PEAS is a type of model on which an AI agent works upon. When we define an AI agent or rational agent, then we can group its properties under PEAS representation model. It is made up of four words: P: Performance measure E: Environment A: Actuators S: Sensors Excellence and Service CHRIST Deemed to be University PEAS for self-driving cars: Let's suppose a self-driving car then PEAS representation will be: Performance: Safety, time, legal drive, comfort Environment: Roads, other vehicles, road signs, pedestrian Actuators: Steering, accelerator, brake, signal, horn Sensors: Camera, GPS, speedometer, odometer, accelerometer, sonar. Excellence and Service CHRIST Deemed to be University Example of Agents with their PEAS representation Agent Performance Environment Actuators Sensors Measure 1. Medical Healthy patient Patient Tests Keyboard Diagnose Minimized cost Hospital Treatments (Entry of symptoms) Staff 2. Vacuum Cleanness Room Wheels Camera Cleaner Efficiency Table Brushes Dirt detection sensor Battery life Wood floor Vacuum Cliff sensor Security Carpet Extractor Bump Sensor Various obstacles Infrared Wall Sensor 3. Part - Percentage of parts Conveyor belt with Jointed Arms Camera picking in correct bins. parts, Hand Joint angle sensors. Robot Bins Excellence and Service CHRIST Deemed to be University Problem Solving Excellence and Service CHRIST Deemed to be University Problem Solving Agents Problem Solving Agents decide what to do by finding a sequence of actions that leads to a desirable state or solution. They may need to think through a series of moves that will lead them to their goal state. Such an agent is known as a problem solving agent, and the computation it does is known as a search. Excellence and Service CHRIST Deemed to be University The problem solving agent follows this four phase problem solving process: 1. Goal Formulation: This is the first and most basic phase in problem solving. It arranges specific steps to establish a target/goal that demands some activity to reach it. AI agents are now used to formulate goals. 2. Problem Formulation: It is one of the fundamental steps in problem- solving that determines what action should be taken to reach the goal. Excellence and Service CHRIST Deemed to be University 3. Search: After the Goal and Problem Formulation, the agent simulates sequences of actions and has to look for a sequence of actions that reaches the goal. This process is called search, and the sequence is called a solution. The agent might have to simulate multiple sequences that do not reach the goal, but eventually, it will find a solution, or it will find that no solution is possible. A search algorithm takes a problem as input and outputs a sequence of actions. 4. Execution: After the search phase, the agent can now execute the actions that are recommended by the search algorithm, one at a time. This final stage is known as the execution phase. Excellence and Service CHRIST Deemed to be University Problems and Solution Before we move into the problem formulation phase, we must first define a problem in terms of problem solving agents. A formal definition of a problem consists of five components: 1) Initial State 2) Actions 3) Transition Model 4) Goal Test 5) Path Cost Excellence and Service CHRIST Deemed to be University Problem consists of five components 1) Initial State It is the agent’s starting state or initial step towards its goal. For example, if a taxi agent needs to travel to a location(B), but the taxi is already at location(A), the problem’s initial state would be the location (A). 2) Actions It is a description of the possible actions that the agent can take. Given a state s, Actions(s) returns the actions that can be executed in s. Each of these actions is said to be appropriate in s. Excellence and Service CHRIST Deemed to be University 3)Transition Model It describes what each action does. It is specified by a function Result(s, a) that returns the state that results from doing action an in state s. The initial state, actions, and transition model together define the state space of a problem, a set of all states reachable from the initial state by any sequence of actions. The state space forms a graph in which the nodes are states, and the links between the nodes are actions. Excellence and Service CHRIST Deemed to be University 4) Goal Test It determines if the given state is a goal state. Sometimes there is an explicit list of potential goal states, and the test merely verifies whether the provided state is one of them. The goal is sometimes expressed via an abstract attribute rather than an explicitly enumerated set of conditions. 5) Path Cost It assigns a numerical cost to each path that leads to the goal. The problem solving agents choose a cost function that matches its performance measure. Remember that the optimal solution has the lowest path cost of all the solutions. Excellence and Service CHRIST Deemed to be University Example Problems The problem solving approach has been used in a wide range of work contexts. There are two kinds of problem approaches Standardized/Toy Problem: Its purpose is to demonstrate or practice various problem solving techniques. It can be described concisely and precisely, making it appropriate as a benchmark for academics to compare the performance of algorithms. Real-world Problems: It is real-world problems that need solutions. It does not rely on descriptions, unlike a toy problem, yet we can have a basic description of the issue. Excellence and Service Some Standardized/Toy Problems CHRIST Deemed to be University Vacuum World Problem Let us take a vacuum cleaner agent and it can move left or right and its jump is to suck up the dirt from the floor. A grid world problem is a two-dimensional rectangular array of square cells through which agents can move. Typically, the agent can go to any nearby cell that is clear of obstacles, either horizontally or vertically, and in rare cases diagonally. A wall or other impassible obstruction in a cell prohibits an agent from moving inside that cell. Excellence and Service CHRIST Deemed to be University State Space Graph for the Two-cell Vacuum World Excellence and Service CHRIST Deemed to be University The vacuum world’s problem can be stated as follows: States: A world state specifies which objects are housed in which cells. The objects in the vacuum world are the agent and any dirt. The agent can be in either of the two cells in the simple two-cell version, and each call can include dirt or not, therefore there are 2×2×2 = 8 states. A vacuum environment with n cells has n×2n states in general. Excellence and Service CHRIST Deemed to be University Initial State: Any state can be specified as the starting point. Actions: We defined three actions in the two-cell world: sucking, moving left, and moving right. More movement activities are required in a two-dimensional multi-cell world. Transition Model: Suck cleans the agent’s cell of any filth; Forward moves the agent one cell forward in the direction it is facing unless it meets a wall, in which case the action has no effect. Backward moves the agent in the opposite direction, whilst TurnRight and TurnLeft rotate it by 90°. Goal States: The states in which every cell is clean. Action Cost: Each action costs 1. Excellence and Service CHRIST Deemed to be University 8 Puzzle Problem In a sliding-tile puzzle, a number of tiles (sometimes called blocks or pieces) are arranged in a grid with one or more blank spaces so that some of the tiles can slide into the blank space. One variant is the Rush Hour puzzle, in which cars and trucks slide around a 6 x 6 grid in an attempt to free a car from the traffic jam. Perhaps the best-known variant is the 8- puzzle (see Figure below ), which consists of a 3 x 3 grid with eight numbered tiles and one blank space, and the 15-puzzle on a 4 x 4 grid. The object is to reach a specified goal state, such as the one shown on the right of the figure. Excellence and Service CHRIST Deemed to be University The standard formulation of the 8 puzzles is as follows: STATES: A state description specifies the location of each of the tiles. INITIAL STATE: Any state can be designated as the initial state. (Note that a parity property partitions the state space—any given goal can be reached from exactly half of the possible initial states. GOAL STATE: It identifies whether we have reached the correct goal state. Although any state could be the goal, we typically specify a state with the numbers in order, as in the Figure. ACTION COST: Each action costs 1. Excellence and Service

Use Quizgecko on...
Browser
Browser