https://github.com/patrulek/tinygp
Tiny Genetic Programming in Golang
https://github.com/patrulek/tinygp
genetic go golang programming tinygp
Last synced: 7 months ago
JSON representation
Tiny Genetic Programming in Golang
- Host: GitHub
- URL: https://github.com/patrulek/tinygp
- Owner: patrulek
- License: gpl-3.0
- Created: 2022-02-22T07:12:44.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T06:58:39.000Z (over 3 years ago)
- Last Synced: 2025-01-19T07:24:46.859Z (9 months ago)
- Topics: genetic, go, golang, programming, tinygp
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tiny Genetic Programming in Golang[^1]
A minimalistic program implementing Koza-style (tree-based) genetic programming to solve a symbolic regression problem.
It is a basic (and fully functional) version, which produces textual output of the evolutionary progression and evolved trees.
| Symbolic | Regression using GP |
|-------------:|:-------------|
| Objective | Find an expression with one input (independent variable x), whose output equals the value of the quartic function x4 + x3 + x2 + x + 1 |
| Function set | add, sub, mul |
| Terminal set | x, -2, -1, 0, 1, 2 |
| Fitness | Inverse mean absolute error over a dataset of 101 target values, normalized to [-1,1]
| Paremeters | POP_SIZE (population size), MIN_DEPTH (minimal initial random tree depth), MAX_DEPTH (maximal initial random tree depth), GENERATIONS (maximal number of generations), TOURNAMENT_SIZE (size of tournament for tournament selection), XO_RATE (crossover rate), PROB_MUTATION (per-node mutation probability) |
| Termination | Maximal number of generations reached or an individual with fitness = 1.0 found |[^1]: [Tiny Genetic Programming in Python](https://github.com/moshesipper/tiny_gp)