Input Process Settings fitnet not working properly

2 ビュー (過去 30 日間)
Aditya Gujaria
Aditya Gujaria 2020 年 10 月 5 日
回答済み: Mohith Kulkarni 2020 年 10 月 13 日
For the following code below
clear;
clc;
x1=0:0.01:2; %need to fix this error
x2=0:0.01:2; %
hiddenLayer=3;
input=combvec(x1,x2);
target=5*input(1,:)+input(2,:).^3 ;
net=fitnet(hiddenLayer);
net.inputs{1}.processFcns={'mapminmax'};
net.outputs{2}.processFcns = {'mapminmax'};
net.inputs{1}.processParams{1}
[net, tr]=train(net,input,target);
input_setting=net.inputs.processSettings;
output_setting=net.outputs.processSettings;
I am getting null net.inputs.processSettings when the variables x1 and x2 are set to these below values
x1=0:0.01:2;
x2=0:0.01:2;
For all other cases the values seems to coming out fine example
x1=0:0.01:3;
x2=0:0.01:3;

採用された回答

Mohith Kulkarni
Mohith Kulkarni 2020 年 10 月 13 日
Hi Aditya,
Unfortunately, this seems likely to be a bug. I have brought this issue to the notice of our developers. They will investigate the matter further.
Workaround:
It's normal for some of the processing functions to be removed from the final 'net' structure but only when they're unused. In this case, I don't think they've been removed correctly.
Since this does not happen for most datasets, if this is not the final dataset the you want to use, I suggest you carry on with your analysis with a different dataset if that's the case.
If this really is the dataset you would like to use, then you could try to remove the mapminmax function from the input and output preprocessing functions. It doesn't seem to make a big difference in results for this specific data:
net.inputs{1}.processFcns = {};
net.outputs{2}.processFcns ={};
One other option could be to remove the 'mapminmax' function from the input processing functions and do the processing offline. Bearing in mind that the data is internally split into train/test/val datasets. The offline processing should respect this split, by fixing the partition:
net.divideFcn = 'divideind';
net.divideParam.trainInd = train_ind;
net.divideParam.valInd = val_ind;
net.divideParam.testInd = test_ind;
Where train_ind, test_ind and val_ind are the indices of the train, test and validation datasets determined by you.
You can use the function 'mapminmax' to do the processing on the training data and apply to the test/val datasets, as follows:
[Xtrain,settings] = mapminmax(Xtrain);
Xtest = mapminmax.apply(Xtest,settings);

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by