You are on page 1of 40

Advance

Algorithms
(Deep
Learning)
Dr Sanay Muhammad
Grading Division
• Labs → 25%
• Midterm → 25%
• End term → 50%
• Lecture Session → 1.5 hours
• Lab Session → 1.5 hours
Thinking Machines

Can you
list the items
in this
picture?

3
Thinking Machines
Can you count
the distribution
of letters in a
book?
Add a thousand
4-digit numbers?
Match finger
prints?
Search a list of
a million values
for duplicates?

4
Thinking Machines
Computers do best

Humans do best Can you count the


distribution of letters in
a book?
Add a thousand4-digit
Can you numbers?
list the items Match finger prints?
in this Search a list of a
picture? million values
for duplicates?

5
The study of computer
systems that attempt to model
Artificial and apply the intelligence of
the human mind
intelligence
(AI) For example, writing a
program to pick out objects in
a picture

6
• The study of development computer
systems to make them able to perform
tasks normally requiring human
intelligence, such as
Artificial • visual perception
Intelligence • speech recognition
• decision-making
• translation between languages
Homo Sapiens means “man the
wise”

Importance AI is considered as the second most


of Artificial desirable field by the scientist of
Intelligence different fields.
Full time Einstein are required in
AI!
Systems that act like humans

Systems that think like humans

What is
Systems that think rationally
Artificial
Intelligence Systems that act rationally

Note: A system is rational if it does the


“right thing,” given what it knows.
By distinguishing between human and rational behavior, we
are not suggesting that humans are necessarily “irrational” in
the sense of “emotionally unstable” or “insane.”

One merely need note that we are not perfect:

Humans and
Rational Not all chess players are grandmasters.
Behavior
Unfortunately, not everyone gets an A on the exam
Acting humanly: The Turing Test approach
Turing Test
Thinking
Humanly:
Cognitive
Science
• Encode knowledge in formal logical
statements and use mathematical deduction
Thinking to perform reasoning
Rationally: • Such a field is called logic and experts of this
The Laws of field are called logicians
• For Example
Thought • “Socrates is a man; all men are mortal;
therefore, Socrates is mortal.”
• Formalizing common sense knowledge is
difficult.
• Does not account for an agent’s uncertainty
about the world
• E.g., difficult to implement in vision or speech
systems
Limitations • The emphasis in this case is on the
inferencing mechanism, and its properties –
i.e.
• how the system arrives at a conclusion
• the reasoning behind its selection of actions is
very important.
• An agent is something that acts.
• Computer agents
Acting • operate autonomously,
• perceive their environment,
Rationally: • persist over a prolonged time period,
The Rational • adapt to change
• create and pursue goals.
Agent • A rational agent is one that acts so as to
Approach achieve the best outcome or, when there is
uncertainty, the best expected outcome.
Advantages of Rational Agent Approach

• More general than the “laws of thought” approach because correct


inference is just one of several possible mechanisms for achieving
rationality.
• Second, it is more amenable to scientific development than are
approaches based on human behavior or human thought.
• The standard of rationality is mathematically well defined and
completely general.
Preferred Approach
• Therefore we concentrate on
general principles of rational agents
and on components for
constructing them.
Agents

• An agent is anything that can be


viewed as perceiving its
environment through sensors and
acting upon that environment
through actuators.
• Example
• A robotic agent might have
cameras and infrared range
finders for sensors and
various motors for actuators.
Percept and Agent Function

• Percept refers to the agent’s perceptual inputs at any given instant.


• Percept sequence is the complete history of everything the agent has ever
perceived.
• An agent’s choice of action at any given instant can depend on the entire percept
sequence observed to date, but not on anything it hasn’t perceived
• AGENT FUNCTION describes agent’s behaviour by mapping any given percept
sequence to an action.
EXAMPLE OF TRADING AGENT

RATES

NEWS Stock
Trading Agent Market

TRADES
Ai IN ROBOTICS

CAMERAS

MICROPHONE
ENVIRONMENT
Robotic Agent

MOTORS

VOICE
AI in medicine

Signs

Symptoms
Patient
Diagnostic Agent

Disease
Fully vs Partially Observable

Discriminant vs Stochastic
Types of task
Environment Discrete vs. Continuous

