How could I cancel pre-processing and post-processing stages when training a neural network?

Whenever I use fitnet it applies minmax to my data by default, however my data is already scaled, so I was just wondering if there was a way to change this default feature.

 Accepted Answer

To remove mapminmax as a processFcn but still keep removeconstantrows
close all, clear all, clc
% WITH DEFAULT MAPMINMAX
[x,t] = simplefit_dataset;
net = fitnet;
rng(0)
[net tr y e ] = train(net,x,t);
NMSE1 = mse(e)/mean(var(t',1)) % 1.7558e-05
% WITHOUT DEFAULT MAPMINMAX
[x,t] = simplefit_dataset;
net = fitnet;
net.inputs{1}.processFcns={'removeconstantrows'};
net.outputs{2}.processFcns={'removeconstantrows'};
rng(0)
[net tr y e ] = train(net,x,t);
NMSE2 = mse(e)/mean(var(t',1)) % 1.7241e-05
Hope this helps.
Thank you for formally accepting my answer
Greg

2 Comments

Thank you so much for you response, I was just wondering if this cancels post-processing as well. Also could I remove 'remove const rows'? So have no processing features whatsoever?
Yes. The first statement is for inputs and the second for outputs.
If you do not want to eliminate constant rows, use '' for the RHS (maybe {} will work also)
Hope this helps.
Greg

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!