how do i optimize weights of neural network using GA in MATLAB

Illustration
sumitsingh - 2021-05-05T14:22:38+00:00
Question: how do i optimize weights of neural network using GA in 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 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.  

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

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.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!