neuro-fuzzy control adriano joaquim de oliveira cruz nce/ufrj [email protected]
Post on 21-Dec-2015
219 views
TRANSCRIPT
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 2
Neuro-Fuzzy SystemsNeuro-Fuzzy Systems
Usual neural networks that simulate Usual neural networks that simulate fuzzy systemsfuzzy systems
Introducing fuzziness into neuronsIntroducing fuzziness into neurons
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 3
ANFIS architectureANFIS architecture
Adaptive Neuro Fuzzy Inference Adaptive Neuro Fuzzy Inference SystemSystem
Neural system that implements a Neural system that implements a Sugeno Fuzzy model.Sugeno Fuzzy model.
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 4
Sugeno Fuzzy ModelSugeno Fuzzy Model
A typical fuzzy rule in a Sugeno fuzzy model A typical fuzzy rule in a Sugeno fuzzy model has the formhas the form
If If xx is is AA and and yy is is BB then then zz = = f(x,y)f(x,y) AA and B and B are fuzzy sets in the antecedent.are fuzzy sets in the antecedent. z=f(x,y)z=f(x,y) is a crisp function in the consequent.is a crisp function in the consequent. Usually Usually zz is a polynomial in the input is a polynomial in the input
variables variables xx and and yy.. When When zz is a first-order polynomial the system is a first-order polynomial the system
is called a first-order Sugeno fuzzy model.is called a first-order Sugeno fuzzy model.
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 5
Sugeno Fuzzy ModelSugeno Fuzzy Model
x y
x y
w1
w2
A2
A1 B1
B2
z1=p1x+q1y+r1
z2=p2x+q2y+r2
21
2211
wwzwzw
z
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 6
Sugeno First Order ExampleSugeno First Order Example
If If xx is is smallsmall then then yy = 0.1 = 0.1xx + 6.4 + 6.4 If If xx is is medianmedian then then yy = -0.5 = -0.5xx + 4 + 4 If If xx is is largelarge then then y y = = xx – 2 – 2
Reference: J.-S. R. Jang, C.-T. Sun and E. Mizutani, Reference: J.-S. R. Jang, C.-T. Sun and E. Mizutani, Neuro-Fuzzy and Neuro-Fuzzy and Soft ComputingSoft Computing
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 7
Comparing Fuzzy and CrispComparing Fuzzy and Crisp
-10 -5 0 5 100
0.2
0.4
0.6
0.8
1
X
Mem
bers
hip
Gra
des small medium large
(a) Antecedent MFs for Crisp Rules
-10 -5 0 5 100
2
4
6
8
X
Y
(b) Overall I/O Curve for Crisp Rules
-10 -5 0 5 100
0.2
0.4
0.6
0.8
1
X
Mem
bers
hip
Gra
des small medium large
(c) Antecedent MFs for Fuzzy Rules
-10 -5 0 5 100
2
4
6
8
X
Y
(d) Overall I/O Curve for Fuzzy Rules
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 8
Sugeno Second Order ExampleSugeno Second Order Example
If If xx is is smallsmall and and yy is is smallsmall then then zz = - = -xx + + yy +1 +1 If If xx is is smallsmall and and yy is is largelarge then then zz = - = -yy + 3 + 3 If If xx is is largelarge and and y y is is smallsmall then z = - then z = -xx + 3 + 3 If If xx is is largelarge and and yy is is largelarge then then zz = = xx + + yy + 2 + 2
Reference: J.-S. R. Jang, C.-T. Sun and E. Mizutani, Reference: J.-S. R. Jang, C.-T. Sun and E. Mizutani, Neuro-Fuzzy and Neuro-Fuzzy and Soft ComputingSoft Computing
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 9
Membership FunctionsMembership Functions
-5 -4 -3 -2 -1 0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
X
Mem
bers
hip
Gra
des Small Large
-5 -4 -3 -2 -1 0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
Y
Mem
bers
hip
Gra
des Small Large
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 10
Output SurfaceOutput Surface
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 11
ANFIS ArchitectureANFIS Architecture
Output of the Output of the iith node in the th node in the ll layer is layer is denoted as denoted as OOl,il,i
A1
A2
B1
B2
x
y
Layer 1 Layer 3Layer 2 Layer 4 Layer 5
x y
x yw1
w2
1w
2w
11 fw
22 fw
fO1,2
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 12
ANFIS Layer 1ANFIS Layer 1
Layer 1: Node function isLayer 1: Node function is
xx and and yy are inputs. are inputs. AAii and and BBii are labels (e.g. small, large). are labels (e.g. small, large). (x)(x) can be any parameterised membership can be any parameterised membership
function.function. These nodes are adaptive and the These nodes are adaptive and the
parameters are called premise parameters.parameters are called premise parameters.
4,3for)(
or2,1for),(
2,1
,1
iyO
ixO
i
i
Bi
Ai
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 13
ANFIS Layer 2ANFIS Layer 2
Every node output in this layer is defined as:Every node output in this layer is defined as:
T is T-norm operator.T is T-norm operator. In general, any T-norm that perform fuzzy In general, any T-norm that perform fuzzy
AND can be used, for instance minimum and AND can be used, for instance minimum and product.product.
These are fixed nodes.These are fixed nodes.
2,1for),(T)(,2 iyxwOii BAii
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 14
ANFIS Layer 3ANFIS Layer 3
The ith node calculates the ratio of the ith The ith node calculates the ratio of the ith rule’s firing strength to the sum of all rules’ rule’s firing strength to the sum of all rules’ firing strengthfiring strength
Outputs of this layer are called normalized Outputs of this layer are called normalized firing strengths.firing strengths.
These are fixed nodes.These are fixed nodes.
2,1for21
,3
iww
wwO iii
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 15
ANFIS Layer 4ANFIS Layer 4
Every Every iith node in this layer is an adaptive th node in this layer is an adaptive node with the functionnode with the function
Outputs of this layer are called normalized Outputs of this layer are called normalized firing strengths.firing strengths.
ppii, , qqii and and rrii are the parameter set of this node are the parameter set of this node
and they are called consequent parameters.and they are called consequent parameters.
2,1for)(,4 iryqxpwfwO iiiiiii
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 16
ANFIS Layer 5ANFIS Layer 5
The single node in this layer calculates The single node in this layer calculates the overall output as a summation of all the overall output as a summation of all incoming signals.incoming signals.
i
ii
iii
ii w
fwfwO 1,5
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 17
ANFIS Layer 5ANFIS Layer 5
Every Every iith node in this layer is an th node in this layer is an adaptive node with the functionadaptive node with the function
Outputs of this layer are called Outputs of this layer are called normalized firing strengths.normalized firing strengths.
2,1for)(,4 iryqxpwfwO iiiiiii
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 18
Alternative StructuresAlternative Structures
The structure is not unique.The structure is not unique.
For instance layers 3 and 4 can be For instance layers 3 and 4 can be combinedcombined or w or weight normalisation can eight normalisation can be performed at the last layer.be performed at the last layer.
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 19
Alternative Structure cont.Alternative Structure cont.
A1
A2
B1
B2
x
y
w1
w2
fO1,2
11 fw
12 fw
ii fw
iw
Layer 1 Layer 2 Layer 5Layer 3
x y
x y
Layer 4
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 20
Training AlgorithmTraining Algorithm
The function f can be written asThe function f can be written as
There is a hybrid learning algorithm There is a hybrid learning algorithm based on the least-squares method and based on the least-squares method and gradient descent.gradient descent.
)()( 22221111
221
21
21
1
ryqxpwryqxpwf
fww
wf
www
f
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 21
Example Example
Modeling the functionModeling the function
Input range [-10,+10]x[-10,+10]Input range [-10,+10]x[-10,+10] 121 training data pairs121 training data pairs 16 rules, with four membership functions 16 rules, with four membership functions
assigned to each input.assigned to each input. Fitting parameters = 72; 24 premise and 48 Fitting parameters = 72; 24 premise and 48
consequent parameters.consequent parameters.
xyyx
z)sin()sin(
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 22
Initial and Final MFsInitial and Final MFs
-10 -5 0 5 10
0
0.2
0.4
0.6
0.8
1
input1
Deg
ree
of m
embe
rshi
p
Initial MFs on X
-10 -5 0 5 10
0
0.2
0.4
0.6
0.8
1
input2
Deg
ree
of m
embe
rshi
p
Initial MFs on Y
-10 -5 0 5 10
0
0.2
0.4
0.6
0.8
1
input1
Deg
ree
of m
embe
rshi
p
Final MFs on X
-10 -5 0 5 10
0
0.2
0.4
0.6
0.8
1
input2
Deg
ree
of m
embe
rshi
p
Final MFs on Y
*@2001 Adriano Cruz *NCE e IM - UFRJ Neuro-Fuzzy 23
Training DataTraining Data
-100
10
-100
10
0
0.5
1
X
Training data
Y -100
10
-100
10
0
0.5
1
X
ANFIS Output
Y
0 50 1000
0.05
0.1
0.15
0.2
epoch number
root
mea
n sq
uare
d er
ror
error curve
0 50 1000.1
0.15
0.2
0.25
0.3
0.35
epoch number
step
siz
e
step size curve