This is an exercise to use Stack GP for a simple symbolic regression task. If you want to get familiar with Genetic Programming in a few minutes, read GP.md
rand
is used as an RNGrayon
is used to use multiple threads and thus higher performanceclap
is used to parse command line arguments. You can specify the population and other hyper parameters
- It seems that on some computers,
rayon
detect 2 processors rather than 4. There are actually 2 processors but the CPU supports 4 threads. This technology is known as hyper threading. To overcome this, you might want to specify number of processors used manually in the code.
f(x) = 2 * x * x
I've tried but I'm not a Rust expert, yet.
The MIT License. Copyright (C) 2023 Farooq Karimi Zadeh
fkz@riseup.net