# ARTIFICIAL INTELLIGENCE

Document Sample

```					           CS 621 Artificial Intelligence

Lecture 8 - 19/08/05

Prof. Pushpak Bhattacharyya
Fuzzy Logic Application

19-08-05           Prof. Pushpak Bhattacharyya, IIT   1
Bombay
NLP -> Fuzzy Logic
Language statements imprecise
Linguistic variable -> Adjective

19-08-05           Prof. Pushpak Bhattacharyya, IIT   2
Bombay
Example Problem
Assume 4 types of Fuzzy Predicates applicable to
persons (age, height, weight and level of education).
The membership functions are of the basic form
1/(1+e-x), but of appropriate shape and orientation.

19-08-05           Prof. Pushpak Bhattacharyya, IIT        3
Bombay
Example (Contd 1)
Determine the truth values of :
a) A person X is highly educated and not very young
is very true.
b) X is very young, tall, not heavy and somewhat
educated is true
c) X is more of less old or highly educated is fairly
true

19-08-05           Prof. Pushpak Bhattacharyya, IIT       4
Bombay
Example (Contd 2)
d) X is very heavy or old or not highly educated is
fairly true

e) X is short, not very young and highly educated is
very true

( assume that the level of education has 4 values:
Elementary school, High school, College, PHD)

19-08-05            Prof. Pushpak Bhattacharyya, IIT      5
Bombay
Basic Profile

19-08-05   Prof. Pushpak Bhattacharyya, IIT   6
Bombay
To Adjust For Different Linguistic
Variables

19-08-05   Prof. Pushpak Bhattacharyya, IIT   7
Bombay
To Find k1 and k2 we need
< x1, y1 > , <x2, y2>

x1 = 0 y1 = 0.01 x2 = ? y2 = 0.99
19-08-05           Prof. Pushpak Bhattacharyya, IIT   8
Bombay
Finding α
y = 1/(1+e-k1(x-k2))

=> (1-y)/y = e-k1(x-k2)

=> k1(x - k2) = ln(y/1-y)

call y/1-y = α

19-08-05               Prof. Pushpak Bhattacharyya, IIT   9
Bombay
Solving for k1 & k2
k1(x-k2) = ln α
So, k1 x – k1 k2 = ln α

at < x1, y1 >

k1 x1 – k1 k2 = ln α1      --- (1)
where α1 = y1/1-y1

19-08-05           Prof. Pushpak Bhattacharyya, IIT   10
Bombay
Solving for k1 & k2 (Contd 1)
k1 x2 - k1 k2 = ln α2               ---(2)
α2 = y2 / 1- y2
Solving from k1 and k2
k1 = (1/(x2- x1) ) ln ( ((1-y1)/y1)/((1-y2)/y2))

19-08-05             Prof. Pushpak Bhattacharyya, IIT   11
Bombay
Solving for k1 & k2 (Contd 2)
k2 = x2 – (ln α2) / k1
Lets use x1= 0, y1= 0.01, x2=?, y2= 0.99

k1         = 2/x2 ln 99
= 2* 4.6 / x2
= 9.2 /x2

19-08-05                   Prof. Pushpak Bhattacharyya, IIT   12
Bombay
Solving for k1 & k2 (Contd 3)
k2 = x2 /2

k1 = 9.2 / x2
k2 = x 2 / 2

19-08-05        Prof. Pushpak Bhattacharyya, IIT   13
Bombay
Profile of Old
x1 = 0, y1 = 0.01
x2 = 80 yrs
y2 = 0.99
k1 = 9.2 / 80 = 0.1
k2 = 40

Profile of old y = 1/(1+e - 0.1(x - 40))

19-08-05              Prof. Pushpak Bhattacharyya, IIT   14
Bombay
Profile of Tall
x1 = 0, y1 = 0.01
x2 =6ft, y2 = 0.99

k1 = 9.2 / 6 = 1.5
k2 = 6/2 = 3

Profile of Tall, y = 1/(1+e -1.5(x - 3))

19-08-05              Prof. Pushpak Bhattacharyya, IIT   15
Bombay
Profile of Heavy
x1 = 0, y1 = 0.01
x2 = 100kg yrs, y2 = 0.99

k1 = 9.2 / 100 = 0.1
k2 = 100/2 = 50

Profile of Heavy, y = 1/(1+e - 0.1(x - 50))

19-08-05             Prof. Pushpak Bhattacharyya, IIT   16
Bombay
Profile of Educated
school = 0.25,
high School = 0.5,
college 0.75,
PhD = 1.00

x1 = 0, y1 = 0.01, x2 =1 yrs, y2 = 0.99

Profile:
y = 1/(1+e - 9.2 (x – 0.5 ))

19-08-05                Prof. Pushpak Bhattacharyya, IIT   17
Bombay
Old                                        1/(1+e-k1(x-k2))

Tall

Heavy

Educated

19-08-05      Prof. Pushpak Bhattacharyya, IIT                  18
Bombay
True
y = 1/(1+e-k1(x-k2))

k1 and k2 values are chosen arbitrarily

19-08-05               Prof. Pushpak Bhattacharyya, IIT   19
Bombay
μ for Different Configurations - 1
a) X is highly educated and not very young is very
true
l = Level of education
μ 2true (μ)
2
μ = min [μ educated (l), 1- ( 1- μold(age) ) )
2

19-08-05           Prof. Pushpak Bhattacharyya, IIT     20
Bombay
μ for Different Configurations - 2
b) X is very young, tall, not heavy and somewhat
educated is true
μ true (μ)

μ = min ( ( 1 - μold(age))2, μtall(ht), 1- μ heavy(wt),
(μedu(L))1/2)

19-08-05              Prof. Pushpak Bhattacharyya, IIT      21
Bombay
μ for Different Configurations - 3
c) X is more or less old or highly educated is fairly
true

(μtrue(μ ))1.5

μ = max ( (μold(age))1/2, μ2edu (l))

19-08-05            Prof. Pushpak Bhattacharyya, IIT      22
Bombay
μ for Different Configurations - 4
d) X is very heavy or old or not highly educated is fairly
true

(μ true(μ) )1.5

μ = max (μold(age), μ2heavy(wt ), 1 - μ2edu (l))

19-08-05            Prof. Pushpak Bhattacharyya, IIT    23
Bombay
μ for Different Configurations - 5

e) X is short, not very young and highly educated is
very true
μ2true(μ)

μ = min [1 – (1 - μ old(age))2, μ2edu (l), 1 - μtall(ht) ]

19-08-05              Prof. Pushpak Bhattacharyya, IIT         24
Bombay
Question : How to actually read off
values
John:
age: 35

ht : 5.8’

wt : 75 Kg

education l : College

19-08-05        Prof. Pushpak Bhattacharyya, IIT   25
Bombay
19-08-05   Prof. Pushpak Bhattacharyya, IIT   26
Bombay
Fuzzy Inferencing
Closely related to Fuzzy Expert Systems

Expert Systems:
Rules :

Antecedent               Consequent
p                        q

p1 p2 p3 …. Pn                              qi
19-08-05                Prof. Pushpak Bhattacharyya, IIT   27
Bombay
Inferencing
Inferencing

Forward Chaining                   Backward Chaining

Supposed to prove the fact F

19-08-05        Prof. Pushpak Bhattacharyya, IIT         28
Bombay
Forward Chaining
( Data Driven)

Given Facts are matched with LHS of rules

RHS of satisfied rules are added to the fact base

Stop when the required F comes to the fact base.

19-08-05         Prof. Pushpak Bhattacharyya, IIT   29
Bombay
Backward Chaining
( Goal Driven)

Start from F to see if it matches the RHS of any
rule.

LHS of matched Rule becomes the new goal.

Stop when a fact is hit.

19-08-05         Prof. Pushpak Bhattacharyya, IIT   30
Bombay
Fuzzy Expert System

Rules are in forms of linguistic variables.

Example of “Inverted pendulum control”

19-08-05        Prof. Pushpak Bhattacharyya, IIT   31
Bombay

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 2 posted: 11/4/2012 language: English pages: 31