Artificial f Intelligence Intelligence

strawberrycokevilleΤεχνίτη Νοημοσύνη και Ρομποτική

7 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

73 εμφανίσεις

COMP  406Lecture 11
A
rti
f
icial

f
Intelligence
Intelligence
Fiona Yan Liu
Department of Computing
The Hong Kong Polytechnic University
LearningOutcomesofLecture10
Learning
 
Outcomes
?
of
?
Lecture
?
10
Kldb

K
now
l
e
d
ge 
b
ase

Knowledge based agent

—’—•
™‘”Ž†

—’—•
™‘”Ž†

Representation language

–ƒ‹Ž‡–

–ƒ‹Ž‡–

Inference

Query

Forward chaining

Backward chaining

‡ˆ‡”‡…‡”‡ƒ†‹

‡ˆ‡”‡…‡

”‡ƒ†‹

Chapter 7
Dec. 11, 2012Review of Artificial Intelligence
2
OutlineofLecture11
Outline
 
of
?
Lecture
?
11
Whflll

Wh
at is arti
f
icia
l
 inte
ll
igence

Problem solving by search agents

Classical search

Local search
fbl

Constraint satis
f
action pro
bl
em

Game
Illiiiibli

I
nte
lli
gence acqu
i
s
i
t
i
on 
b

l
earn
i
ng

Learning theory
Lithi

L
earn
i
ng 
t
ec
h
n
i
ques

Knowledge representation and query
Dec. 11, 2012Review of Artificial Intelligence
3
OutlineofLecture11
Outline
 
of
?
Lecture
?
11
Wh i ifiil illi

Wh
at
 i
s
 
慲a
楦i
c
i
a
l i
nte
lli
gence

Problem solving by search agents

Classical search

Local search
fbl

Constraint satis
f
action pro
bl
em

Game
Illiiiibli

I
nte
lli
gence acqu
i
s
i
t
i
on 
b

l
earn
i
ng

Learning theory
Lithi

L
earn
i
ng 
t
ec
h
n
i
ques

Knowledge representation and query
Dec. 11, 2012Review of Artificial Intelligence
4
WhatisArtificialIntelligence
What
 
is
?
Artificial
?
Intelligence
Atihl

A
c
ti
ng 
h
uman
l
y

Can machines behave intelligently like human

The Turing test

Thinking humanly
Scientific theories of internal activities of the brain

‘‹–‹˜‡•…‹‡…‡ƒ†‡—”‘•…‹‡…‡

‘‹–‹˜‡

•…‹‡…‡

ƒ†

‡—”‘•…‹‡…‡

Thinking rationally
Rationality is the ideal concept of intelligence
Littlewidelyacceptedconclusionhasbeenmade

Little
 
widely
 
accepted
 
conclusion
 
has
 
been
 
made

Action rationally

Doing the right thing

Which is expected to maximize goal achievement, given the 
available information
Dec. 11, 2012Review of Artificial Intelligence
5
What We Should Learning from This 
Course
Thinking humanly
Thinking rationally
ActingHumanly
Acting

Humanly
Actingrationally
Acting

rationally
Dec. 11, 2012Review of Artificial Intelligence
6
ActionRationally
Action
 
Rationally
Rtilt

R
a
ti
ona
l
 agen
t

An agent is an entity that perceives and acts

ƒ‡–‹•ƒˆ—…–‹‘ˆ”‘’‡”…‡’–Š‹•–‘”‹‡•–‘ƒ…–‹‘•ǣ



ƒ‡–

‹•

ƒ

ˆ—…–‹‘

ˆ”‘

’‡”…‡’–

Š‹•–‘”‹‡•

–‘

ƒ…–‹‘•ǣ
ȏf: P*A]

For any given class of environments and tasks, we seek 
tht(lft)iththbtf
th
e agen
t
 
(
or c
l
ass o
f
 agen
t
s
)
 w
