Skip to main content

EvoNet

Code Quality & Tests License: MIT Project Status: Stable

EvoNet is a modular and evolvable neural network core designed for integration with EvoLib.
It supports dynamic topologies, recurrent connections, per-neuron activation, and structural evolution, with explicit and deterministic behaviour.


Scope

EvoNet is not a state-of-the-art or general-purpose deep learning framework.

It does not aim to compete with libraries such as PyTorch, TensorFlow, or JAX in terms of performance, scalability, or training algorithms. Backpropagation, GPU acceleration, and highly optimised tensor operations are outside the scope of this project.

Instead, EvoNet supports evolutionary algorithms, structural mutation, and exploratory research, with a focus on transparent and explicit implementations rather than performance optimisation or feature completeness.


Overview

  • Explicit neural network topology with inspectable structure
  • Support for recurrent connections and temporal dynamics
  • Dynamic topology growth during evolution
  • Per-neuron activations and stateful neuron dynamics
  • Supports evolutionary and structural mutation methods
  • Deterministic execution model with explicit state

Technical Highlights

  • Explicit layer / neuron / connection objects
  • Typed neuron roles (INPUT, HIDDEN, OUTPUT)
  • Typed connection kinds (STANDARD, RECURRENT, …)
  • Recurrent connections with integer delay buffers
  • Per-neuron activation functions and local dynamics
  • Deterministic forward execution (calc() = one time step)
  • Runtime topology growth (add/remove neurons and connections)
  • Structural mutation utilities (weights, biases, activations, topology)
  • Deterministic weight & bias vectorization (get_weights, set_weights)
  • YAML / JSON serialization of full topology and parameters
  • Graphviz-based network visualization
  • Lightweight Python implementation with small runtime dependency

Quick Example

from evonet import Nnet, NeuronRole

net = Nnet()
net.add_layer()  # Input layer
net.add_layer()  # Output layer

net.add_neuron(layer_idx=0, role=NeuronRole.INPUT, activation="linear", connection_init="none", label="in")
net.add_neuron(layer_idx=1, role=NeuronRole.OUTPUT, activation="linear", bias=0.5, label="out")

result = net.calc([1.0])

Recurrent Connections & Delay

from evonet import ConnectionType

net.add_connection(
    src,
    dst,
    weight=0.8,
    conn_type=ConnectionType.RECURRENT,
    delay=2,   # uses output from t-2
)

Semantics:

  • delay = 1 → previous time step
  • delay > 1 → buffered history
  • delay = 0 is normalized to 1 for recurrent edges

A full reset (net.reset(full=True)) clears all delay buffers.


Neuron Dynamics

Neuron behaviour is defined locally at the neuron level:

net.add_neuron(
    layer_idx=1,
    activation="tanh",
    dynamics_name="leaky",
    dynamics_params={"alpha": 0.2},
)

Current built-in dynamics:

  • standard – stateless activation
  • leaky – leaky integrator using last_output

Dynamics are evaluated inside the neuron, not at network level.


Structural Mutation Utilities

The evonet.mutation module provides mutation operators for:

  • mutate weights / biases (Gaussian noise)
  • mutate activations (global or layer-specific)
  • add/remove random connections
  • add/remove random hidden neurons
  • control recurrent edge kinds (direct, lateral, indirect)
  • neutral or near-zero initialization

EvoNet itself does not decide when or why to mutate — that logic belongs in EvoLib.


Serialization

Network topology, parameters, and configuration can be saved and restored:

net.save("network.yaml")
net = Nnet.load("network.yaml")

Supported formats:

  • YAML (recommended, human-readable)
  • JSON (machine-friendly)

Serialization includes: layers, neurons, activations, biases, dynamics, connections, types, and delays.


Relationship to EvoLib

  • EvoNet: execution, structure, state
  • EvoLib: evolution strategy, fitness, mutation scheduling, environments

EvoNet is intentionally usable as a standalone library. Evolutionary control, fitness evaluation, and mutation scheduling are provided by EvoLib.


License

MIT License - see MIT License.

Release files for evonet 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for evonet 0.3.0
File Size Uploaded
evonet-0.3.0.tar.gz 35.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for evonet 0.3.0
File Interpreter ABI Platform
evonet-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 71.9 kB

Release files / evonet-0.3.0.tar.gz

Download URL evonet-0.3.0.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cbf240acdb021bb4f6d150a40164781ab1334fb07afd834bc3cfaac5030d6827
BLAKE2b-256 checksum
How to use checksums
8a1323606e6c2dd1994a0f655d991be1c614813479356b6bbcb492e6df794fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / evonet-0.3.0-py3-none-any.whl

Download URL evonet-0.3.0-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14a828f4df4afc7a6e135791447f34ff73a70d330b848025a6daac8fdcefff46
BLAKE2b-256 checksum
How to use checksums
6aa16381acdb11d6925987ae8e68d7d2b96132a0a2ba55a1ebc9098eda6e18a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page