Neural Network Toolbox | Search  Help Desk |
tramnmx | Examples See Also |
Transform data using a precalculated min
and max
[pn] = tramnmx(p,minp,maxp)
tramnmx
transforms the network input set using minimum and maximum values that were previously computed by premnmx
. This function needs to be used when a network has been trained using data normalized by premnmx
. All subsequent inputs to the network need to be transformed using the same normalization.
tramnmx(P,minp, maxp)
takes these inputs
P - R
x Q
matrix of input (column) vectors.
minp- R
x 1
vector containing original minimums for each input.
maxp- R
x 1
vector containing original maximums for each input.
PN - R
x Q
matrix of normalized input vectors
[-1,1]
, using premnmx
, and also code to train a network with the normalized data.
p = [-10 -7.5 -5 -2.5 0 2.5 5 7.5 10]; t = [0 7.07 -10 -7.07 0 7.07 10 7.07 0]; [pn,minp,maxp,tn,mint,maxt] = premnmx(p,t); net = newff(minmax(pn),[5 1],{'tansig' 'purelin'},'trainlm'); net = train(net,pn,tn);If we then receive new inputs to apply to the trained network, we will use
tramnmx
to transform them first. Then the transformed inputs can be used to simulate the previously trained network. The network output must also be unnormalized using postmnmx
.
p2 = [4 -7]; [p2n] = tramnmx(p2,minp,maxp); an = sim(net,pn); [a] = postmnmx(an,mint,maxt);
pn = 2*(p-minp)/(maxp-minp) - 1;
premnmx
,
prestd
,
prepca
,
trastd
,
trapca