0% found this document useful (0 votes)
3 views103 pages

Module 1 AI - ASI Updated

ai notes

Uploaded by

lishaskumar5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views103 pages

Module 1 AI - ASI Updated

ai notes

Uploaded by

lishaskumar5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Department of CSE (ARTIFICIAL INTELLIGENCE & MACHINE LEARNING)

Subject Code: BAD402


Subject Name: Artificial Intelligence
Module Number: 01
Name of the Module: Introduction to Artificial Intelligence

Prepared by
Dr. Arpitha Shankar S I
Scheme: 2022 Associate Professor
Module 1
• Introduction: What is AI?
• Foundations and History of AI
• Intelligent Agents: Agents and environment,
• Concept of Rationality,
• The nature of environment,
• The structure of agents.

Department
2 of CSE(AI & ML)
Artificial Intelligence is the Machine Learning is a subset Python is a versatile, high-
development of computer of AI that teaches computers level programming
systems that can perform tasks to learn and improve from language known for its
that typically require human experience without being simplicity and readability.
intelligence. explicitly programmed.
❖ Artificial Intelligence:
• Artificial Intelligence (AI) involves creating computer systems that can perform
tasks that typically require human intelligence, such as understanding language,
recognizing patterns, and making decisions.

• It encompasses a wide range of techniques and approaches, including machine


learning, natural language processing, and computer vision.

• The goal of AI is to develop systems that can perceive their environment,


learn from experience, and adapt to new situations, ultimately
mimicking human intelligence in various tasks.
❖ Machine Learning:
• Machine Learning is a subset of AI. It's a method by which machines learn
from data. Instead of explicitly programming a machine how to do
something, you give it a lot of data and let it learn patterns from that data to
make predictions or decisions.

• Machine Learning is a way for computers to learn from data without being
explicitly programmed. It involves teaching a computer to recognize patterns
in data and make decisions or predictions based on those patterns.

• By training on examples, Machine Learning algorithms can improve their


performance over time, enabling them to tackle a wide range of tasks from
spam detection to image recognition.
❖ AI, ML and DL :

Example:

AI: The overarching concept of creating systems


to play Tic Tac Toe.

ML: Trains algorithms to learn from data (such


as game simulations) and make decisions
(choosing moves).

Deep Learning: A subset of ML that uses deep


neural networks to learn intricate patterns directly
from data, particularly effective for tasks like
playing games where optimal decisions depend
on the current game state.
❖ Different Paramaters of YouTube Music Songs recommendation system:
1. Lata Mangeshkar Songs
2. Hindi Bollywood Songs
3. Old songs
4. How frequently I have watched the same song?
5. Popularity(many views)
6. Music Director: S.D. Burman
7. Movie watched recently (Mausam)
8. Sentimental song (based on mood of past few watches)
9. Based on season(monsoon)/Atmosphere(rain)
10. Based on Location(Himalayas)
11. Based on time(Full moon night)
12. Based on my other account (Spotify, Amazon music etc.)
❖ Python and Google Colab:
• Python is a versatile and beginner-friendly programming language. It's known
for its readable syntax and extensive libraries. Used in web development, data
analysis, artificial intelligence, and more.

• Google Colab is a free online platform where you can write and run Python
code in your web browser. It provides access to GPUs and TPUs, making it
suitable for machine learning tasks. Users can share and collaborate on
notebooks easily, making it convenient for team projects or learning.
2
What is Artificial
Intelligence?
Different approaches to AI

Introduction
Artificial Intelligence is a branch of computer science concerned with making
computers behave like human.

• Can Machine think?

ex: Smart Phones


Automated Cars
Youtube: get recommendations based on your behaviour

Human behaviours:

1. Reasoning : Logic
2. Learning : learning from the past and act
3. Problem Solving:
4. Perception
Department
11 of CSE(AI & ML)
❖ What is AI?
• Intelligence: “ability to learn, understand and think” (Oxford dictionary)
• AI is about teaching computers to do things that humans are doing good right
now.
• Examples: Speech-Face-Object recognition, Intuition, Inference, Learning new
skills, Decision making, Abstract thinking.
• There are four different approaches to artificial intelligence (AI), each
emphasizing different aspects of human-like behavior and rational decision-
making.

Thinking humanly Thinking rationally

