Skip to Main Content
Practical Neural Network Recipies in C++
book

Practical Neural Network Recipies in C++

by Masters
June 2014
Intermediate to advanced content levelIntermediate to advanced
493 pages
20h 30m
English
Morgan Kaufmann
Content preview from Practical Neural Network Recipies in C++
162
Chapter 8
rn = (double) rand 0 / ((double) RANDMAX + 1.0) ; // Random 0-1
*crosspt = 1 + rn * chromsize ; // Random select crossover pt
if ((chromsize >= 16) && (randO < (RANDMAX/3))) // Two point?
*crosspt = -*crosspt
pa = p1 ;
pb = p2 ;
} // If first child
else {
pa = p2 ;
pb = p1 ;
}
// flag this for second child
// Second child
// so parents reverse roles
Γ
Ί
Prepare for reproduction
if
('split)
{
right = 1 ;
i = *split ;
while (-i)
right = (right « 1) | 1
left = 255
Λ
right ;
}
if fcrosspt > 0) {
n1 = chromsize / 2 ;
n2 = chromsize - n1 ;
n3 = n4 = 0 ;
i = *crosspt -1 ;
}
// Create left, right splitting masks
// Use one point crossove ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Neural Networks with Keras Cookbook

Neural Networks with Keras Cookbook

V Kishore Ayyadevara
Scientific Computing with Python 3

Scientific Computing with Python 3

Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier
Mastering Java Machine Learning

Mastering Java Machine Learning

Uday Kamath, Krishna Choppella

Publisher Resources

ISBN: 9780080514338