This project uses an Evolutionary Strategy (ES) algorithm—a type of computational intelligence inspired by biological evolution—to find the optimal parameters for a complex mathematical function.
We want to find the best possible coefficients for the target function.
The algorithm searches for parameters
At its core, it's a (150, 750)-ES with self-adaptive mutation.
Population Cycle: We start with 150 parent solutions (genes). They generate 750 children (5 per parent).
Survival: Only the best individuals from the child pool (\mu, \lambda)-selection survive to become the parents of the next generation.
Self-Adaptation: The 'genes' (parameters
Stop Condition: Evolution runs for a maximum of 200 generations or until the improvement between generations is less than
You only need Python 3.x. No external libraries are required.
Get the code
` git clone cd topic_8
./run.sh
python3 src/main.py
If you need to tweak the core parameters (like population size or max iterations), they are located in src/constants.py.
.
├── README.md
├── data
│ └── ES_data_26.dat # Input data file
├── run.sh # Convenience run script
└── src
├── constants.py # Core parameters
├── data.py # Data loading utility
├── genes.py # Gene and GenePool classes
└── main.py # Entrypoint
After multiple runs, the algorithm consistently finds parameters with an MSE of around 0.22