ith
 
th

b
es
t
 per
f
ormance

PEAS of intelligent agent design

‡”ˆ‘”ƒ…‡‡ƒ•—”‡

‡”ˆ‘”ƒ…‡

‡ƒ•—”‡

Environment

Actuators

Sensors
Dec. 11, 2012Review of Artificial Intelligence
7
Learningobjectives
Learning
 
objectives
Uddhlfb

U
n
d
erstan
d
 t
h
e ro
l
e o
f
 
b
asic

Problem solving
Lihdiifiililli

L
earn
i
ng met
h
o
d

i
n art
ifi
c
i
a
l
 
i
nte
lli
gence

Knowledge representation
A

A
ssess 

The applicability, strengths, and weaknesses of different 
modelsinsolvingparticularproblems
models
 
in
 
solving
 
particular
 
problems

Develop 

–‡ŽŽ‹‡–•›•–‡•›ƒ••‡Ž‹•‘Ž—–‹‘•–‘…‘…”‡–‡

–‡ŽŽ‹‡–

•›•–‡•

›

ƒ••‡Ž‹

•‘Ž—–‹‘•

–‘

…‘…”‡–‡

…‘’—–ƒ–‹‘ƒŽ’”‘Ž‡•
Dec. 11, 2012Review of Artificial Intelligence
8
SubjectLearningOutcomes
Subject
 
Learning
?
Outcomes
Bikldftifiilitlli

B
as
i

k
now
l
e
d
ge o
f
 ar
tifi
c
i
a
l
 
i
n
t
e
lli
gence

Teaching approaches

‡ƒ”‡†ˆ”‘Ž‡…–—”‡

‡ƒ”‡†

ˆ”‘

Ž‡…–—”‡

Assessment methods
Quiz 30%
Filiti
45%

Fi
na
l
 exam
i
na
ti
on
45%

Basic skill of implementation 

‡ƒ…Š‹ƒ’’”‘ƒ…Š‡•

‡ƒ…Š‹

ƒ’’”‘ƒ…Š‡•

Learned from lab

Assessment methods

Group work with 1 –4 person(s) each group

Course project25%
Dec. 11, 2012Review of Artificial Intelligence
9
FinalExamination
Final
 
Examination
Glifti

G
enera
l
 
i
n
f
orma
ti
on

Time:Jan. 9  19:00 –21:00

Venue:QR403

Duration:2 hours

Close book

Calculator is 
p
ermitted 
(
stron
g
l
y
 encoura
g
ed
)
p(gyg)

Similar with quizzes

True or false20%

•™‡”–Š‡“—‡•–‹‘•
ͺͲΨ

•™‡”

–Š‡

“—‡•–‹‘•
ͺͲΨ

Matlabis not included

Office hour for final exam
91000
1200

Jan. 
9
 
10
:
00
 –
12
:
00

Jan. 9  14:30 –16:30
Dec. 11, 2012Review of Artificial Intelligence
10
OutlineofLecture11
Outline
 
of
?
Lecture
?
11
Whflll

Wh
at is arti
f
icia
l
 inte
ll
igence

Problem solving by search agents

Classical search

Local search
fbl

Constraint satis
f
action pro
bl
em

Game
Illiiiibli

I
nte
lli
gence acqu
i
s
i
t
i
on 
b

l
earn
i
ng

Learning theory
Lithi

L
earn
i
ng 
t
ec
h
n
i
ques

Knowledge representation and query
Dec. 11, 2012Review of Artificial Intelligence
11
ProblemSolvingbySearchAgent
Problem
 
Solving
?
by
?
Search
?
Agent
Soltion

Sol
u
tion

An action sequence

Search algorithm
Cidiiibli

C
ons
id
er
i
ng var
i
ous poss
ibl
e act
i
on sequences

Search tree
Nodes: states in the state space
l

Root: initia
l
 state

Branches: actions

Expanding the current state

