artificial neural network simulation
Show older comments
Dear Expert, Hi, My name is İlker, I am forest biometrician in forest faculty, I have studied for predicting various tree and forest attributes by using ANNs, When I applied ANNs to model forest attributes, I have received a matter,
I can apply different ANN training networks such as feed-forward backprop, cascade, elman, etc. by using NNTOOLS in Matlab software to various data obtained from forest areas, NNTOOLs in Matlab produces output values for the normalized data that were trained with Matlab, also Nntool give weights to layer 1, 2 and bias values, you can view my weights in Matlab nntool in below. Then, I want manually to calculate these simulation values, also called networkoutput in Matlab, by using weight values and biases obtained from Matlab nntool, because these manual predictions and formulae are very important to present for reader for my article and projects, But, I can not obtain these output from Matlab nntool, my manual prediction from formulae including ANN procedure is not same with output values from Matlab nntool, I want to point out these two prediction procedure use the same input values, In my ANN procedure, I used the feed forward backprop training procedure, including training procedure is TRAINLM, number of layers are 2, number of neurons are 10, transfer function is LOGSIG, thus, NNTOOL in Matlab procedure output values calculating weight values, Weight to layer 1: [28,0986 30,6628 -30,3919 28,8561 27,4745 -15,2174 -10,4032 14,3858 22,5694 26,2347 ]
Weight to layer: [4,7238 0,42773 -0,24081 0,048829 0,19533 -0,28693 -0,42106 0,40991 0,35462 1,9116]
Bias to layer 1: -29,1855 -19,3734 14,3085 -9,6229 -5,2199 -0,57154 -3,8889 9,449 18,2368 25,7815]
Bias to layer 2: [-2.3349] Then I used the these formule: 1. Step: Nöron 1 = 28.0986*Inputnorm-29.1855 Nöron 2 = 30.6628* Inputnorm -19.3734 Nöron 3 = -30.3919* Inputnorm +14.3085 Nöron 4 = 28.8561* Inputnorm -9.6229 Nöron 5 = 27.4745* Inputnorm -5.2199 Nöron 6 = -15.2174* Inputnorm -0.57154 Nöron 7 = -10.4032* Inputnorm -3.8889 Nöron 8 = 14.3858* Inputnorm +9.449 Nöron 9 = 25.5694* Inputnorm -18.2368 Nöron 10= 26.2347* Inputnorm +25.7815
2. Step: Transfer fonctions:
E1=1/(1+EXP(-N1)) E2=1/(1+EXP(-N2)) E3=1/(1+EXP(-N3)) E4=1/(1+EXP(-N4)) E5=1/(1+EXP(-N5)) E6=1/(1+EXP(-N6)) E7=1/(1+EXP(-N7)) E8=1/(1+EXP(-N8)) E9=1/(1+EXP(-N9)) E10=1/(1+EXP(-N10))
3. Step:
Sum=4,7238*E1+0,42773*E2-0,24081*E3+0,048829*E4+0,19533*E5-0,28693*E6-0,42106*E7+0,40991*E8+0,35462*E9+1,9116*E10-2.3349
4. Step:
output=1/(1+EXP(-Sum))
But, I can not obtain the output values from Matlab by using these formulea, What is wrong is in these formulea. I would be glad if you help me about these subject.
Best regards.
Dr. İlker ERCANLI
Answers (1)
Greg Heath
on 3 Jun 2016
Edited: Greg Heath
on 3 Jun 2016
A. It is well known (see the comp.ai.neural-nets FAQ) that nets train and perform easier when:
1. Outliers are modified or removed.
MATLAB does not incorporate outlier modification. Therefore I use ZSCORE outlier modification/removal. Plots can help help determine which option to use for individual outliers.
2. Inputs and targets are normalized about zero.
Two available MATLAB normalizations are
a. The default MAPMINMAX: [ -1 1 ]
b. MAPSTD or ZSCORE: ZERO-MEAN/UNIT-VARIANCE
( also known as STANDARDIZATION).
For details use the HELP and DOC commands in lowercase.
3. Hidden node activation functions are either
a. The symmetric sigmoid TANH (MATLAB's TANSIG) or
b. The GAUSSIAN (MATLAB's RADBAS)
If there is a mathematical or physical reason to have STRICT NUMERICAL BOUNDS, output activation functions should be either be the ASYMMETRIC SIGMOID (MATLAB's LOGSIG) or the symmetric TANH (MATLAB's TANSIG).
If you are programming in MATLAB, you can use the MATLAB functions instead of exponential combinations. You'll have to test to see if there is a significant time difference. Please post if there is!!!
4. Typically, the failed comparison of a user's self-written NN program with MATLAB is at the normalization and denormalization stages. Therefore the user has to either include those OR remove them from the MATLAB function.
Hope this helps,
Thank you for formally accepting my answer
Greg
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!