Acting humanly Acting rationally


❖ Thinking Humanly: Cognitive Modelling
• This method tries to copy how humans think and understand things. It aims to
understand how humans think and solve problems. i.e. Cognitive science.
• “Cognitive science/modelling" refers to the scientific study of how humans think and
reason.
• Example: Cognitive psychology-inspired AI systems, such as virtual assistants like
Siri or Alexa, try to act like humans. They listen to what people say, try to
understand what they mean, and respond like a person would in a conversation.
• It is not related to how a computer program solves a problem correctly. Thinking
Humanly is more interested in seeing how its steps compare to how a human would
solve the same problem.
❖ Acting Humanly: The Turing Test
• This approach aims to create AI systems that perform tasks in a manner very similar to human
behavior. It focuses on achieving human-like performance in various tasks.
• Example: Turing Test is a classic example of the acting humanly approach. In the Turing Test, a
human evaluator interacts with a machine and a human through a text interface without knowing
which is which. If the evaluator cannot reliably distinguish between the machine and the human
based on the conversation, the machine is considered to have passed the test.

Alan Turing (1912-1954) performed a operational test Imitation Game


for intelligent behavior: the Imitation(Copying) Game, Human
“Computing Machinery and Intelligence” (1950)

Predicted that by 2000, a machine might have a 30%


chance of fooling a normal person for 5 minutes. Human Evaluator
AI System
❖ Thinking Rationally: Laws of Thought
• This approach emphasizes on designing AI systems that follow principles of logic
and rational(logical) decision-making, regardless of whether it mirrors human
thought processes.

• In simple words, if your thoughts are based on facts and not emotions, it is called
rational thinking.

• Example: Expert systems, such as medical diagnosis systems, rely on rules and
logical inference to make decisions. These systems use knowledge bases of
medical expertise and logical reasoning to diagnose diseases based on symptoms
reported by patients.
❖ Acting Rationally
• This approach focuses on creating AI systems that make decisions to achieve
the best outcome, irrespective of whether the decision-making process
resembles human thinking.

• Acting rationally is more related to scientific development than human-based


approaches.

• Example: Autonomous vehicles, like self-driving cars, operate based on the


principle of acting rationally. They analyze sensor data in real-time, process it
using algorithms to detect obstacles, and make decisions to navigate safely to
their destination, optimizing factors like speed, distance, and safety.
❖ Conclusions:
• By applying these different approaches we can see how they each offer distinct perspectives
on how AI systems can be developed and interact with users.

1. Mirroring Human Intelligence and Behavior: AI acts like humans, understanding language,
recognizing patterns, and making decisions like us. For example, a friendly chatbot(Alexa, Sisi)
jokes and empathizes.

2. Optimizing for Rational Decision-Making: AI makes smart decisions, not exactly like humans,
but logically and efficiently. For instance, a song/movie recommendation system suggests
songs/films based on our preferences, aiming for the best choices.

The choice depends on whether we want AI to be human-like or just make the best decisions. In
fact many AI systems incorporate elements of both human-like interaction and rational decision-
making. The emphasis on each approach can vary based on factors such as the nature of the task,
user expectations, and the goals of the system developers.
3
The Foundations of Artificial Intelligence
❖ The Foundations of AI
• AI is like a recipe with many ingredients - each field adds its own flavor.
1. Mathematics(Crunching Numbers and Patterns):
• Mathematics is like the language of patterns and numbers.
• Provides the foundation for AI algorithms
• Includes Linear Algebra, Probability, Statistics, Calculus
• Used in Machine Learning models, optimization, and neural networks
• Imagine you're trying to solve a math problem. Math helps us with:
➢ Figuring out the rules to solve problems accurately.
➢ Deciding what can and cannot be solved with numbers.
➢ Finding ways to think clearly even when we're not sure about something.
2. Computer Engineering(Building Smarter Machines):
• Programming, data structures, algorithms
• AI implementation through Python, TensorFlow, PyTorch
• Software engineering & system design
• Without computer science, AI cannot be implemented practically.
• Computer engineering is like building a robot from scratch.

• Consider how your computer works. Computer engineering helps us with:


