Gaussian membership function must have nonzero sigma value

조회 수: 8 (최근 30일)
vahab heydarie
vahab heydarie 2019년 4월 7일
댓글: yarin jannatkhah 2022년 3월 18일
I have a data matrix and I want to train ANFIS with that, and I used genfis3 for inital fis.
But matlab gives Warning:
Warning: Rank deficient, rank = 29, tol = 1.981365e-09.
> In genfis3>computemfparams (line 222)
In genfis3 (line 170)
when genfis3 runs and error :
Error using fuzzy.internal.fis.FuzzyInferenceSystem/addMF (line 1090)
Gaussian membership function must have nonzero sigma value.
Error in fuzzy.internal.utility.createFromStruct (line 43)
fisout = addMF(fisout,fisout.Inputs(i).Name, ...
Error in convertfis (line 25)
fisout = fuzzy.internal.utility.createFromStruct(fisin);
Error in anfis>trainFIS (line 225)
t_fismat = convertfis(t_fismat);
Error in anfis>anfisWithOptionalInputs (line 347)
[varargout{1:nargout}] = trainFIS(trn_data, in_fismat, t_opt, d_opt, ...
Error in anfis (line 69)
[varargout{1:nargout}] = anfisWithOptionalInputs(trn_data,varargin{:});
occurs when performing ANFIS.
my code:
%Design ANFIS
load(TrainFeature.mat);
load(TrainTargets.mat);
nCluster=10;
Exponent=2;
MaxIt=100;
MinImprovment=1e-5;
DisplayInfo=1;
FCMOptions=[Exponent MaxIt MinImprovment DisplayInfo];
fis=genfis3(TrainFeature,TrainTargets,'sugeno',nCluster,FCMOptions);
MaxEpoch=100;
ErrorGoal=0;
InitialStepSize=0.01;
StepSizeDecreaseRate=0.9;
StepSizeIncreaseRate=1.1;
TrainOptions=[MaxEpoch ...
ErrorGoal ...
InitialStepSize ...
StepSizeDecreaseRate ...
StepSizeIncreaseRate];
DisplayInfo=true;
DisplayError=true;
DisplayStepSize=true;
DisplayFinalResult=true;
DisplayOptions=[DisplayInfo ...
DisplayError ...
DisplayStepSize ...
DisplayFinalResult];
OptimizationMethod=1;
% 0: Backpropagation
% 1: Hybrid
fis=anfis([TrainFeature TrainTargets],fis);
I'll be grateful if anyone tells me the reason for this error and warning ....
  댓글 수: 2
vahab heydarie
vahab heydarie 2019년 4월 8일
Nobody can explain the cause of this error?
yarin jannatkhah
yarin jannatkhah 2022년 3월 18일
Dear Vahab could you solve the problem?

댓글을 달려면 로그인하십시오.

답변 (2개)

milad eshkevari
milad eshkevari 2021년 12월 29일
Hello dear friends. I also encountered a similar error in my work. By trial and error, I realized the reason and the way to fix the error. This error occurs when one of the inputs (features) is not properly dispersed and changed. In other words, one of the inputs was almost the same for all samples. To solve this problem, you can easily identify and delete an inappropriate input or feature with a near-zero variance by ploting the membership functions of each of the inputs (before using anfis and after using genfis). For example, in my code, after executing the genfis3 command, I plot the membership function for each of the inputs.
nMFs=4;
InputMF='gaussmf';
OutputMF='linear';
fis=genfis3(XTrain, YTrain, 'sugeno', Iter); %
% Plot MFs before training with anfis
plotmf(fis,'input',7)
My input number 7, as you can see in the figure, had a variance close to zero.
For comparison, I also plot MF of the inputs 1 and 3 below to see what the proper input should look like.
figure; plotmf(fis,'input',1)
figure; plotmf(fis,'input',3)
I deleted column 7 of my input data and this error was fixed.
XTrain(:,7) = [];

MGH
MGH 2020년 8월 6일
Dear Vahab,
Did you solve the problem? I have the same issue and cannot solve it. In the case you solved your issue, can you please tell me how you did that?
Thanks in advance,
Masoud
  댓글 수: 1
Pranshuta Shukla
Pranshuta Shukla 2021년 7월 13일
Dear Vahab and MGH,
Did you solve the problem? I have the same issue and cannot solve it. In the case you solved your issue, can you please tell me how you did that?
Thanks in advance,
Pranshuta

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by