Change preprocessing parameter in neural network
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi!
I am using neural networks to reconstruct rainfall time series. Since the network sometimes generates negative rainfall, I would like to change the scaling in the preprossesing function 'mapminmax' to [0.1 0.9] instead of the default [-1 1].
To do this, I've tried to change the ymin and ymax reachable through processParams.
% Choose Input and Output Pre/Post-Processing Functions
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};
net.inputs{1}.processParams{2} %Returns the parameters for 'mapminmax'
net.inputs{1}.processParams{2}(1).ymin %This returns -1
net.inputs{1}.processParams{2}(1).ymin = 0.1; %But I can't change the parameter
This code generates the following:
ans =
ymin: -1
ymax: 1
ans =
-1
??? Undefined function or variable "processParams".
Error in ==> network.subsasgn>network_subsasgn at 118
if isempty(err), [net,err] = setInputProcessParam(net,i,processParams); end
Error in ==> network.subsasgn at 11
net = network_subsasgn(net,subscripts,v,netname);
Error in ==> NNReconstructRain at 26
net.inputs{1}.processParams{2}(1).ymin = 0.1;
How can I change the value?
Thanks
Lova
0 Kommentare
Akzeptierte Antwort
Mark Hudson Beale
am 19 Apr. 2011
You can try this workaround:
net = struct(net);
net.inputs{1}.processParams{2}.ymin = 0.1;
net = network(net);
0 Kommentare
Weitere Antworten (1)
wonderboy
am 15 Sep. 2011
i have the same problem in MATLAB r2010b. when i want to set the ymin or y max property of the mapminmax process function i get an error. see:
net.inputs{1}.processParams{3}.ymin = 0
??? Undefined function or variable "processParams".
however, on the r2010a, you won't see the above error.
i wonder sometimes, do the designing team test the product at all???!
the strange thing is that, in the HELP document, on advanced Topic/custom network, when they reach to this point, they skipped it! see (exact copy/paste from MATLAB Neural Network User Guide 7):
Set the second input vector ranges to be from -2 to 2 for five elements as follows:
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
View the new input properties. You will see that processParams, processSettings...
as you see on above they forgot to write this:
net.inputs{1].processFcns{2}.ymin = -2;
net.inputs{1].processFcns{2}.ymax = -2;
however, maybe they knew, this version's bug on this command!
this is really embarrassing.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!