➢ Designing and creating computers that work quickly and efficiently.
• For example, advancements in computer engineering have enabled the
processing power necessary for training complex AI models.
3. Neuroscience(Exploring the Brain's Secrets):
• Studies how the human brain works
• Inspired Artificial Neural Networks (ANNs)
• Example: Deep Learning models are inspired by biological neurons.
• Neuroscience is like a detective investigating the brain.
• Think about how you learn new things. Neuroscience helps us understand:
➢ How our brains process information to learn and remember.
➢ Figuring out why we feel certain emotions or think in certain ways.
4. Psychology(Understanding Our Minds):

• Studies human behavior and cognition


• Helps in understanding learning, perception, and decision-making
• Used in Human-Computer Interaction and AI agents.
• Psychology is like a map guiding us through our thoughts and actions.
• Imagine trying to understand why someone feels happy or scared. Psychology
helps us explore:

➢ How humans and animals think and behave in different situations.


5. Linguistics (The Power of Words):

• Study of language structure and meaning


• Linguistics is like exploring the dictionary of language.
• Imagine trying to understand a new language. Linguistics helps us discover:
➢ How language shapes our thoughts and the way we communicate.
• For example, chatbots and virtual assistants use NLP techniques to interpret
and respond to user queries.
• Used in Chatbots, Speech Recognition, Language Translation.
6. Control Theory and Cybernetics (Keeping Things in Check):
• Cybernetics: Study of control and communication in machines and living
beings. Example: Self-driving cars adjusting speed using sensor feedback.

• Control theory and cybernetics are like the autopilot in a plane.


• Think about how a thermostat keeps your room at just the right temperature.
Control theory and cybernetics help us understand:
➢ How machines can control themselves to work properly without constant
human input.
7. Philosophy(Asking the Big Questions):
• Think of philosophy as asking really big questions. Logic, reasoning, ethics
• Helps define: What is intelligence? Can machines think? AI ethics & moral
decisions
• For example, imagine you're trying to solve a puzzle. Philosophy asks
questions like:
➢ Can we make strict rules to always solve puzzles correctly?
➢ How does our mind, our thoughts and feelings, come from our brain?
➢ Where does all our knowledge come from, and how does it help us make
decisions?
8. Economics(Making Smart Choices):
• Economics is all about making decisions, especially when it comes to money.
• Picture yourself deciding how to spend your allowance. Economics helps us
understand:
➢ How to make choices to get the most out of our money.
➢ Figuring out what to do when others don't agree with our choices.
➢ Planning for the future when we're not sure what will happen.
“AI is not just programming. It is a combination of mathematics for
calculations, psychology for understanding behavior, neuroscience for
brain inspiration, linguistics for language, economics for decision-making,
philosophy for logic and ethics, and computer science for
implementation.”
❖ Conclusion:
• Artificial Intelligence (AI) is like a big puzzle, and to understand it, we need to
look at different pieces that come from various areas of study. These pieces are
like ingredients in a recipe, each adding something important.
• By working together, these different disciplines help AI grow and improve.
• By integrating knowledge from diverse disciplines, AI can continue to advance
and tackle increasingly complex challenges.
• Collaboration between philosophers, mathematicians, economists,
neuroscientists, psychologists, computer engineers, control theorists, linguists,
and other experts is crucial for the continued development of AI technologies.
4
History of
Artificial
Intelligence
❖ Early Foundations (1940s - 1950s)
❖ Early Breakthroughs (1950s-1960s)
Checkers Mastery
In 1951, the Ferranti Mark- Newell and Simon's "General
1 computer successfully Problem Solver" algorithm
used an algorithm to master demonstrated the potential of
the game of checkers, a AI to tackle a wide range of
milestone in AI mathematical problems.
development.
❖ Robotics and Computer Vision (1960s-1970s)
❖ The "AI Winters" (1970s-1990s)
❖ A New Era of AI (1990s-2000s)
❖ AI in the 21st Century
History of Artificial Intelligence
1. The gestation of artificial intelligence (1943–1955)
• The gestation of artificial intelligence (AI) during the period from 1943 to 1955 marked the early theoretical
and conceptual groundwork for the field. This period laid the foundation for the subsequent development
of AI
2. The birth of artificial intelligence (1956)
The birth of artificial intelligence (AI) in 1956 is commonly associated with the Dartmouth Conference, a
seminal event that took place at Dartmouth College in Hanover, New Hampshire.

3. Early enthusiasm, great expectations (1952–1969)


The period from 1952 to 1969 in the history of artificial intelligence (AI) was characterized by early enthusiasm
and great expectations. Researchers during this time were optimistic about the potential of AI and believed
that significant progress could be made in creating machines with human-like intelligence.
4. A dose of reality (1966–1973)
The period from 1966 to 1973 in the history of artificial intelligence (AI) is often referred to as "A Dose of
Reality." During this time, researchers faced challenges and setbacks that led to a reevaluation of the initial
optimism and expectations surrounding AI.

5. Knowledge-based systems: The key to power? (1969–1979)


• This era saw efforts to build expert systems, which were designed to emulate human expertise in specific
domains.
6. AI becomes an industry (1980–present)
• the evolution of artificial intelligence (AI) into an industry, witnessing significant advancements,
increased commercialization, and widespread applications across various domains.

7. The return of neural networks (1986–present)


• This era is marked by significant advancements in the development of neural network
architectures, training algorithms, and the widespread adoption of deep learning techniques.

8. AI adopts the scientific method (1987–present)


• Reflecting a more rigorous and empirical approach to research.
• This shift has involved the application of experimental methodologies, reproducibility, and a
greater emphasis on evidence-based practices.

9. The emergence of intelligent agents (1995–present)


• Intelligent agents are autonomous entities that perceive their environment, make decisions, and
take actions to achieve goals.

10. The availability of very large data sets (2001–present)


• This era has witnessed an unprecedented growth in the volume and diversity of data, providing a
foundation for training and enhancing increasingly sophisticated AI models.
❖ Intelligent Agents(IAs):
IA:- Anything that can be viewed as perceiving its environment
through sensors and acting upon that environment through its
effectors to maximize progress towards its goals.
• The set of inputs at a given time is called a percept. The
sequence of percept influence the action of an agent.
• Action is operations involving the effectors.
• Agent has a goal which it tries to achieve.
• The performance measure is used to evaluate an agent.

❖ For example human as an intelligent agent has:


1. Sensors: Eyes, ears, skin, taste buds (these help us
perceive the world).
2. Effectors: Hands, fingers, legs, mouth (these help us take
actions in the world).
3. Example: A person sees (sensor) a ball coming towards
them and catches it (action using effectors).
🚗 Self-Driving Car
•Sensors → Camera, LiDAR, Radar
•Percept → Detecting obstacle
•Agent → AI system deciding
•Effectors → Steering wheel, brakes
•Action → Slow down
•Goal → Reach safely
•Performance → No accidents
❖ An Agent and its Environment
• AI system is composed of an agent and its environment.
• An agent perceives the environment through sensors and acts on that environment
through effectors.
• Agents examples: (1) Human, (2) Robotic, (3) Software agents
sensors

percepts
environment ? agent
agent
actions

effectors

Figure: Agents and Environment interaction


❖ Vacuum-cleaner robotic agent with just two locations and its
implementation in Python: Agent Function. Agent Program.
AP is a concrete
AF is an abstract
implementation,
mathematical
running within some
description.
physical system
Good behavior:
The concept of Rationality
❖ Good Behavior: Rationality:
• A rational agent is one that “does the right thing”, i.e. the table for the agent
function is filled out “correctly.” But what does it mean to do the right thing?
We use a performance measure to evaluate any given sequence of environment
states.
• Importantly, we emphasize that the performance is assessed in terms of
environment states and not agent states; for eg. A rational agent can
maximize this performance measure by cleaning up the dirt, then dumping it
all on the floor, then cleaning it up again, and so on.

• Here is a relevant rule of thumb: It is advisable to design performance


measures according to what one actually wants in the environment, as opposed
to how one believes that agent should behave.
❖ Rationality:
What is rational at any given time depends on (at least) four things:
(1) The performance measure
(2) The agent’s prior knowledge
(3) The actions the agents can perform
(4)The agent’s percept sequence to date.

Definition of a Rational Agent:


For each possible precept sequence, a rational agent should select an action that is
expected to maximize its performance measure, given the evidence provided by the
percept sequence and whatever built-in knowledge the agent possesses.
❖ Rationality vs. Omniscience:
• Rationality means making the best decision with the information you have, while
omniscience means knowing everything, which is impossible.
• Example: If you cross the street and a falling object hits you, it's not irrational;
you couldn't predict that.
• Key Point: Rationality is about maximizing expected performance, not being
perfect. Gathering information to make better decisions is part of being rational.
• For eg. Imagine you check the weather before leaving with an umbrella. If it
rains, you made a rational choice. If it doesn't rain, you're not irrational because
you made the best decision based on available information.
❖ Learning and Adapting:
• A rational agent should not only gather information but also learn from it to
improve over time.
• Example: If a robot vacuum cleaner notices that certain areas of the floor are
always dirty, it should learn to clean those areas more frequently
• Key Point: Flexibility and learning from experience make a rational agent more
successful and less fragile.
❖ Autonomy in Agents:
• An agent lacks autonomy if it relies too much on its designer's knowledge
instead of learning from its own experiences.
• Learning is Key: A good agent should learn and adapt to perform better, like a
vacuum cleaner predicting where dirt will appear.
• Starting Point: Agents need some initial knowledge to avoid acting randomly, but
over time, they should learn enough to act independently.
• Example: A robot programmed to water plants should learn when and how
much water each plant needs, instead of following a fixed schedule. This makes
it more effective and adaptable.
The Nature of Task
Environment (PEAS)
❖ Specifying the task environment:
The are four elements to take account when designing an agent to solve a problem:
PEAS
◦ Performance: measure the success of an agents behaviour
◦ Environment: where an agent operates
◦ Actuator: agent acts with in its environment
◦ Sensor: the agent senses its environment

E.g. Taxi driver


◦ P: safe, fast, legal, maximize profit
◦ E:road, other traffic, customer, pedestrian
◦ A: brake, accelerator, signal, horn, steering wheel
◦ S: camera, sonar, speedometer, GPS, engine sensor, keyboard.
❖ Properties of task environments:
1. Fully Observable vs. Partially Observable:
Fully Observable: The agent can see everything it needs to make decisions.
Example: A chess game where the agent can see the entire board and all the pieces.
Partially Observable: The agent has limited or noisy information.
Example: A robot vacuum that can only detect dirt directly underneath it and not in other rooms.

2. Single Agent vs. Multi-Agent:


Single Agent: Only one agent is operating alone.
Example: A robot vacuum operates as a single agent.
Multi-Agent: Multiple agents interacting, which can be competitive or cooperative.
Example:
Competitive: Chess, where two players (agents) compete to win.
Cooperative: Autonomous cars trying to avoid collisions while driving on the road.
❖ Properties of task environments:
3. Deterministic vs. Stochastic:
Deterministic: Actions lead to predictable outcomes.
Example: A robot following a predefined path without any unexpected changes.
Stochastic: Actions have uncertain outcomes, often described by probabilities.
Example: A self-driving car facing unpredictable traffic conditions and potential hazards.

4. Episodic vs. Sequential:


Episodic: Actions are isolated, and past actions do not affect future ones.
Example: A spam filter deciding if an email is spam based on the current email only.
Sequential: Actions affect future decisions and outcomes.
Example: Driving a taxi where each decision, like turning or stopping, affects future
situations on the road.
❖ Properties of task environments:
5. Static vs. Dynamic:
Static: The environment does not change while the agent is deciding on an action.
Example: A game of solitaire where the cards stay in place while the player decides the
next move.
Dynamic: The environment changes continuously, requiring the agent to act quickly.
Example: Real-time stock trading where market conditions constantly change.

6. Discrete vs. Continuous:


Discrete: The environment has distinct states and time steps.
Example: A turn-based board game like checkers.
Continuous: The environment changes smoothly over time.
Example: Self driving car, where speed and steering are continuously variable.
❖ Properties of task environments:
7. Known vs. Unknown:

Known: The agent knows the rules and consequences of actions within
the environment.
Example: A robot programmed to assemble parts in a factory with
known procedures.

Unknown: The agent has to learn the effects of its actions through
exploration.
Example: An agent exploring a new video game for the first time, where
the agent learns the rules and controls as it play.
The Structure of
Agents
❖ What is an AI Agent ?
Definition: An AI agent perceives its environment
using sensors and takes actions using actuators.
Behavior: Actions depend on a sequence of percepts
(inputs).
Key Focus: Understanding how agents decide on
actions requires looking inside the agent's structure.
❖ For example human as an intelligent agent has:
1. Sensors: Eyes, ears, skin, taste buds (these help us
perceive the world).
2. Effectors: Hands, fingers, legs, mouth (these help us take
actions in the world).
3. Example: A person sees (sensor) a ball coming towards
them and catches it (action using effectors).
❖ Structure of an AI Agent:
• Agent Formula: Agent = Architecture + Program
✓ Architecture: The physical platform (e.g., PC, robotic car with sensors and
actuators).
✓ Program: The software that processes percepts and determines actions.

• Interaction:
✓ Architecture provides inputs (percepts) to the program.
✓ The program processes inputs and outputs actions for the architecture to
execute.
❖ Matching Program to Architecture:
• Compatibility:
✓ The program must align with the architecture's capabilities (e.g., a "Walk"
program needs legs).
• Examples:
✓ An ordinary PC as architecture vs. a robotic car with wheels.
• Key Takeaway:
✓ Designing an AI agent is about creating a suitable program for the right
hardware to ensure efficient perception and action.
12

