how to write a trained fuzzy FIS tree to disk

1 次查看(过去 30 天)
Hi all!
I can't write the tree of trained fuzzy inference systems to disk. At the bottom of the program are the options that I used. But they don't work...
Granulator = mamfis('Name','Granulator','NumInputs',2,'NumOutputs',1);
Granulator.Inputs(1).Name = "G_inp1";
Granulator.Inputs(2).Name = "G_inp2";
Granulator.Outputs(1).Name = "G_out";
CTMCM = mamfis('Name','CTMCM','NumInputs',2,'NumOutputs',1);
CTMCM.Inputs(1).Name = "CTMCM_inp1";
CTMCM.Inputs(2).Name = "CTMCM_inp2";
CTMCM.Outputs(1).Name = "CTMCM_out";
OTF = mamfis('Name','OTF','NumInputs',2,'NumOutputs',1);
OTF.Inputs(1).Name = "OTF_inp1";
OTF.Inputs(2).Name = "OTF_inp2";
OTF.Outputs(1).Name = "OTF_out";
con1 = ["Granulator/G_out" "CTMCM/CTMCM_inp1"];
con2 = ["CTMCM/CTMCM_out" "OTF/OTF_inp1"];
tree = fistree([Granulator CTMCM OTF],[con1;con2]);
plotfis(tree) % FIS tree structure
X=rand(1000,5); % imitation of original data
nn=size(X);
nt=round(0.8*nn(1,1)); % training sample size
trnX = X(1:nt,1:4);
trnY = X(1:nt,end);
vldX = X(nt+1:end,1:4);
vldY = X(nt+1:end,end);
options = tunefisOptions;
options.Method = 'particleswarm';
options.OptimizationType = 'learning';
options.NumMaxRules = 10;
options.UseParallel = false;
options.MethodOptions.MaxIterations = 2;
rng('default')
fisout1 = tunefis(tree,[],trnX,trnY,options);
% writeFIS(fisout1,'fis1') % does not work
% writeFIS(tree,'fis1') % does not work

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by