/evolving_string

An example of a genetic algorithm.

Primary LanguagePythonMIT LicenseMIT

evolving_string

An example of a genetic algorithm. Commentary(korean)

Usage

python evolving_string.py "Richard Dawkins"

--------------------------------------------
Generation 1 min loss =  9.4169
Generation 1 master =  QVTOQqS BerUgY`
--------------------------------------------
--------------------------------------------
Generation 2 min loss =  4.4193
Generation 2 master =  Obcchwj Edqkcms
--------------------------------------------
--------------------------------------------
Generation 3 min loss =  2.2868
Generation 3 master =  Ogai_q` Cdqkdms
--------------------------------------------
--------------------------------------------
Generation 4 min loss =  1.1628
Generation 4 master =  Oicg^qd C_vkfns
--------------------------------------------
--------------------------------------------
Generation 5 min loss =  0.6227
Generation 5 master =  Qichard D_vkhms
--------------------------------------------
--------------------------------------------
Generation 6 min loss =  0.4574
Generation 6 master =  Qichard Dbwkhns
--------------------------------------------
--------------------------------------------
Generation 7 min loss =  0.4574
Generation 7 master =  Qichard Dbwkjns
--------------------------------------------
--------------------------------------------
Generation 8 min loss =  0.4574
Generation 8 master =  Qichard Dbwkhns
--------------------------------------------
--------------------------------------------
Generation 9 min loss =  0.4574
Generation 9 master =  Qichard Dbwkhns
--------------------------------------------
--------------------------------------------
Generation 10 min loss =  0.4103
Generation 10 master =  Qichard D`wkhns
--------------------------------------------
--------------------------------------------
Generation 11 min loss =  0.378
Generation 11 master =  Qichard Dbwkins
--------------------------------------------
--------------------------------------------
Generation 12 min loss =  0.3499
Generation 12 master =  Qichard Dawkhns
--------------------------------------------
--------------------------------------------
Generation 13 min loss =  0.2575
Generation 13 master =  Richard Dbwkins
--------------------------------------------
--------------------------------------------
Generation 14 min loss =  0.0
Generation 14 master =  Richard Dawkins
--------------------------------------------
Generation 14 found the answer: Richard Dawkins