Agent Programs
❖ What Are Agent Programs ?
• Agent Programs:
They take the current input (percept) from the environment and decide an
action.
• Difference:
✓ Agent Program: Uses only the current percept.
✓ Agent Function: Considers the entire history of percepts.
• Memory:
If an agent needs past percepts, it must remember them.
❖ Vacuum-cleaner robotic agent with just two locations and its
implementation in Python: Agent Function. Agent Program.
AP is a concrete
AF is an abstract
implementation,
mathematical
running within some
description.
physical system
❖ Why Not Use a Lookup Table ?
• Table-Driven Agents:
Store all possible actions for every possible sequence of percepts in a table.
• Problem with Tables:
➢ Too large to store (e.g., a taxi's visual data would need a table with over
10^250,000,000,000 entries).
➢ Impossible to create, store, or learn such a huge table.
• Key Challenge:
Instead of using giant tables, create small, efficient programs that act rationally.
❖ Types of Agent Programs
• AI uses smaller programs, not big tables, to create intelligent behavior.
• Four Types of Agent Programs:
1. Simple Reflex Agents: Act only on current percept.
2. Model-Based Reflex Agents: Use a model of the world to handle unseen
situations.
3. Goal-Based Agents: Consider future goals to decide actions.
4. Utility-Based Agents: Choose actions based on utility or "happiness" to
achieve goals.
• Learning Agents: These can improve by learning from experiences.
Intelligent Agent
• Agent: entity in a program or environment capable of generating action.
• An agent uses perception of the environment to make decisions about
actions to take.
• The perception capability is usually called a sensor.
• The actions can depend on the most recent perception or on the entire
history (percept sequence).
Agent Function
• The agent function is a mathematical function that maps a sequence of
perceptions into action.
• The function is implemented as the agent program.
• The part of the agent taking an action is called an actuator.
• environment → sensors → agent function → actuators → environment
Environment
Environment
Sensors

