Discovery Journey: Auto-Generated Activation Functions Using Genetic Programming
Date:May 21, 2025
Over the past week(s), I’ve embarked on an intensive experimental journey combining genetic programming (DEAP) with neural network activation function design. The result? A utility that evolves custom activation functions capable of outperforming standard choices like ReLU, Swish, or GELU under certain conditions.
This post serves both as a personal milestone and a timestamped record of this research.
🔍 Project Overview
Using DEAP (Distributed Evolutionary Algorithms in Python), I constructed an evolutionary search space made up of elementary mathematical primitives and safe variants of functions like log
, sqrt
, and divide
.
The system:
-
Evolves TensorFlow-compatible activation expressions
-
Benchmarks them in a real model loop (e.g. CNN-based classifier)
-
Reports performance via loss, runtime, and memory usage
-
Filters out invalid or exploding functions during evolution
🧠 Notable Results
One evolved function recently outperformed standard GELU/Swish on accuracy:
A GitHub repository will follow shortly.
If you’re working on model optimization, custom layers, or symbolic search: this approach might save weeks of trial-and-error. Pseudo Code
🙏 Stay Tuned
I’ll share more details, benchmarks, and licensing terms in the GitHub release. Feedback welcome. If you’re interested in collaboration or sponsorship, feel free to reach out.
— contact: machinesmartsor@gmail.com (Paul KP Fung)
This is an exploration of automatic activation function discovery using evolutionary strategies with DEAP and TensorFlow. The method was implemented and refined over several iterations. Insights and code support provided by ChatGPT (OpenAI).
Attribution & Legal Notes
🔧 Tools & Assistance:
This project and blog post were developed with the assistance of ChatGPT by OpenAI, particularly for code generation, algorithm structuring, and conceptual clarification. Final implementations and ideas are solely attributed to the author.
📚 Library Attributions:
This work incorporates or references open-source libraries under their respective licenses:
-
DEAP (Distributed Evolutionary Algorithms in Python) – GNU LGPL v3
-
TensorFlow – Apache License 2.0
-
Matplotlib – PSF License
-
NumPy – BSD License
-
psutil – BSD License
Ensure that your own use of these components complies with the terms of each license.
📖 License for This Work:
This blog post and associated pseudocode are released under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
This means you are free to:
-
Share — copy and redistribute the material
-
Adapt — remix, transform, and build upon the material
Under the following terms:
-
Attribution — You must give appropriate credit to the original author and indicate if changes were made.
-
NonCommercial — You may not use the material for commercial purposes without explicit permission.
A commercial-use license may be available via contact or linked GumRoad offerings.
⚠️ Disclaimers:
-
This blog post does not constitute legal or patent advice.
-
The material is shared for research, educational, and experimental purposes only.
-
The author does not guarantee performance or fitness for any particular purpose.
Comments
Post a Comment