How to pair the trained Neural Network to Genetic algorithm in optimtool???.
Afficher commentaires plus anciens
I am using the GA function in the Optimization Toolbox, and I want to pair/link the trained neural network how I can do it.
Réponses (1)
luis barbosa
le 17 Août 2018
Modifié(e) : luis barbosa
le 17 Août 2018
If I understood right, it is desired to find out the argument x that minimize or maximize a f(x). And this function f(x) is neural network.
Let's work with minimization problem (default of Genetic Algorithm). If you want maximization problem, you can refer to Maximizing vs Minimizing.
Let's suppose your trained neural network is 'net'. You can create first a parametric function handling. For more details about it, see Passing extra parameters
function y = trainedNN (x, net)
x=x'; %transposing
y=net(x);
end
In the main script, you first call this parametric function handle. Then, you call the genetic algorithm function, which will find out the vector x, that minimizes the output from the trained neural networks.
f = @(x)trainedNN(x, net);
x = ga(f, nvars);
2 commentaires
Greg Heath
le 18 Août 2018
Is this an accurate explanation of the problem? …
Given: A trained single hidden layer I-H-O net with H hidden nodes that yields an O-dimensional "O"utput, y, given an I-dimensional "I"nput, x, via
y = net(x)
Find: One (or all?) value(s) of x that yields the output
y = zeros(O,1).
Thanks,
Greg
luis barbosa
le 18 Août 2018
I am not so sure if we can say it: find x that yields the y=zero(O,1).
It all depends how you prepared or data before training, i.e. if you normalized between [0, 1], [-1, 1], or mean plus/minus standard deviation. It also depends if you are optimizing all inputs or only some of them. If you are optimizing only some inputs, the output y will not necessarily be a global minimum, as consequence it won't be for example y=0 (for the case you normalized [0, 1]).
Another important thing is to add lower and upper limits in search space for the variable(s) x, according to the problem.
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!