Percept (Observations)

Agent Function
Agent
Actuator

Action Environment
Environment
Rational Agent
• A rational agent is one that can take the right decision in every situation.
• Performance measure: a set of criteria/test bed for the success of the
agent's behavior.
• The performance measures should be based on the desired effect of the
agent on the environment.
13

Simple Reflex Agents


❖ Introduction to Simple Reflex Agents
➢ Definition: Basic agents that make decisions based only on current input (percept) without
past memory or future planning.

➢ Characteristics:
1. No Memory:
• Decisions rely only on the latest observation.
• No recall of past actions or percepts.
2. Simple Actions:
• Actions are directly triggered by specific conditions.
• These agents rely on a set of pre-defined rules (often known as condition-action rules) that
specify which action to take in a given situation.
• Example: A vacuum cleaner detects dirt and it cleans it; if it encounters a wall, it changes
direction.
❖ Practical Example of Simple Reflex Agent
➢ A simple reflex agent might be a thermostat
• If the temperature is above the set point, it turns on cooling.
• If the temperature is below the set point, it activates heating.

➢ Advantages:
• Efficiency: Fast and straightforward as they do not require complex computations or
memory.
• Simplicity: Easy to design and implement for simple, well-defined tasks.

➢ Limitations:
• Lack of Adaptability: They cannot adapt to new situations if the rule is not predefined.
• No Learning: Since they lack memory, they cannot learn from experience, which limits
their effectiveness in dynamic or unpredictable environments.
❖ Condition-Action Rules
Condition-Action Rules connect specific conditions in the environment to specific actions by the
agent.
➢ Example
• Vacuum Cleaner Agent:
• Condition: Detects dirt.
• Action: Cleans.
• Condition: No dirt.
• Action: Moves to the next spot.
➢ How It Works
1. Observe the environment.
2. Match Rule: Find a condition that fits the observation.
3. Act based on the matched rule.
➢ Key Points
• Instant response, no past or future consideration.
• Great for simple tasks but not adaptable for complex environments.
76
14