Apply each legal action to the current state, thereby generating a new set of 
states

Add branches from the parent node leading to child nodes
Essenceofsearch

Essence
 
of
 
search

Following up one option now and putting the others aside for later

In case the first choice does not lead to a solution
Dec. 11, 2012Review of Artificial Intelligence
12
AssessSearchAgents
Assess
 
Search
?
Agents
Sh

S
earc
h
 strategy

Pick the order of node expansion

–”ƒ–‡‹‡•ƒ”‡‡˜ƒŽ—ƒ–‡†ƒŽ‘–Š‡ˆ‘ŽŽ‘™‹†‹‡•‹‘•ǣ

–”ƒ–‡‹‡•

ƒ”‡

‡˜ƒŽ—ƒ–‡†

ƒŽ‘

–Š‡

ˆ‘ŽŽ‘™‹

†‹‡•‹‘•ǣ

completeness: does it always find a solution if one exists?

time complexity: number of nodes generated

space complexity: maximum number of nodes in memor
y

optimality: does it always find a least‐cost solution?

‹‡ƒ†•’ƒ…‡…‘’Ž‡š‹–›ƒ”‡‡ƒ•—”‡†‹–‡”•‘ˆ

‹‡

ƒ†

•’ƒ…‡

…‘’Ž‡š‹–›

ƒ”‡

‡ƒ•—”‡†

‹

–‡”•

‘ˆ


b:maximum branching factor of the search tree

d: depth of the least‐cost solution

m: maximum depth of the state space (may be ∞)
Dec. 11, 2012Review of Artificial Intelligence
13
ClassicalSearchTechniques
Classical
 
Search
?
Techniques

Uninformedsearch

Uninformed
 
search

The strategies have no additional information about states 
beyond that provided in the problem definition

‡’–Š
ˆ‹”•–•‡ƒ”…Š

‡’–Š
Ǧ
ˆ‹”•–

•‡ƒ”…Š

Breadth‐first search

Uniform‐cost search

ˆ‘”‡†•‡ƒ”…Š

ˆ‘”‡†

•‡ƒ”…Š

The strategies know whether one non‐goal node is “more 
promising” than another


”‡‡†›‡•–
Ǧ
ˆ‹”•–•‡ƒ”…Š


”‡‡†›

‡•–
Ǧ
ˆ‹”•–

•‡ƒ”…Š

A* search

Admissible Heuristic

Anadmissibleheuristicneveroverestimatesthecosttoreachthe

An

admissible

heuristic

never

overestimates

the

cost

to

reach

the

goal

Domination of heuristic functions
Dec. 11, 2012Review of Artificial Intelligence
14
LocalSearch
Local
 
Search
Clilh

Cl
ass
i
ca
l
 searc
h

The search algorithms explore search space systematically

Š‡ƒ‘ƒŽ‹•ˆ‘—†–Š‡’ƒ–Š–‘–Š‡‘ƒŽƒŽ•‘…‘•–‹–—–‡•ƒ

Š‡

ƒ

‘ƒŽ

‹•

ˆ‘—†
ǡ
–Š‡

’ƒ–Š

–‘

–Š‡

‘ƒŽ

ƒŽ•‘

…‘•–‹–—–‡•

ƒ

•‘Ž—–‹‘–‘–Š‡’”‘Ž‡

Local search

Operate using a single current node

Generally move only to neighbors of that node

Local search techniques
Hill‐climbing search
Sildlih

Si
mu
l
ate
d
 annea
li
ng searc
h

Genetic algorithm
Dec. 11, 2012Review of Artificial Intelligence
15
ConstraintSatisfactionProblem
Constraint
 
Satisfaction
?
Problem
Ctittiftibl(CSP)

C
ons
t
ra
i
n
t
 sa
ti
s
f
ac
ti
on pro
bl
em 
(CSP)

State is defined by variables Xi
with values from domain 
Di

