310 likes | 437 Views
CS 621 Artificial Intelligence Lecture 8 - 19/08/05 Prof. Pushpak Bhattacharyya. Fuzzy Logic Application. NLP -> Fuzzy Logic. Language statements imprecise Linguistic variable -> Adjective Hedges -> Adverb. Example Problem.
E N D
CS 621 Artificial IntelligenceLecture 8 - 19/08/05Prof. Pushpak Bhattacharyya Fuzzy Logic Application Prof. Pushpak Bhattacharyya, IIT Bombay
NLP -> Fuzzy Logic Language statements imprecise Linguistic variable -> Adjective Hedges -> Adverb Prof. Pushpak Bhattacharyya, IIT 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. Prof. Pushpak Bhattacharyya, IIT 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 truec) X is more of less old or highly educated is fairly true Prof. Pushpak Bhattacharyya, IIT Bombay
Example (Contd 2) d) X is very heavy or old or not highly educated is fairly truee) 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) Prof. Pushpak Bhattacharyya, IIT Bombay
Basic Profile Prof. Pushpak Bhattacharyya, IIT Bombay
To Adjust For Different Linguistic Variables Prof. Pushpak Bhattacharyya, IIT Bombay
To Find k1 and k2 we need < x1, y1 > , <x2, y2> x1 = 0 y1 = 0.01 x2 = ? y2 = 0.99 Prof. Pushpak Bhattacharyya, IIT 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 = α Prof. Pushpak Bhattacharyya, IIT 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 Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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 Prof. Pushpak Bhattacharyya, IIT Bombay
Solving for k1 & k2 (Contd 3) k2 = x2 /2 k1 = 9.2 / x2 k2 = x2 / 2 Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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 )) Prof. Pushpak Bhattacharyya, IIT Bombay
Old 1/(1+e-k1(x-k2)) Tall Heavy Educated Prof. Pushpak Bhattacharyya, IIT Bombay
True y = 1/(1+e-k1(x-k2)) k1 and k2 values are chosen arbitrarily Prof. Pushpak Bhattacharyya, IIT Bombay
μ for Different Configurations - 1 a) X is highly educated and not very young is very true l = Level of education μ2true (μ) μ = min [μ2educated (l), 1- ( 1- μold(age)) ) 2 Prof. Pushpak Bhattacharyya, IIT 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) Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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)) Prof. Pushpak Bhattacharyya, IIT 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) ] Prof. Pushpak Bhattacharyya, IIT Bombay
Question : How to actually read off values John: age: 35 ht : 5.8’ wt : 75 Kg education l : College Prof. Pushpak Bhattacharyya, IIT Bombay
Fuzzy Inferencing Closely related to Fuzzy Expert Systems Expert Systems: Rules : Antecedent Consequent p q p1 p2 p3 …. Pn qi Prof. Pushpak Bhattacharyya, IIT Bombay
Inferencing Inferencing Forward Chaining Backward Chaining Supposed to prove the fact F Prof. Pushpak Bhattacharyya, IIT 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. Prof. Pushpak Bhattacharyya, IIT 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. Prof. Pushpak Bhattacharyya, IIT Bombay
Fuzzy Expert System Rules are in forms of linguistic variables. Example of “Inverted pendulum control” Prof. Pushpak Bhattacharyya, IIT Bombay