Professional Documents
Culture Documents
Lecture17 PDF
Lecture17 PDF
▫ ANFIS Architecture
▫ Hybrid Learning Algorithm
▫ Learning Methods that Cross-Fertilize ANFIS and
RBFN
▫ ANFIS as a universal approximator
What is ANFIS?
Forward Backward
pass pass
Premise Gradients
Fixed
parameters descent
Consequent Least-squares
Fixed
Parameters estimator
A1: 1 B1: 1
A1 ( x) B1 ( y ) f 1 0.1x 0.1 y 0.1
x 1
2
y2
2
1 1
2
2
B2:
A2: 1 1
A2 ( x) B 2 ( y) f 2 10 x 10 y 10
y 14
2
x9
2
1 1
2 2
f1=0.1x+0.1y+0.1
f2=10x+10y+10
x y
Example
THEN
f1=0.1x+0.1y+0.1
0.5 0.5
f2=10x+10y+10
0.1
0.039
x=3 y=4
Example
0.25
x=3
3 A1 0.5
0.25 W1=
0.25+0.0039
x=3 A2 N
W1=0.985
0.5
0.0039
0.1 0.0039 W2=
y=4 B1 0.25+0.0039
N
W2=0.0154
=0 0154
y=4 B2 0.039
Example
W1=0.985
N w1f1=(0.985)x(0.1x3+0.1x4+0.1)=0.788
W2=0.0154
N w2f2=(0.0154)x(10x3+10x4+10)=1.232
Example
0.7877
0.7877+1.232 = 2.0197
O = 2.0197
1.232
What if “T-norm” is taken at layer 2
to perform AND operation
5
0.5
x=3 A1 0.5
W1=
0.5 0.5+0.039
min N
x=3
3 A2
W1=0.9276
6
0.5
0 039
0.039
0.1 W2=
y=4 B1 0.039 0. 5+0.039
min N
0.039 W2=0.0724
y=4 B2
W2=0.0724
N w2f2=(0.0724)x(10x3+10x4+10)=5.7920
LAYER 3 LAYER 4
What if “T-norm” is taken at layer 2
to perform AND operation
0.7421
0.7421+5.7920 = 6.5341
O = 6.5341
5.7920
LAYER 4 LAYER 5
Gradient Descent learning for ANFIS
F wi f i
i wi f i i=1,2,3, …R # of rules
F is the calculated/estimated output value
i w i i (by ANFIS)
y the condition of ε-
• These MFs satisfy
completeness with ε = 0.5
▫ Given a value x of one of the inputs, we can
always
l find
f d a linguistic
l label
l b l A that
h μA ≥ ε
• This helps the smoothness
• ε-completeness
ε completeness can also be maintained during
the optimization process
Extensions of ANFIS
p
• ε-completeness ensures that for anyy ggiven value
of an input variable, there is at least a MF with a
grade greater or equal to ε
• This guarantees that the whole input space is
covered properly if ε is greater than zero
• ε-completeness
l t can b
be maintained
i t i d byb the
th
constrained gradient descent
More on ANFIS
y
• Moderate fuzzyness: g
within most regions of the
input space, there should be a dominant fuzzy
if-then rule with a firing strength close to unity
that
h accounts forf theh final
f l output
• This preserve MFs from too much overlap and
make the rule set more informative
• This eliminate the cases where one MFs goes
under the other one
More on ANFIS
sin( x) sin( y )
z sin c( x, y )
xyy
Initial
membershipp
functions
Final
(trained)
membership
functions
after 100
epochs
Example
Function approximation using ANFIS
In this example, an ANFIS is used to follow a
trajectory of the non-linear
non linear function defined by
the equation
cos(2
( x1 )
y
e x2
First, we choose an appropriate architecture for
First
the ANFIS. An ANFIS must have two inputs – x1
and x2 – and one output – y.
Thus, in our example, the ANFIS is defined by
four
ou rules,
u es, a
and
d has
as tthe
e st
structure
uctu e sshown
o be
below.
o
An ANFIS model with four rules
y 1
Layer y 2
Layer y 3
Layer y 4
Layer y 5
Layer
x1 x2
A1 1 N1 1
x1
A2 2 N2 2
y
B1 3 N3 3
x2
B2 4 N4 4
Function approximation using ANFIS
-1
1
-2
-3
3
1
0.5 10
8
0
6
-0.5
0.5 4
2
-1 0
x2 x1
Learning in an ANFIS with two MFs
assigned to each input (100 epochs)
y
Training Data
2 ANFIS Output
-1
-2
-3
1
0.5 10
8
0
6
-0.5 4
2
-1 0
x2 x1
So,, ...
2 N2 2
x1
A2
3 N3 3
A3 4 N4 4
y
5 N5 5
B1 6 N6 6
7 N7 7
x2
B2
8 N8 8
B3 9 N9 9
Learning in an ANFIS with three MFs
assigned to each input (1 epoch)
y
Training Data
2 ANFIS Output
-1
1
-2
-3
3
1
0.5 10
8
0
6
-0.5
0.5 4
2
-1 0
x2 x1
Learning in an ANFIS with two MFs
assigned to each input (100 epochs)
y
Training Data
2 ANFIS Output
-1
-2
-3
1
0.5 10
8
0 6
-0.5 4
2
-1 0
x2 x1
Initial and final membership functions of
the ANFIS
1 1
08
0.8 08
0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 1 2 3 4 5 6 7 8 9 10 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x1 x2
(a) Initial membership functions.
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 1 2 3 4 5 6 7 8 9 10 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
x1 x2
(b) Membership functions after 100 epochs of training.
Key Features of Different Modeling
Tools
Model Can resist Explains Suits small Can be adjusted Reasoning Suits complex Include
Technique
free outliers output data sets for new data process is visible models known facts
Least squares
regression
Neural networks
Fuzzy Systems
ANFIS
Yes
No
Partially
An outlying
y g observation, or outlier, is one that appears
pp to deviate
markedly from other members of the sample in which it occurs.
• JJ-S
S R Jang and C T Sun,
C-T Sun Neuro Fuzzy
Neuro-Fuzzy
and Soft Computing, Prentice Hall, 1997
(Chapter 12)
12).