EvoNet

EvoLib integration layer for EvoNet.

Provides an interface to EvoNet networks so it can be used inside EvoLib’s evolutionary pipeline. Supports configuration, mutation, crossover, and conversion to/from vector form.

class evolib.representation.evonet.EvoNet[source]

Bases: ParaBase

Wrapper class for EvoNet.

Responsibilities: - Build and configure neural networks from YAML/typed configs - Provide mutation (weights, biases, activations, structure) - Provide crossover at weight/bias level (no structural crossover) - Expose network parameters as flat vectors for integration

apply_config(cfg)[source]

Initializes parameters from a configuration object.

Return type:

None

calc(input_values)[source]
Return type:

list[float]

crossover_with(partner)[source]

Perform crossover on weights and biases if topologies are compatible.

Structural crossover is not supported.

Return type:

None

get_biases()[source]

Return network biases (non-input neurons).

Return type:

ndarray

get_status()[source]
Return type:

str

get_vector()[source]

Return a flat vector containing all weights and biases.

Return type:

ndarray

get_weights()[source]

Return network weights in the canonical order defined by Nnet.

Return type:

ndarray

mutate()[source]

Applies mutation to the parameters.

Return type:

None

plot(name, engine='neato', labels_on=True, colors_on=True, thickness_on=False, fillcolors_on=False)[source]

Prints the graph structure of the EvoNet.

Parameters:
  • name (str) – Output filename (without extension).

  • engine (str) – Layout engine for Graphviz.

  • labels_on (bool) – Show edge weights as labels.

  • colors_on (bool) – Use color coding for edge weights.

  • thickness_on (bool) – Adjust edge thickness by weight.

  • fillcolors_on (bool) – Fill nodes with colors by type.

Return type:

None

print_status()[source]
Return type:

None

set_biases(biases)[source]

Set network biases; length must match num_biases.

Return type:

None

set_vector(vector)[source]

Split a flat vector into weights and biases and apply them to the network.

Return type:

None

set_weights(weights)[source]

Set network weights; length must match num_weights.

Return type:

None

update_mutation_parameters(generation, max_generations, diversity_ema=None)[source]

Optional: Override in subclasses that support strategy-dependent mutation control.

Return type:

None