Model-based Reflex agents


❖ Introduction to Model-Based Reflex Agents?
• What are Model-Based Reflex Agents?
• Definition: Model-based reflex agents are agents that
maintain an internal memory, or "state," which helps
them make decisions in situations where they cannot see
or sense the entire environment directly.
• Purpose: This memory helps them handle situations
where they have only partial visibility of the
environment.
•Difference from Simple Reflex Agents:
• Simple Reflex Agents: Act solely based on current input,
without memory of past events.
• Model-Based Reflex Agents: Use memory (internal
state) and a basic model of the world to track past inputs
and make more informed decisions.
79

 Know how world evolves


 Overtaking car gets closer from behind

 How agents actions affect the world


 Wheel turned clockwise takes you right

 Model base agents update their state


❖ How does Model-based Reflex agent work ?
• Challenge: Sometimes, agents don’t have a
complete view of the world around them.
• Example: A self-driving car agent can’t
see every vehicle on the road at once.
• Solution (Model-based Reflex agent):
• The agent creates an internal memory,
or state, to track things it can’t directly
see right now.
• As time passes and the agent receives
new information, it updates this internal
state.
• This makes its actions smarter and A car agent remembering where other cars are on the road, even
more responsive to changing situations. if they’re temporarily out of sight
❖ Internal State Beyond Physical Reality
• Beyond Just “Where” the Agent Is:
• The agent’s memory can include goals and
plans, not just information about the
environment.
• Example: A taxi has a rule to refuel on the
way home unless it has at least half a tank.
• Key Idea:
• The agent’s internal state doesn’t just
describe the physical world around it. It
also includes the agent’s intentions or
plans, like where it plans to go next or any
steps it has planned for the journey. A taxi with an internal rule or “goal” to refuel
❖ Real Life examples of Model-based reflex agents:

1. A self-driving car on the road.

2. A security robot that patrols a building.


❖ Benefits of Model-based Reflex agent work:
1. They handle partial observability better than simple reflex agents, as they retain
context from previous observations.
2. This makes them better suited for complex tasks, like driving or surveillance,
where the agent can’t always see the entire environment.

❖ Limitations of Model-based Reflex agent work:


1. They may still struggle with environments that change unpredictably, or situations
that require extensive planning or reasoning.
2. Additionally, creating and maintaining an accurate model can be challenging
and requires more computational power.
15

Goal-based Agents
❖ What are Goal-Based Agents?
➢ Goal-based agents don’t just react to the current environment; they act with a
goal in mind.
➢ Knowing only the current state isn’t enough—agents need to know where they’re
going. These are an expansion of model-based reflex agents.
➢ Example: A taxi at a road junction doesn’t just pick a random direction; it
considers its passenger’s destination to make the correct turn.
❖ How Goal-Based Agents Work?
• A goal based agents works on current percept, history
and goals simultaneously.
• Goal Awareness:
• The agent has a goal that describes a desirable
situation (like reaching a destination).
• Model of the World:
• Uses a model to predict the results of its actions,
asking, “If I do A, will it help me reach my
goal?”
• Decision Process:
• Plans a sequence of actions, considering future
steps needed to reach the goal.
• Sometimes goal satisfaction is easy (one action),
but sometimes it requires multiple steps (like
navigating twists and turns).
❖ Real-Life Example: The Self-Driving Car
Self-Driving Car as a Goal-Based Agent
• Goal: Reach a destination safely.
• Actions are planned to avoid obstacles
and follow traffic rules to reach the goal.
• Flexibility: If there’s a roadblock, the car
can update its route to still achieve its
goal.
❖ Benefits and Limitations:
• Benefits:
• Flexibility: Can adapt to new goals easily (e.g., changing destination).
• Future-Oriented: Plans for what’s ahead, not just what’s immediately
sensed.