Goal test is a set of constraints specifying allowable combinations of 
ff
values 
f
or subsets o
f
 variables

CSP consists of three components
A set of variables

A set of domains

A set of constrains

‡ƒŽ‡•‘Ž—–‹‘•‘ˆ…‘’Ž‡š’”‘Ž‡•



‡ƒŽ‡

•‘Ž—–‹‘•

‘ˆ

…‘’Ž‡š

’”‘Ž‡•

Backtracking Search for Map‐Coloring

’”‘˜‡ƒ…–”ƒ…‹‡ˆˆ‹…‹‡…››—•‹…‘•–”ƒ‹–”ƒ’Š

’”‘˜‡

ƒ…–”ƒ…‹

‡ˆˆ‹…‹‡…›

›

—•‹

…‘•–”ƒ‹–

”ƒ’Š

Choose the variable with the fewest legal values

Given a variable, choose the least constraining value
Dec. 11, 2012Review of Artificial Intelligence
16
Game
Mltitit
Game
 

M
u
lti
agen
t
 env
i
ronmen
t

In which each agent needs to consider the actions of 
otheragents
other
 
agents
 

And how they affect its own welfare

Games

Views any multiagent environment as a game, provided 
that the impact of each agent on the other is significant
GamesinAI

Games
 
in
 
AI

The state of a game is easy to represent

‡–•ƒ”‡—•—ƒŽŽ›”‡•–”‹…–‡†–‘ƒ•ƒŽŽ—‡”‘ˆ

‡–•

ƒ”‡

—•—ƒŽŽ›

”‡•–”‹…–‡†

–‘

ƒ

•ƒŽŽ

—‡”

‘ˆ

ƒ…–‹‘•

Outcomes are defined by precise rules
Dec. 11, 201217
OutlineofLecture11
Outline
 
of
?
Lecture
?
11
Whflll

Wh
at is arti
f
icia
l
 inte
ll
igence

Problem solving by search agents

Classical search

Local search
fbl

Constraint satis
f
action pro
bl
em

Game
Itlli iiti b li

I
n
t
e
lli
gence
 
慣煵
i
s
楴i

 b
y
 l
earn
i
ng

Learning theory
Lithi

L
earn
i
ng 
t
ec
h
n
i
ques

Knowledge representation and query
Dec. 11, 2012Review of Artificial Intelligence
18
MachineLearning
Machine
 
Learning
Llfk

L
earning is essentia
l
 
f
or un
k
nown environments

Learning modifies the agent's decision mechanisms to 
improveperformance
improve
 
performance

Type of feedback:

Supervised learning
Uidli

U
nsuperv
i
se
d
 
l
earn
i
ng

Probably approximately correct learning
Aliliththtthththt

A
ny 
l
earn
i
ng a
l
gor
ith

th
a
t
 re
t
urns 
h
ypo
th
eses 
th
a
t
 are 
probably approximately correct is called a PAC learning 
al
g
orithm
g

Bound of number of training data: N≥ ln(|H|/δ)/ɛ
Dec. 11, 2012Review of Artificial Intelligence
19
LinearModels
Linear
 
Models
Uiit
lii

U
n
i
var
i
a
t
e
li
near regress
i
on 

Loss function: Loss(hw) = ∑
j(yj
–(w1xj+w0))2

Unique solution

Multivariate linear regression 
The solution that minimizes the squared-error loss is: w*= (XTX)-1XTy
Lilifiiihhdhhld

Li
near c
l
ass
ifi
cat
i
on w
i
t
h
 
h
ar
d
 t
h
res
h
o
ld

The loss function is undifferentiable, cannot obtain the optimal solution
Alasannoncesacompletelconfidentprediction

Al
w
a
y
s

anno
u
nces

a

completel
y
confident

prediction

Linear classification with logistic regression

h
(
x
)=
Logistic
(
w
T
x
)=1/(1+
e
-
w
T
x
)

