Instructions to use Invictus-AI/self-evolving-nn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Invictus-AI/self-evolving-nn with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Invictus-AI/self-evolving-nn") - Notebooks
- Google Colab
- Kaggle
Kashyap Khakhkhar commited on
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🧬 Self-Evolving Neural Network — 4524d43d
|
| 2 |
+
|
| 3 |
+
Evolved locally with neuroevolution (genetic architecture search), then uploaded from this machine.
|
| 4 |
+
|
| 5 |
+
## Model
|
| 6 |
+
|
| 7 |
+
- **Architecture**: gated MLP — top-3 features → layer 1, remaining features join every layer after
|
| 8 |
+
- **Layers**: `192(swish), 96(selu), 32(swish), 192(linear), 256(relu), 64(sigmoid)`
|
| 9 |
+
- **Params**: 102,216
|
| 10 |
+
- **Learning rate**: 0.005 · **Optimizer**: rmsprop · **Batch size**: 16
|
| 11 |
+
- **Top-3 feature gate**: [4, 9, 16]
|
| 12 |
+
- **Fitness**: 331118.82
|
| 13 |
+
|
| 14 |
+
## Evolution history
|
| 15 |
+
|
| 16 |
+
- **Generations**: 18
|
| 17 |
+
- **Initial best fitness**: 37948.7707
|
| 18 |
+
- **Final best fitness**: 240545.7623
|
| 19 |
+
- **Improvement**: +533.9%
|
| 20 |
+
|
| 21 |
+
## Files
|
| 22 |
+
|
| 23 |
+
| File | Description |
|
| 24 |
+
|------|-------------|
|
| 25 |
+
| `evo_checkpoints/best_model.keras` | Trained best model (Keras) |
|
| 26 |
+
| `evo_checkpoints/best_genome.json` | Best architecture genome |
|
| 27 |
+
| `evo_checkpoints/evolution_history.json` | Fitness across generations |
|
| 28 |
+
| `self_evolving_model.py` | Core evolution engine |
|
| 29 |
+
| `evo_gui.py` | Flask web dashboard |
|
| 30 |
+
| `requirements.txt` | Dependencies |
|
| 31 |
+
|
| 32 |
+
## How to run
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
pip install -r requirements.txt
|
| 36 |
+
# Continue evolving from this state
|
| 37 |
+
python3 self_evolving_model.py --continue --generations 50
|
| 38 |
+
# Or launch the web GUI
|
| 39 |
+
python3 evo_gui.py --port 5000
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Scaling up (v2/v3 on GPU)
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
python3 self_evolving_model.py --continue --max-units 512 --max-layers 8 --train-epochs 20
|
| 46 |
+
```
|
| 47 |
+
See `evo_v2_colab.ipynb` for a ready-to-run Google Colab notebook.
|