MATLAB: How do i optimize weights of neural network using GA in MATLAB(need codes to achieve that), again how do i call this function that optimzes the neural network weights in GA GUI so i can work with it from the interface

Deep Learning Toolboxgenetic algorithmtraining neural network using gaweight optimization using ga

i need to train a neural network(a feedforward network and also a narx network) using genetic algorithm.and i need to do this by using GA to search for weights that will make the network learn very well.

Best Answer

When
[ I N ] = size(input)
[ O N ] = size(target)
MSE00 = mean(var(target',1))% Reference MSE
The number of available training equations is
Ntrneq = N*O
For an I-H-O node topology the number of unknown weights is
Nw = (I+1)*H+(H+1)*O = (I+O+1)*H+1
Obviously,
1. The "3" in the GA input is replaced by I+O+1
2. The normalized mse calculation is
NMSE = mean((target(:)-output(:)).^2)/MSE00
Of course there will be more complications if the performance measure has to be decomposed into class and trn/val/tst subsets.
Hope this helps.
Greg