MATLAB: Change preprocessing parameter in neural network

Deep Learning Toolboxneural network

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

Best Answer

You can try this workaround:
net = struct(net);
net.inputs{1}.processParams{2}.ymin = 0.1;
net = network(net);