Gaussian membership function must have nonzero sigma value

24 ビュー (過去 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 Center および File ExchangeFuzzy Logic Toolbox についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by