Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How can I customize the NARX neural network Input and Feedback Pre/Post-Processing Functions?

Asked by Shigalla on 3 Oct 2012

Hi,

I am new to neural networks. I have 1 target and 4 external inputs and I need to customize the NARX neural network Input and Feedback Pre/Post-Processing Functions so as to map onto the range [0.2 0.8] instead of the default [-1 1]. How can I modify these two lines in my script, and what else can I do?

net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};

net.inputs{2}.processFcns = {'removeconstantrows','mapminmax'};

Thanks.

0 Comments

Shigalla

Products

No products are associated with this question.

2 Answers

Answer by Greg Heath on 30 Oct 2012
Accepted answer

Why do you thin you "need" to do this transformation??

MAPMINMAX is designed to scale internal inputs, targets and outputs into a range that doesn't unnecessarily cause numerical innaccuracy in training function Jacobians or saturate sigmoid activation functions.

Changing from [-1,1] to something else does absolutely nothing useful.

The change of code is an unecessary complication that does nothing to improve the accuracy of the net.

Or am I missing something?

Hope this helps.

Thank you for formally accepting my answer (;>)

Greg

0 Comments

Greg Heath
Answer by Sree Srinivasan on 11 Oct 2012

I posed your question to the authors of Matlab ANN. Here is a response. It makes sense, but I have not tested it.

The MAPMINMAX output range can be set to 0.2 to 0.8 as follows:

net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'}; net.inputs{1}.processParams{2} = struct('ymin',0.1,'ymax',0.9);

Let me know if that does not accomplish what you are trying to do.

Both network input and output subobjects have the processParams field so the output's MAPMINMAX can be customized to map targets to layer output ranges other than [-1,1] also. For instance for a two-layer network where MAPMINMAX is the second processing function:

net.outputs{2}.processParams{2} = struct('ymin',0.2,'ymax',0.8);

Mark Hudson Beale mark.beale@mhbinc.com Phone & Text 208-755-5565

0 Comments

Sree Srinivasan

Contact us