
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/they4kman/experimentation/machine-learning/genetic-algorithms
Execute python genetic_expr_ui.py
to get a graphical interface.
Description: a number is randomly chosen, and the aim of the program is to drum up a simple arithmetic equation using only addition, subtraction, multiplication, and division of a number of components less than 10. For instance, for the number 184, a solution might be 6*7*4+1-5+8+7+5
.
To find its solutions, the program begins with a population of 30 "chromosomes", each consisting of 30 "genes" representing digits or operators. At each step, two chromosomes are chosen at random-ish. We roll a die to see if we should crossover them, which is to swap their bits around a random bit
The program defines a simple language with characters defined as 4-bit nibbles:
Index | Binary | Character |
---|---|---|
0 | 0000 | 0 |
1 | 0001 | 1 |
2 | 0010 | 2 |
3 | 0011 | 3 |
4 | 0100 | 4 |
5 | 0101 | 5 |
6 | 0110 | 6 |
7 | 0111 | 7 |
8 | 1000 | 8 |
9 | 1001 | 9 |
10 | 1010 | + |
11 | 1011 | - |
12 | 1100 | * |
13 | 1101 | / |
14 | 1110 | Invalid |
15 | 1111 | Invalid |
These are called genes. A chromosome is a list of genes. In the demonstration, we use chromosomes with 30 genes.
TODO
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.