Input Process Settings fitnet not working properly
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Aditya Gujaria
il 5 Ott 2020
Risposto: Mohith Kulkarni
il 13 Ott 2020
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;
0 Commenti
Risposta accettata
Mohith Kulkarni
il 13 Ott 2020
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Define Shallow Neural Network Architectures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!