GA3DArrayGenome
Michael Z Katz-Hyman
m.z.katz-hyman at larc.nasa.gov
Tue Jul 11 09:50:57 EDT 2000
Everyone,
I am trying to use the GALib libraries to implement some GAs for a neural
network. At first I want it to optimize the network weights and I have
they represented in a 3D Array Genome. I have created an initialization
function, however my program coredumps when it tries to initialize....if I
don;t initialize it won't core dump. Here are some code snippets. Any
I am using a GASimpleGA.
GA3DArrayGenome<double> weights(x,y,2,Objective);
weights.initializer(ArrayInitializer);
...
void ArrayInitializer(GAGenome & g) {
GA3DArrayGenome<double> &weight=(GA3DArrayGenome<double>&)g;
for (int k=1;k<=weight.depth();k++)
for (int i=1;i<=weight.width();i++)
for (int j=1;j<=weight.height();j++)
weight.gene(i,j,k,GARandomDouble(0,1));
}
Michael Katz-Hyman
NASA/LaRC Hampton,VA
m.z.katz-hyman at larc.nasa.gov
More information about the galib
mailing list