Benign vs Adversarial
Fully vs Partially observable
• A task environment is effectively fully observable if the sensors detect all aspects
that are relevant to the choice of action.
• Relevance depends on the defined performance measure.
• Fully observable environments are convenient because the agent need not
maintain any internal state to keep track of the world.
• An environment might be partially observable because of
• noisy and inaccurate sensors or because
• parts of the state are simply missing from the sensor data—
❑ Example: An automated taxi cannot see what other drivers are thinking.
• If the agent has no sensors at all then the environment is unobservable.
If the next state of the environment is
completely determined by the current
state and the action executed by the
agent, then we say the environment is
Deterministic deterministic; otherwise, it is stochastic.

vs. stochastic.
Taxi driving is clearly stochastic in this
sense, because one can never predict the
behaviour of traffic exactly.
The discrete/continuous distinction applies to
the state of the environment, to the way time
is handled, and to the percepts and actions of
the agent.

Discrete vs. For example, the chess environment has a


finite number of distinct states. Chess also
continuous has a discrete set of percepts and actions.

Taxi driving is a continuous-state and


continuous-time problem: the speed and
location of the taxi.
In benign environments, the environment
has no objective by itself that would
contradict your own objective.
• For example, when it rains it might ruin your plans
Benign vs to play cricket, but it doesn't rain just because rain
doesn't want you to play cricket. It does it through

Adversarial factors unrelated to your objective.

Adversarial environments on the other


hand do get out to get you.

• This is commonplace in games, such as video


games, where bosses and enemies are out to
destroy your plans of getting that high score, or in
chess where an AI would be out to checkmate you.
Different
Components
of an AI
System
Knowledge Representation
How can we represent knowledge?
• We need to create a logical view of the data, based on how we want to
process it
• Natural language is very descriptive but does not lend itself to efficient
processing.
• Three important messages are mentioned below
• Semantic networks
• Expert Systems
• Search trees

30
Semantic Networks
Semantic network
A knowledge representation technique that focuses on
the relationships between objects
A directed graph is used to represent a semantic
network or net

Remember directed
graphs?

31
Semantic Networks

32
Semantic Networks
What questions can you ask about the data
in previous slide?

What questions can you not ask?

33
Semantic Networks
Network Design
• The objects in the network represent the objects in the real world that we
are representing
• The relationships that we represent are based on the real-world questions
that we would like to ask
• That is, the types of relationships represented determine which questions
are easily answered, which are more difficult to answer, and which cannot be
answered

34
Expert Systems
Knowledge-based system
Software that uses a specific set of information, from which it extracts and
processes particular pieces
Expert system
A software system based on the knowledge of human experts; it is a
• Rule-based system A software system based on a set of if-then rules
• Inference engine The software that processes rules to draw conclusions

35
Expert Systems
Named abbreviations that represent conclusions
• NONE—apply no treatment at this time
• TURF—apply a turf-building treatment
• WEED—apply a weed-killing treatment
• BUG—apply a bug-killing treatment
• FEED—apply a basic fertilizer treatment
• WEEDFEED—apply a weed-killing and fertilizer combination treatment

36
Expert Systems
Boolean variables needed to represent state of the lawn
• BARE—the lawn has large, bare areas
• SPARSE—the lawn is generally thin
• WEEDS—the lawn contains many weeds
• BUGS—the lawn shows evidence of bugs

37
Expert Systems
Data that is available
• LAST—the date of the last lawn treatment
• CURRENT—current date
• SEASON—the current season

Now we can formulate some rules for our


gardening expert system.
Rules take the form of if-then statements

38
Expert Systems
Some rules
• if (CURRENT – LAST < 30) then NONE
• if (SEASON = winter) then not BUGS
• if (BARE) then TURF
• if (SPARSE and not WEEDS) then FEED
• if (BUGS and not SPARSE) then BUG
• if (WEEDS and not SPARSE) then WEED
• if (WEEDS and SPARSE) then WEEDFEED

39
Expert Systems
An execution of our inference engine
• System: Does the lawn have large, bare areas?
• User: No
• System: Does the lawn show evidence of bugs?
• User: No
• System: Is the lawn generally thin?
• User: Yes
• System: Does the lawn contain significant weeds?
• User: Yes
• System: You should apply a weed-killing and fertilizer
combination treatment.
40

You might also like