• Limitations:
• Complexity: Requires more computing power for planning and
modeling.
• Time-Consuming: Decisions can be slower due to the need for future
planning.
16

Utility-based Agents
❖ What are Utility-based agents?
➢ Goals alone are not always enough for good decision-making.
➢ Utility-based agents go beyond "achieving a goal" and evaluate how desirable different
outcomes are.
➢ They use a utility function, which measures how "happy" or "satisfied" an outcome
makes them.
➢ Example: A taxi doesn’t just aim to reach a destination—it considers whether the route is
fast, safe, or cost-effective.
❖ How Do Utility-Based Agents Work?
• Utility function: A scoring system that ranks
outcomes based on desirability.
• They calculate expected utility, weighing the
likelihood of different outcomes against their
utility.
• Decision-making involves:
1) Modeling the environment.
2) Predicting outcomes of actions.
3) Selecting the action with the highest
expected utility.
• Real-Life Example: A self-driving car picks
a route balancing traffic, fuel efficiency, and
safety.
❖ Real-Life Examples of Utility-based agents:
1. YouTube Recommendation Systems
YouTube algorithm use utility-based algorithms to suggest
movies/videos. It uses weigh factors like user preferences, likings
and reviews to recommend the best movies that maximizes
customer satisfaction.

2. Virtual Assistants
Assistants like Alexa or Siri use utility-based reasoning to
prioritize tasks. For instance, if you ask for restaurant
suggestions, they consider factors like proximity, user reviews,
and your past preferences to recommend the most suitable
options.

3. Autonomous Cars as Utility based agents


Utility-based agents in self-driving cars evaluate trade-offs like
speed, safety, and fuel efficiency. For example, the car might
choose to slow down in heavy rain to prioritize safety over speed.
❖ Benefits and Limitations:
• Benefits:
• Better decision-making by balancing trade-offs (e.g., speed vs. safety).
• Flexible in handling multiple or conflicting goals.
• Works well in uncertain environments.

• Limitations:
• Complex to design and program utility functions.
• Computationally expensive—requires predicting and evaluating many
possible outcomes.
• May struggle with real-time decisions in highly complex situations.
17

Learning agents
❖ What are Learning Agents ?
➢ Learning agents are intelligent systems that
improve their performance over time through
experience.
➢ Unlike other agents, they can adapt to new or
unknown environments.
➢ They consist of key components: learning
element, performance element, critic, and
problem generator.
➢ Purpose: To make better decisions by learning
from feedback and past experiences.
❖ How Do Learning Agents Work?
• A learning agent is comprised of 4 main
components:
(1) the learning element, which is
responsible for making improvements;
(2) the performance element, which is
responsible for selecting external
actions(decisions) ;
(3) the critic, which gives feedback to the
agent, and determines how the
performance should be modified;
(4) the problem generator is responsible for
suggesting actions that will lead to new and
informative experiences.
• Process Flow: Perception → Decision →
Action → Feedback → Learning.
❖ Real-Life Examples of Learning Agents
1) Self-Driving Cars: Improve driving skills
by learning from past experiences and
real-world feedback.
2) Recommendation Systems: Suggest better
content (like movies or products) by
learning user preferences over time.
3) Robotics: Robots in factories learn to
improve their performance and adapt to
new tasks.
4) Virtual Assistants: Adapt to understand
user commands better through continuous
interaction.
❖ Benefits of Learning Agents

• Adaptability: Can handle new, unknown, or changing environments.


• Continuous Improvement: Gets better with more experience and feedback.
• Flexibility: Can adjust to different tasks and goals.
• Efficiency: Helps optimize performance over time, reducing errors and
improving accuracy.
❖ Limitations of Learning Agents

• Complex Design: Requires careful planning and programming of learning


mechanisms.
• Data Dependency: Needs a lot of data and feedback to learn effectively.
• Time-Consuming: Learning and improving performance can take a long time.
• Computational Costs: Requires significant processing power for real-time
decision-making.
Thank You

You might also like