h
w
(
x
)

=

Logistic
(
w
T
x
)

=

1/(1+
e
w
T
x
)

wi
← wi
+ α(y-hw(x))(1-hw(x))hw(x)xi
Dec. 11, 2012Review of Artificial Intelligence
20
SupportVectorMachine
Support
 
Vector
?
Machine

Examples closest to the hyperplaneare support
vectors

Linear SVM

卥敫瑨tm慸業慬浡牧楮扥瑷敥b獵灰潲sv散瑯牳

卥敫

瑨t

浡硩浡m

浡牧楮

扥瑷敥b

獵灰潲s

癥捴潲v

晲潭⁤楦晥牥湴⁣污獳敳

乯湬楮敡N卖S

乯湬楮敡N

卖S

the original feature space can be mapped to some
hih
diilftlil
bl

g
h
敲e

浥湳
i
潮o
l

f

t
畲攠獰慣攠

湥慲
l
礠separa
bl
e

The kernel function
Dec. 11, 2012Review of Artificial Intelligence
21
NeuralNetworks
Neural
 
Networks
Anartificialneuralnetworkiscomposedofmanyartificialneurons

An
 
artificial
 
neural
 
network
 
is
 
composed
 
of
 
many
 
artificial
 
neurons
 
that are linked together according to a specific network architecture. 

The objective of the neural network is to transform the inputs into 
meaningfuloutputs
meaningful
 
outputs
.
x
1
1
w
In
Output
1
2
x
x
1
2
w
puts
Out
y
2
3
x
1
3
w
4
x
1
4
w
Dec. 11, 2012Review of Artificial Intelligence
22
DecisionTree
Decision
 
Tree
Ehitdttttibt

E
ac
h
 
i
n
t
erno
d
es 
t
es
t
 an a
tt
r
ib
u
t
e

Each branch corresponds a attribute value

Each leave node assi
g
ns a classification
g
Dec. 11, 2012Review of Artificial Intelligence
23
BayesianNetworks
Bayesian
 
Networks

Bayesiantheorem

Bayesian
 
theorem

ƒ›‡•
ǯ
”—Ž‡

ƒ›‡•

”—Ž‡








x
x
pP
P
CC
C
|
|


Causalinference
If i
s
 
c
l
oudy
,
 wh
at
 i
s
 
t
h
e
 




x
p
|
•…‘—†›
?ზ•–‡
’”‘„ƒ„‹Ž‹–›?–Šƒ–?–Š‡?‰”ƒ••?‹•?™‡–?ë

Diagnostic inference
Knoingthatthegrassiset

Kno
w
ing
 
that
 
the
 
grass
 
is
 w
et

what is the probability that 
cloudyis the cause?
Dec. 11, 2012Review of Artificial Intelligence
24
OutlineofLecture11
Outline
 
of
?
Lecture
?
11
Whflll

Wh
at is arti
f
icia
l
 inte
ll
igence

Problem solving by search agents

Classical search

Local search
fbl

Constraint satis
f
action pro
bl
em

Game
Illiiiibli

I
nte
lli
gence acqu
i
s
i
t
i
on 
b

l
earn
i
ng

Learning theory
Lithi

L
earn
i
ng 
t
ec
h
n
i
ques

Knowledge representation and query
Dec. 11, 2012Review of Artificial Intelligence
25
Knowledge Representation and 
Query
Kldb

K
now
l
e
d
ge 
b
ase

A set of sentences expressed in  a language called 
knowledgerepresentationlanguage
knowledge
 
representation
 
language

Inference
Derivenewsentencesfromold

Derive
 
new
 
sentences
 
from
 
old

A sentence αentails another sentence βif βis true in all worlds 
where αis true

Tell: add new sentences to the knowledge base

Ask: query what is known

Forward chaining

Backward chaining
Dec. 11, 2012Review of Artificial Intelligence
26