This project implements a novel approach to artificial intelligence by using polynomial functions instead of traditional neural network nodes. The system evolves polynomial coefficients through natural selection to fit target functions.
Unlike traditional neural networks that use weighted nodes, this approach uses layers of polynomial functions (called "interference layers") that transform input data. Each layer applies a polynomial function to the input values using Horner's method for efficient evaluation.
- Polynomial Layers: Each layer contains a set of coefficients that define a polynomial function
- Evolutionary Algorithm: Models evolve through natural selection, with the best-performing models surviving and reproducing
- Mutation System: Coefficients and layer structures mutate over generations to explore the solution space
- Checkpoint System: Saves the best models at regular intervals for later analysis
- A population of models is created, each with one or more polynomial layers
- Each model processes input data through its polynomial layers
- Models are evaluated using a fitness function
- The top-performing models survive and reproduce with mutations
- This process repeats for many generations
- Uses NumPy for efficient array operations
- Implements Horner's method for polynomial evaluation
- Optimizes with Numba JIT compilation for performance
- Supports automatic layer adjustment during evolution
mutationFactor: Controls the magnitude of mutationsinstantiationFactor: Factor for new coefficient instantiationlayerAdjustmentChance: Probability of adding/removing layersweightMutationFactor: Controls weight mutation magnitudecoefficientMutationChance: Probability of adding/removing coefficientssurvivingPercentage: Portion of models that survive each generationpopulation: Number of models in the populationgenerations: Number of evolutionary cycles to runcheckpoints: Frequency of saving model checkpoints
- Re-implementation in Go for better performance
- Further optimization of the polynomial evaluation process
- Expanded applications for function fitting problems
To train the model:
python Polynomial-Edition.pyThis will run the evolutionary process for the specified number of generations, periodically saving checkpoints of the best-performing models.
Made with ❤️ by MaxDevv :D