Skip to content

Explores a novel AI approach using polynomial functions instead of neural networks. It evolves polynomial coefficients through natural selection to fit target functions.

Notifications You must be signed in to change notification settings

MaxDevv/Freshly-Baked-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Polynomial-Based Evolutionary AI

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.

Core Concept

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.

Key Features

  • 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

How It Works

  1. A population of models is created, each with one or more polynomial layers
  2. Each model processes input data through its polynomial layers
  3. Models are evaluated using a fitness function
  4. The top-performing models survive and reproduce with mutations
  5. This process repeats for many generations

Technical Implementation

  • 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

Configuration Parameters

  • mutationFactor: Controls the magnitude of mutations
  • instantiationFactor: Factor for new coefficient instantiation
  • layerAdjustmentChance: Probability of adding/removing layers
  • weightMutationFactor: Controls weight mutation magnitude
  • coefficientMutationChance: Probability of adding/removing coefficients
  • survivingPercentage: Portion of models that survive each generation
  • population: Number of models in the population
  • generations: Number of evolutionary cycles to run
  • checkpoints: Frequency of saving model checkpoints

Future Plans

  • Re-implementation in Go for better performance
  • Further optimization of the polynomial evaluation process
  • Expanded applications for function fitting problems

Usage

To train the model:

python Polynomial-Edition.py

This will run the evolutionary process for the specified number of generations, periodically saving checkpoints of the best-performing models.

Made with ❤️ by MaxDevv :D

About

Explores a novel AI approach using polynomial functions instead of neural networks. It evolves polynomial coefficients through natural selection to fit target functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages