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.2.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.2.0
File Size Uploaded
evonet-0.2.0.tar.gz 29.8 kB Details

Built distribution (wheel)

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

Total release size: 60.2 kB

Release files / evonet-0.2.0.tar.gz

Download URL evonet-0.2.0.tar.gz
Size 29.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d9dca3da3e9f05ceefd03b2ad2a15c7f83c98a1396260ab93d042da51bbf67f3
BLAKE2b-256 checksum
How to use checksums
00c6432d2162ea3b6d12d7c132704c00f41bb387f9ca1a8e8187fed56cde1842
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.2.0-py3-none-any.whl

Download URL evonet-0.2.0-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4802ab598002c184d1c603ac6a8ee5d0357f372ee9dddbeaf48821ce2c3fdc4f
BLAKE2b-256 checksum
How to use checksums
aaa0604fec5c89485becbe7037b9945d19d1f132ec39608304f73cd5c66fa3f1
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