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

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

How can I normalize data between 0 and 1 ? I want to use logsig...

Asked by Platon on 13 May 2013

All is in the question: I want to use logsig as a transfer function for the hidden neurones so I have to normalize data between 0 and 1. The mapminmax function in NN tool box normalize data between -1 and 1 so it does not correspond to what I'm looking for.

0 Comments

Platon

Products

No products are associated with this question.

2 Answers

Answer by José-Luis on 15 May 2013
Accepted answer
 bla = 100.*randn(1,10)
 norm_data = (bla - min(bla)) / ( max(bla) - min(bla) )

2 Comments

Platon on 15 May 2013

Thank you for your response. But if I do the normalization manually and train the NN with the normalized data, how can I test the net with new data? normalize them before simulation? if so how can I de-normalize the output calculated from unseen data? It seems complicated (mapminmax do all the stuff automatically)

José-Luis on 15 May 2013

Yes, provided you use the same normalization bounds (the min and max of both datasets). To rescale, please look at the below code.

bla = 100.*randn(1,10)
minVal = min(bla);
maxVal = max(bla);
norm_data = (bla - minVal) / ( maxVal - minVal )
your_original_data = minVal + norm_data.*(maxVal - minVal)
José-Luis
Answer by Jurgen on 15 May 2013
NDATA = mat2gray(DATA);

0 Comments

Jurgen

Contact us