Reverse the normalization from process function in NNtoolbox

1 view (last 30 days)
Hi all,
I would like to ask about the neural network toolbox.
Does anyone know how to reverse the normalization from this process function net.inputs{1}.processFcns ={'mapminmax'};
Because the result of my neural network always fall in the interval -1 and 1, it does not give the actual value. For your information, I am doing time series prediction so I use the recurrent neural network. I customize the network, I have 3 layers with 2 outputs.
Here is my code
load dataset1_1 plot (y) ylabel ('MW') xlabel ('Hours') title 'Load May - August, 2009'
P = sdiff(y,1,1);% difference a sequence once at a period of 1. p1= sdiff(P,1,24);% difference a sequence once at a period of 24. p = p1(193:end);% input R = length(p);
net = network; net.numInputs = 1; net.numLayers = 3; net.biasConnect(1) = 1; net.biasConnect(2) = 1; net.inputConnect(1,1) = 1; net.inputConnect(3,1) = 1; net.layerConnect = [0 0 1; 1 0 0; 0 1 0]; net.outputConnect = [0 1 1]; net.inputs{1}.exampleInput = p ; net.inputs{1}.processFcns ={'mapminmax'}; net.layers{1}.size = 5; net.layers{1}.transferFcn = 'tansig'; net.layers{1}.initFcn = 'initnw'; net.layers{2}.size = 1; net.layers{2}.initFcn = 'initnw'; net.layers{3}.size = 1; net.layers{3}.initFcn = 'initnw'; net.inputWeights{1,1}.delays = [24 168 192]; net.layerWeights{1,3}.delays = [24 168 192]; net.initFcn = 'initlay'; net.performFcn = 'mse'; net.trainFcn = 'trainbr'; net.divideFcn = 'dividerand'; net.plotFcns = {'plotperform','plottrainstate','ploterrhist','plotinerrcorr','ploterrcorr'}; net = init(net); view (net)
t1=[zeros(1,R);nan(1,R)];% target Pi=p1(1:192);% Initial input delay conditions p = con2seq(p);% Convert concurrent vectors to sequential vectors (inputs) t = num2cell(t1); %target Pi=con2seq(Pi);% Convert numeric array into cell array
% % Initialize neural network net = init(net); Y = sim(net,p,Pi);
% Train the network [net,tr] = train(net,p,t,Pi); y_result=sim(net,p,Pi); y_result = cell2mat(y_result); w_hat=y_result(2,:);
Thank you so much, really appreciate your help
Regards, Suci
  1 Comment
Greg Heath
Greg Heath on 21 Feb 2013
Edited: Greg Heath on 21 Feb 2013
Please reformat by using one space before every code command.
Also try enclosing the code in braces.
Use one command per line
Use your preview window to make sure your code is readily understandable.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!