the neuro fuzzy sistem modify the membership function in input or in output?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, I wanted to understand what happens to the membership function (in input/output) or rules when I insert in the anfis editor: Sugeno file and a training set.
댓글 수: 0
답변 (1개)
Sam Chak
2024년 9월 28일
In the following simple example, the ANFIS is trained to fit a trapezoidal set-based fuzzy system to the input/output data of an ideal saturation function. We can clearly observe that both the initial trapezoidal input membership function (MF) and the constant output MF are slightly different from the final trapezoidal input MF and constant output MF. ANFIS will update the parameters of both the input and output membership functions.
%% data
x = (-1:0.01:1)';
y = min(max(-5*x, -1), 1); % <-- ideal saturation function
genOpt = genfisOptions('GridPartition');
genOpt.NumMembershipFunctions = 2;
genOpt.InputMembershipFunctionType = 'trapmf';
genOpt.OutputMembershipFunctionType = 'constant';
inFIS = genfis(x,y,genOpt);
showrule(inFIS)
opt = anfisOptions('InitialFIS', inFIS, 'EpochNumber', 50);
opt.DisplayANFISInformation = 0;
opt.DisplayErrorValues = 0;
opt.DisplayStepSize = 0;
opt.DisplayFinalResults = 0;
outFIS = anfis([x y],opt);
%% plot result
figure
subplot(211)
plotmf(inFIS, 'input', 1), grid on
title('inFIS Input Fuzzy Sets')
subplot(212)
plot(x, [y, evalfis(inFIS, x)]), grid on, ylim([-1.2, 1.2])
title('Compare Data with Untrained ANFIS Output')
legend('Data', 'Untrained ANFIS Output')
inFIS.inputs(1).MembershipFunctions(1).Name
inFIS.inputs(1).MembershipFunctions(1).Type
inFIS.inputs(1).MembershipFunctions(1).Parameters
inFIS.Outputs(1).MembershipFunctions(1).Name
inFIS.Outputs(1).MembershipFunctions(1).Type
inFIS.Outputs(1).MembershipFunctions(1).Parameters
figure
subplot(211)
plotmf(outFIS, 'input', 1), grid on
title('outFIS Input Fuzzy Sets')
subplot(212)
plot(x, [y, evalfis(outFIS, x)]), grid on, ylim([-1.2, 1.2])
title('Compare Data with Trained ANFIS Output')
legend('Data', 'Trained ANFIS Output')
outFIS.inputs(1).MembershipFunctions(1).Name
outFIS.inputs(1).MembershipFunctions(1).Type
outFIS.inputs(1).MembershipFunctions(1).Parameters
outFIS.Outputs(1).MembershipFunctions(1).Name
outFIS.Outputs(1).MembershipFunctions(1).Type
outFIS.Outputs(1).MembershipFunctions(1).Parameters
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!