While Mamdani (from Lecture 6) outputs fuzzy shapes that need to be geometrically "defuzzified," the Takagi-Sugeno model uses mathematical linear equations to determine the output of each rule. This makes it highly efficient and very popular in machine learning algorithms.
This is a breakdown of the 6-layer ANFIS architecture and the step-by-step numerical example covered in the slides.
The 6-Layer ANFIS Architecture
Unlike the 5-layer Mamdani model, ANFIS uses 6 layers to process the data:
-
Layer 1 (Input Layer): Passes the crisp inputs forward unchanged using a linear transfer function.
-
Layer 2 (Fuzzification Layer): Calculates the membership values (
) for the inputs based on their respective linguistic terms (e.g., Low, High). -
Layer 3 (Firing Strength): Key Difference from Mamdani. Instead of taking the minimum value, this layer calculates the product (multiplication) of the
values to determine the firing strength ( ) of each rule. -
Layer 4 (Normalization): Calculates the normalized firing strength (
) by dividing a rule's strength by the total sum of all firing strengths. -
Layer 5 (Rule Output): Applies the first-order Sugeno equation to calculate the actual output (
) of each specific rule: (where are predefined coefficients). It then multiplies this output by the normalized firing strength from Layer 4. -
Layer 6 (Overall Output): Sums up all the weighted outputs from Layer 5 to produce the final single crisp number.
Step-by-Step Numerical Example Walkthrough
We want to find the deviation in prediction for a specific training scenario.
The Setup:
-
Inputs:
, . -
Target Output:
. -
Base Widths (
): Using the provided min-max normalization formula on the normalized weights ( and ), the real base widths are calculated as and .
Layer 1
The inputs pass directly through.
Layer 2 (Fuzzification)
Based on the modified right-angled triangle graphs (using the calculated
-
For
: -
-
For
: -
Layer 3 (Firing Strengths)
We multiply the membership values to find the strength (
-
(LW and SM) = -
(LW and LR) = -
(H and SM) = -
(H and LR) =
Layer 4 (Normalization)
We normalize the weights by dividing each
(Note: Because of how these specific triangles are structured, the sum of
Layer 5 (Rule Outputs)
First, we use the rule coefficients (
Next, Layer 5 multiplies these rule outputs by their respective normalized firing strengths:
Layer 6 (Final Calculation)
The overall predicted output is simply the sum of the Layer 5 values:
Finally, to find the deviation in prediction, we subtract our predicted output from the known target output:
-
Target Output =
-
Predicted Output =
-
Deviation: