-
Notifications
You must be signed in to change notification settings - Fork 8
Polynomial circuits_eac3
Work in progress.
Reason for using polynomial representation can be simpler individuals for evolution, where changes affects the result less, than changes in circuits, so the evolution may run smoother. Another reason is implementation, which is using GAlib representation for individuals, which is transparent to library, so we can use more options from the library.
In polynomial representation, each individual (distinguisher) is combined from outputLength's of polynomials. Each polynomial is in algebraic normal form (ANF), where terms are XORed and variables in term are ANDed and is evaluated to one bit of the output.
Polynomials | Bits of output |
---|---|
(x1) | 1 |
(x1 & x2) ^ (x1 & x4 & x5) ^ () | 1 |
(x2 & x3 & x4) | 0 |
empty polynomial | 0 |
Where number of lines is size of the output (used for evaluator). Terms are in parenthesis in this example. Null term () is evaluated to 1 (it is not possible to express zero term - it is not needed). Empty polynomials is evaluated to 0.
Term is stored in the internal vector in this way:
- x0 .. x63 goes to the vector[0]
- x64 .. x127 goes to the vector[1] ...
Where x0 is 0 if variable is not used in term, or 1 if it is used in term.
Both mutation and crossover are possible on polynomials.
Mutation is done both on polynomials and on terms.
- MUTATE_TERM_STRATEGY_FLIP: get random position from range of term and flip that bit. May have problem with high count of variables (convergence to 0.5*termLength variables)
- MUTATE_TERM_STRATEGY_ADDREMOVE: flip bit with probability 0.5 to determine, if we would add, or remove variable. Maybe we would like to do both
- Add new term: with probability mutateAddTermProbability is added:
a) one new term in case, that MUTATE_ADD_TERM_STRATEGY_ONCE is selected
b) as long as coin with probability mutateAddTermProbability is true, add new term (if MUTATE_ADD_TERM_STRATEGY_ONCE is not set)
New term looks to be empty (it is evaluated as 1), which would not change polynomial until term is mutated. - Remove of term is similar to add new term, depends on MUTATE_RM_TERM_STRATEGY_ONCE.
Current implementation allows 2 types of crossover. The basic is polynomials crossover, the second, extending the polynomials crossover is terms crossover.
Input of crossover is pair of parent individuals, output is pair of children (because of this, we cannot use crossover to create odd count of children). The order of polynomials in parents is shuffled and then for each position in children, we get polynomial from random parent (because of the shuffled order, we take random polynomial). The another parent is used for the second child. In conclusion, the children together contains each of polynomials of parents, but distribution of polynomials source is random (e. g. child can be just shuffled parent).
It is part of crossover of polynomials. For each polynomial, crossover of terms is done with probability CROSSOVER_TERM_P. We take random index inside range of both terms and we swap the parts of terms after this crossover place index.
--
You are on EACirc 3 wiki!
--
Building notes
Running notes
Recommencing computation
--
Framework components
Circuit back-ends
Main computation loop
Projects
Evaluators
CUDA support
Testing
Known bugs
Third party libraries
I/O-Files structure
Java bytecode simulator
--
Project eStream
Project SHA-3
Project CAESAR
Project Files
--