evolib 0.2.0b4.dev6__tar.gz → 0.2.0b4.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {evolib-0.2.0b4.dev6/evolib.egg-info → evolib-0.2.0b4.dev8}/PKG-INFO +1 -2
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/README.md +0 -1
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/config_guide.md +7 -4
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/config_parameter.md +144 -37
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/evonet_component_config.py +128 -16
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/vector_component_config.py +1 -1
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/initializers/evonet_initializers.py +95 -91
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/initializers/registry.py +2 -6
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/evonet.py +26 -14
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8/evolib.egg-info}/PKG-INFO +1 -2
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/pyproject.toml +1 -1
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_evonet_neuron_dynamics.py +16 -4
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_initializer_evonet.py +12 -3
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/LICENSE +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/MANIFEST.in +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_core_individual.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_core_population.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_crossover.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_evonet_structural_mutation.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_mutation.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_replacement.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_reproduction.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_selection.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_operators_strategy.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_public_api.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_representation_evonet.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_representation_netvector.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_representation_vector.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_utils_benchmarks.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_utils_history_logger.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_utils_loss_functions.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/api_utils_plotting.rst +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/conf.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/getting_started.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/docs/index.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/api.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/base_component_config.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/component_registry.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/config/schema.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/core/README.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/core/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/core/individual.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/core/population.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/envs/gym_wrapper.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/globals/README.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/globals/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/globals/numeric.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/initializers/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/initializers/net_initializers.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/initializers/vector_initializers.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/interfaces/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/interfaces/enum_helpers.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/interfaces/enums.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/interfaces/structs.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/interfaces/types.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/io/checkpoint.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/io/serialization.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/README.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/crossover.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/evonet_structural_mutation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/heli.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/mutation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/replacement.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/reproduction.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/selection.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/operators/strategy.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/registry/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/registry/replacement_registry.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/registry/selection_registry.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/registry/strategy_registry.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/_apply_config_mapping.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/base.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/composite.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/dummy.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/evo_params.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/netvector.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/representation/vector.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/README.md +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/__init__.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/benchmarks.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/config_loader.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/fitness.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/heli_experiment_logger.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/heli_utils.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/history_logger.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/lineage_logger.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/loss_functions.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/parallel.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/plotting.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/random.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib/utils/registry.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib.egg-info/SOURCES.txt +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib.egg-info/dependency_links.txt +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib.egg-info/requires.txt +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/evolib.egg-info/top_level.txt +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/01_basic_usage/01_getting_started.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/01_basic_usage/02_mutation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/01_basic_usage/03_population_mutation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/01_basic_usage/04_fitness.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/02_strategies/01_step_by_step_evolution.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/02_strategies/02_mu_lambda_step.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/02_strategies/03_mu_lambda.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/02_strategies/04_flexible.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/01_history.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/02_plotting.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/03_compare_runs.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/04_exponential_decay_vs_static.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/05_adaptive_global_vs_static.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/06_adaptive_individual_vs_static.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/07_selection_comparison.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/08_selection_pressure.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/09_selection_vs_mutation_pressure.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/10_selection_stochastic_vs_deterministic.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/03_comparisons/11_crossover_comparison.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/04_function_approximation/01_polynomial_sine.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/04_function_approximation/02_sine_point_approximation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/04_function_approximation/03_approximation_with_noise.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/01_fitness_landscape_exploration.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/02_rosenbrock_surface_path.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/03_vector_control.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/04_vector_control_with_obstacles.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/05_piecewise_linear_xsys.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/05_advanced_topics/06_evolving_mutation_strength_as_a_module.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/06_netvector/01_netvector_sine_approximation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/06_netvector/02_netvector_modulated_output.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/06_netvector/03_netvector_gain_and_bias.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/01_sine_approximation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/02_sine_delay.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/03_delay_bitseq_echo.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/04_leaky_temporal_smoothing.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/05_image_approximation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/06_structural_xor.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/07_recurrent_bit_prediction.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/08_recurrent_timeseries.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/07_evonet/09_recurrent_trading.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/08_gym/01_frozen_lake.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/08_gym/02_cliff_walking.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/08_gym/03_cartpole.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/08_gym/04_lunar_lander.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/08_gym/05_bipedal_walker.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/09_meta_learning/01_lamarck_linear_mapping.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/examples/09_meta_learning/02_meta_mapping_baldwin.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/setup.cfg +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_benchmarks.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_config_loader.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_elitism_preserves_best_fitness.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_evonet_deepcopy.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_evonet_vector_io.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_initializer_net.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_mutation.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_population.py +0 -0
- {evolib-0.2.0b4.dev6 → evolib-0.2.0b4.dev8}/tests/test_selection.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: evolib
|
|
3
|
-
Version: 0.2.0b4.
|
|
3
|
+
Version: 0.2.0b4.dev8
|
|
4
4
|
Summary: A modular framework for evolutionary strategies and neuroevolution.
|
|
5
5
|
Author-email: EvoLib <evolib@dismail.de>
|
|
6
6
|
License: MIT License
|
|
@@ -164,7 +164,6 @@ modules:
|
|
|
164
164
|
type: evonet
|
|
165
165
|
dim: [4, 6, 2]
|
|
166
166
|
activation: [linear, tanh, tanh]
|
|
167
|
-
initializer: normal_evonet
|
|
168
167
|
mutation:
|
|
169
168
|
strategy: constant
|
|
170
169
|
probability: 1.0
|
|
@@ -145,11 +145,14 @@ modules:
|
|
|
145
145
|
type: evonet
|
|
146
146
|
dim: [2, 0, 0, 1] # hidden layers start empty
|
|
147
147
|
activation: [linear, tanh, tanh, sigmoid]
|
|
148
|
-
initializer: normal_evonet
|
|
149
148
|
weights:
|
|
149
|
+
initializer: normal
|
|
150
|
+
std: 0.5
|
|
150
151
|
bounds: [-5.0, 5.0]
|
|
151
|
-
bias:
|
|
152
|
-
|
|
152
|
+
bias:
|
|
153
|
+
initializer: normal
|
|
154
|
+
std: 0.5
|
|
155
|
+
bounds: [-1.0, 1.0]
|
|
153
156
|
|
|
154
157
|
recurrent: direct # REQUIRED for delay to have any effect
|
|
155
158
|
|
|
@@ -157,7 +160,7 @@ modules:
|
|
|
157
160
|
# If `recurrent` is not enabled, this block has no effect.
|
|
158
161
|
delay:
|
|
159
162
|
initializer: uniform # uniform | fixed
|
|
160
|
-
bounds: [1, 8]
|
|
163
|
+
bounds: [1, 8]
|
|
161
164
|
# value: 3 # only for fixed
|
|
162
165
|
|
|
163
166
|
mutation:
|
|
@@ -138,44 +138,146 @@ evolution:
|
|
|
138
138
|
## Modules
|
|
139
139
|
|
|
140
140
|
Modules define the parameter representation(s) of each individual. Multiple modules can be combined.
|
|
141
|
+
Depending on `structure`, the vector can represent a simple flat genome or a
|
|
142
|
+
structured parameter layout (e.g. network-like interpretation).
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### Vector Module
|
|
147
|
+
|
|
148
|
+
The `vector` module defines an evolvable parameter vector.
|
|
149
|
+
|
|
150
|
+
| Parameter | Type | Default | Description |
|
|
151
|
+
|----------------------------------|---------------------------------------------------|----------------|------------|
|
|
152
|
+
| `type` | `"vector"` | — | Module type identifier. |
|
|
153
|
+
| `dim` | `int \| list[int]` | — | Vector length (`int`) or structured dimensions (`list[int]`). Must be > 0. |
|
|
154
|
+
| `structure` | `"flat" \| "net" | `"flat"` | Structural interpretation of the vector. |
|
|
155
|
+
| `initializer` | `str` | — | Initializer name from the registry (e.g. `random_vector`, `zero_vector`, `normal_vector`, `fixed_vector`). |
|
|
156
|
+
| `bounds` | `tuple[float, float]` | `[-1.0, 1.0]` | Hard clamp range applied after mutation. |
|
|
157
|
+
| `init_bounds` | `tuple[float, float] \| null` | `null` | Clamp applied only during initialization. Falls back to `bounds` if not set. |
|
|
158
|
+
| `shape` | `tuple[int, ...] \| null` | `null` | Optional explicit shape. If set, `dim = product(shape)`. Shape is retained as metadata. |
|
|
159
|
+
| `values` | `list[float] \| null` | `null` | Required for `initializer: fixed_vector`. If `dim` is omitted, it is inferred from `len(values)`. |
|
|
160
|
+
| `activation` | `str \| null` | `null` | Only relevant if `structure: "net"`. |
|
|
161
|
+
| `mean` | `float \| null` | `0.0` | Mean parameter for normal-based initializers (if used by initializer). |
|
|
162
|
+
| `std` | `float \| null` | `1.0` | Standard deviation for normal-based initializers (if used by initializer). |
|
|
163
|
+
| `mutation` | `dict` | — | **Required.** Mutation configuration (see below). |
|
|
164
|
+
| `randomize_mutation_strengths` | `bool \| null` | `false` | If true, per-parameter strengths are randomly initialized within min/max bounds (strategy-dependent). |
|
|
165
|
+
| `tau` | `float \| null` | `0.0` | Scaling factor for self-adaptive mutation strategies. Interpretation is strategy-dependent. |
|
|
166
|
+
| `crossover` | `dict \| null` | `null` | Optional crossover configuration. Semantics depend on operator. |
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## Mutation Configuration
|
|
170
|
+
|
|
171
|
+
The `mutation` block must follow the `MutationConfig` schema.
|
|
141
172
|
|
|
142
173
|
### Common Fields
|
|
143
174
|
|
|
144
|
-
| Parameter
|
|
145
|
-
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
175
|
+
| Parameter | Type | Description |
|
|
176
|
+
|-----------------|----------|-------------|
|
|
177
|
+
| `strategy` | `str` | Mutation strategy (e.g. `constant`, `adaptive_individual`, `adaptive_global`). |
|
|
178
|
+
| `probability` | `float` | Mutation probability.|
|
|
179
|
+
| `strength` | `float` | Mutation strength.|
|
|
149
180
|
|
|
150
181
|
---
|
|
151
182
|
|
|
152
|
-
###
|
|
183
|
+
### Strategy: `constant`
|
|
153
184
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
185
|
+
Uses a fixed mutation strength.
|
|
186
|
+
|
|
187
|
+
Requires:
|
|
188
|
+
- `probability`
|
|
189
|
+
- `strength`
|
|
190
|
+
|
|
191
|
+
```yaml
|
|
192
|
+
mutation:
|
|
193
|
+
strategy: constant
|
|
194
|
+
probability: 1.0
|
|
195
|
+
strength: 0.05
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Strategy: `adaptive_individual`
|
|
199
|
+
|
|
200
|
+
Self-adaptive mutation at the individual level.
|
|
201
|
+
|
|
202
|
+
Requires:
|
|
203
|
+
- `probability`
|
|
204
|
+
- `min_strength`
|
|
205
|
+
- `max_strength`
|
|
206
|
+
|
|
207
|
+
```yaml
|
|
208
|
+
mutation:
|
|
209
|
+
strategy: adaptive_individual
|
|
210
|
+
probability: 1.0
|
|
211
|
+
min_strength: 0.01
|
|
212
|
+
max_strength: 0.05
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Strategy: `adaptive_global`
|
|
216
|
+
|
|
217
|
+
Global self-adaptive mutation strength shared across parameters.
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
mutation:
|
|
221
|
+
strategy: adaptive_global
|
|
222
|
+
probability: 1.0
|
|
223
|
+
min_strength: 0.01
|
|
224
|
+
max_strength: 0.1
|
|
225
|
+
```
|
|
163
226
|
|
|
164
|
-
|
|
227
|
+
|
|
228
|
+
### Minimal Example:
|
|
165
229
|
|
|
166
230
|
```yaml
|
|
167
231
|
modules:
|
|
168
232
|
main:
|
|
169
233
|
type: vector
|
|
170
234
|
dim: 8
|
|
171
|
-
initializer:
|
|
235
|
+
initializer: random_vector
|
|
172
236
|
bounds: [-1.0, 1.0]
|
|
237
|
+
|
|
173
238
|
mutation:
|
|
174
|
-
strategy:
|
|
239
|
+
strategy: constant
|
|
175
240
|
probability: 1.0
|
|
176
|
-
strength: 0.
|
|
241
|
+
strength: 0.05
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Fixed Vector Example
|
|
245
|
+
```yaml
|
|
246
|
+
modules:
|
|
247
|
+
main:
|
|
248
|
+
type: vector
|
|
249
|
+
initializer: fixed_vector
|
|
250
|
+
values: [0.0, 1.0, 0.5, -0.5]
|
|
251
|
+
bounds: [-1.0, 1.0]
|
|
252
|
+
|
|
253
|
+
mutation:
|
|
254
|
+
strategy: constant
|
|
255
|
+
probability: 1.0
|
|
256
|
+
strength: 0.01
|
|
177
257
|
```
|
|
258
|
+
If dim is omitted, it is inferred from values.
|
|
178
259
|
|
|
260
|
+
### Advanced Example (Self-Adaptive)
|
|
261
|
+
```yaml
|
|
262
|
+
modules:
|
|
263
|
+
main:
|
|
264
|
+
type: vector
|
|
265
|
+
structure: flat
|
|
266
|
+
dim: 6
|
|
267
|
+
initializer: normal_vector
|
|
268
|
+
mean: 0.0
|
|
269
|
+
std: 0.2
|
|
270
|
+
bounds: [-1.0, 1.0]
|
|
271
|
+
|
|
272
|
+
mutation:
|
|
273
|
+
strategy: adaptive_individual
|
|
274
|
+
probability: 0.8
|
|
275
|
+
min_strength: 0.01
|
|
276
|
+
max_strength: 0.05
|
|
277
|
+
|
|
278
|
+
tau: 0.0
|
|
279
|
+
randomize_mutation_strengths: false
|
|
280
|
+
```
|
|
179
281
|
---
|
|
180
282
|
|
|
181
283
|
### EvoNet Module
|
|
@@ -186,7 +288,7 @@ modules:
|
|
|
186
288
|
|-------------------|---------------------|---------|-------------|
|
|
187
289
|
| `dim` | list[int] | — | Layer sizes, e.g. `[4, 0, 0, 2]`. Hidden layers can start empty (0) and grow through structural mutation. |
|
|
188
290
|
| `activation` | str \| list[str] | — | If list: activation per layer. If str: used for non-input layers; input layer is treated as linear. |
|
|
189
|
-
| `initializer` | str |
|
|
291
|
+
| `initializer` | str | default_evonet | Topology preset (e.g. `default_evonet`, `unconnected_evonet`, `identity_evonet`). Parameter initialization is configured via `weights`, `bias`, and `delay`. |
|
|
190
292
|
| `weights` | dict | — | Weight init and bounds configuration (initializer, bounds, optional params). |
|
|
191
293
|
| `bias` | dict | — | Bias init and bounds configuration (initializer, bounds, optional params). |
|
|
192
294
|
| `neuron_dynamics` | list[dict] \| null | null | Optional per-layer neuron dynamics specification. Must match `len(dim)`. |
|
|
@@ -197,30 +299,34 @@ modules:
|
|
|
197
299
|
|Parameter | Type | Default | Explanation |
|
|
198
300
|
|------------|-------|-----------|-------------|
|
|
199
301
|
|initializer | str | "normal" | Weight initializer preset (normal, uniform, zero, …). |
|
|
200
|
-
|bounds | list[float] | [-
|
|
302
|
+
|bounds | list[float] | [-0.5, 0.5] | Hard clipping bounds. |
|
|
201
303
|
|std | float | null |null | Std-dev for normal (if used). |
|
|
202
304
|
|
|
203
305
|
##### bias block
|
|
204
306
|
|Parameter | Type | Default | Explanation |
|
|
205
307
|
|------------|-------|-----------|-------------|
|
|
206
|
-
|initializer | str | "normal" |
|
|
207
|
-
|bounds | list[float] | [-1.0, 1.0] | Hard clipping bounds
|
|
208
|
-
|std | float | null |
|
|
308
|
+
|initializer | str | "normal" | Bias initializer preset (normal, uniform, zero, …). |
|
|
309
|
+
|bounds | list[float] | [-1.0, 1.0] | Hard clipping bounds. |
|
|
310
|
+
|std | float | null | Std-dev for normal (if used). |
|
|
209
311
|
|
|
210
312
|
---
|
|
211
313
|
|
|
212
|
-
#### EvoNet Initializer
|
|
314
|
+
#### EvoNet Initializer (Topology Presets)
|
|
315
|
+
|
|
316
|
+
`initializer` selects a **topology preset**.
|
|
213
317
|
|
|
214
|
-
|
|
318
|
+
Parameter initialization is configured via:
|
|
319
|
+
- `weights`
|
|
320
|
+
- `bias`
|
|
321
|
+
- `delay` (recurrent connections only)
|
|
215
322
|
|
|
216
|
-
|
|
217
|
-
|---------------------|------------------------------------|----------------------------------|---------------------------------------------|
|
|
218
|
-
| `normal_evonet` | Normal(0, 0.5) | Normal(0, 0.5) | Default initializer for general use |
|
|
219
|
-
| `unconnected_evonet`| None | 0 | For pure structural growth; empty topology |
|
|
220
|
-
| `random_evonet` | Random | Uniform(bias bounds) | For broader stochastic exploration |
|
|
221
|
-
| `zero_evonet` | 0 | 0 | Deterministic baseline; debugging |
|
|
222
|
-
| `identity_evonet` | Small random | Small random | Designed for stable recurrent memory |
|
|
323
|
+
Allowed presets:
|
|
223
324
|
|
|
325
|
+
| Initializer | Meaning (topology only) |
|
|
326
|
+
|------------------------|-------------------------|
|
|
327
|
+
| `default_evonet` | Standard EvoNet topology preset (uses `connection_scope`, `connection_density`, and `recurrent`). |
|
|
328
|
+
| `unconnected_evonet` | Creates neurons/layers but starts with **no connections** (use structural mutation to grow). |
|
|
329
|
+
| `identity_evonet` | Special preset intended for stable recurrent memory (may override parameters internally; see notes below). |
|
|
224
330
|
|
|
225
331
|
---
|
|
226
332
|
|
|
@@ -246,7 +352,6 @@ modules:
|
|
|
246
352
|
type: evonet
|
|
247
353
|
dim: [1, 16, 1]
|
|
248
354
|
activation: [linear, tanh, sigmoid]
|
|
249
|
-
initializer: normal_evonet
|
|
250
355
|
neuron_dynamics:
|
|
251
356
|
- name: standard
|
|
252
357
|
params: {}
|
|
@@ -276,7 +381,7 @@ modules:
|
|
|
276
381
|
...
|
|
277
382
|
delay:
|
|
278
383
|
initializer: uniform # uniform | fixed
|
|
279
|
-
bounds: [1, 8]
|
|
384
|
+
bounds: [1, 8]
|
|
280
385
|
# value: 3 # only for fixed
|
|
281
386
|
```
|
|
282
387
|
|
|
@@ -390,9 +495,9 @@ structural:
|
|
|
390
495
|
|
|
391
496
|
| Field | Type | Default | Description |
|
|
392
497
|
|---------------------|---------------|----------|-------------|
|
|
393
|
-
| `recurrent` | str | `none` | Controls recurrence: `none`, `direct`, `
|
|
498
|
+
| `recurrent` | str | `none` | Controls recurrence: `none`, `direct`, `local` or `all`. |
|
|
394
499
|
| `connection_scope` | str | `adjacent` | Allowed layer connectivity: `adjacent` (neighbor layers only) or `crosslayer` (any-to-any). |
|
|
395
|
-
| `connection_density` | float
|
|
500
|
+
| `connection_density` | float | 1.0 | Fraction of possible connections initialized at creation time. |
|
|
396
501
|
| `max_neurons` | int \| null | null | Maximum number of non-input neurons (`null` = unlimited). |
|
|
397
502
|
| `max_connections` | int \| null | null | Maximum number of edges (`null` = unlimited). |
|
|
398
503
|
|
|
@@ -432,6 +537,8 @@ modules:
|
|
|
432
537
|
strategy: adaptive_individual
|
|
433
538
|
probability: 1.0
|
|
434
539
|
strength: 0.1
|
|
540
|
+
min_strength: 0.01
|
|
541
|
+
max_strength: 0.05
|
|
435
542
|
|
|
436
543
|
brain:
|
|
437
544
|
type: evonet
|
|
@@ -31,25 +31,112 @@ from evolib.config.base_component_config import (
|
|
|
31
31
|
StructuralMutationConfig,
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
+
Bounds = Tuple[float, float]
|
|
35
|
+
|
|
34
36
|
|
|
35
37
|
class WeightsConfig(BaseModel):
|
|
36
|
-
|
|
38
|
+
# None means: no parameter-level initialization requested (preset may initialize).
|
|
39
|
+
initializer: Optional[str] = None # normal | uniform | zero | None
|
|
40
|
+
std: Optional[float] = None
|
|
41
|
+
bounds: Bounds = (-1.0, 1.0) # mutation/search bounds
|
|
42
|
+
init_bounds: Optional[Bounds] = None # init-time clipping bounds
|
|
37
43
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
@model_validator(mode="after")
|
|
45
|
+
def _validate(self) -> "WeightsConfig":
|
|
46
|
+
# Validate bounds
|
|
47
|
+
lo, hi = self.bounds
|
|
48
|
+
if lo >= hi:
|
|
49
|
+
raise ValueError("weights.bounds must satisfy lower < upper")
|
|
50
|
+
|
|
51
|
+
if self.init_bounds is not None:
|
|
52
|
+
ilo, ihi = self.init_bounds
|
|
53
|
+
if ilo >= ihi:
|
|
54
|
+
raise ValueError("weights.init_bounds must satisfy lower < upper")
|
|
55
|
+
if not (lo <= ilo and ihi <= hi):
|
|
56
|
+
raise ValueError("weights.init_bounds must lie within weights.bounds")
|
|
57
|
+
|
|
58
|
+
# Validate initializer-specific fields
|
|
59
|
+
if self.initializer is None:
|
|
60
|
+
# Preset-based initialization
|
|
61
|
+
if self.std is not None:
|
|
62
|
+
raise ValueError(
|
|
63
|
+
"weights.std is not allowed when " "weights.initializer is not set"
|
|
64
|
+
)
|
|
65
|
+
return self
|
|
66
|
+
|
|
67
|
+
if self.initializer == "normal":
|
|
68
|
+
if self.std is None or self.std <= 0:
|
|
69
|
+
raise ValueError(
|
|
70
|
+
"weights.std must be set and > 0 for initializer=normal"
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
elif self.initializer in ("uniform", "zero"):
|
|
74
|
+
if self.std is not None:
|
|
75
|
+
raise ValueError("weights.std is only allowed for initializer=normal")
|
|
76
|
+
|
|
77
|
+
else:
|
|
78
|
+
raise ValueError(f"Unknown weights initializer: {self.initializer}")
|
|
79
|
+
|
|
80
|
+
return self
|
|
43
81
|
|
|
44
82
|
|
|
45
83
|
class BiasConfig(BaseModel):
|
|
46
|
-
|
|
84
|
+
# None means: no parameter-level initialization requested (preset may initialize).
|
|
85
|
+
initializer: Optional[str] = None # fixed | normal | uniform | zero | None
|
|
86
|
+
std: Optional[float] = None
|
|
87
|
+
value: Optional[float] = None
|
|
88
|
+
bounds: Bounds = (-0.5, 0.5) # mutation/search bounds
|
|
89
|
+
init_bounds: Optional[Bounds] = None # init-time clipping bounds (optional)
|
|
47
90
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
91
|
+
@model_validator(mode="after")
|
|
92
|
+
def _validate(self) -> "BiasConfig":
|
|
93
|
+
# Validate bounds
|
|
94
|
+
lo, hi = self.bounds
|
|
95
|
+
if lo >= hi:
|
|
96
|
+
raise ValueError("bias.bounds must satisfy lower < upper")
|
|
97
|
+
|
|
98
|
+
if self.init_bounds is not None:
|
|
99
|
+
ilo, ihi = self.init_bounds
|
|
100
|
+
if ilo >= ihi:
|
|
101
|
+
raise ValueError("bias.init_bounds must satisfy lower < upper")
|
|
102
|
+
if not (lo <= ilo and ihi <= hi):
|
|
103
|
+
raise ValueError("bias.init_bounds must lie within bias.bounds")
|
|
104
|
+
|
|
105
|
+
# Validate initializer-specific fields
|
|
106
|
+
if self.initializer is None:
|
|
107
|
+
# Preset-based initialization
|
|
108
|
+
if self.std is not None:
|
|
109
|
+
raise ValueError(
|
|
110
|
+
"bias.std is not allowed when bias.initializer is not set"
|
|
111
|
+
)
|
|
112
|
+
if self.value is not None:
|
|
113
|
+
raise ValueError(
|
|
114
|
+
"bias.value is not allowed when bias.initializer is not set"
|
|
115
|
+
)
|
|
116
|
+
return self
|
|
117
|
+
|
|
118
|
+
if self.initializer == "fixed":
|
|
119
|
+
if self.value is None:
|
|
120
|
+
raise ValueError("bias.value is required for initializer=fixed")
|
|
121
|
+
if self.std is not None:
|
|
122
|
+
raise ValueError("bias.std is not allowed for initializer=fixed")
|
|
123
|
+
|
|
124
|
+
elif self.initializer == "normal":
|
|
125
|
+
if self.std is None or self.std <= 0:
|
|
126
|
+
raise ValueError("bias.std must be set and > 0 for initializer=normal")
|
|
127
|
+
if self.value is not None:
|
|
128
|
+
raise ValueError("bias.value is only allowed for initializer=fixed")
|
|
129
|
+
|
|
130
|
+
elif self.initializer in ("uniform", "zero"):
|
|
131
|
+
if self.std is not None:
|
|
132
|
+
raise ValueError("bias.std is only allowed for initializer=normal")
|
|
133
|
+
if self.value is not None:
|
|
134
|
+
raise ValueError("bias.value is only allowed for initializer=fixed")
|
|
135
|
+
|
|
136
|
+
else:
|
|
137
|
+
raise ValueError(f"Unknown bias initializer: {self.initializer}")
|
|
138
|
+
|
|
139
|
+
return self
|
|
53
140
|
|
|
54
141
|
|
|
55
142
|
class DelayConfig(BaseModel):
|
|
@@ -102,15 +189,15 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
102
189
|
type: evonet
|
|
103
190
|
dim: [4, 6, 2] # input, hidden, output
|
|
104
191
|
activation: [linear, relu, sigmoid] # single activation or list per layer
|
|
105
|
-
initializer: normal_evonet # weight/bias initializer
|
|
106
192
|
|
|
107
193
|
weights:
|
|
108
194
|
initializer: normal
|
|
195
|
+
std: 0.5
|
|
109
196
|
bounds: [-1.0, 1.0]
|
|
110
197
|
|
|
111
198
|
bias:
|
|
112
|
-
|
|
113
|
-
|
|
199
|
+
initializer: uniform
|
|
200
|
+
bounds: [-0.5, 0.5]
|
|
114
201
|
|
|
115
202
|
mutation:
|
|
116
203
|
strategy: constant
|
|
@@ -140,7 +227,9 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
140
227
|
recurrent: Optional[Literal["none", "direct", "local", "all"]] = "none"
|
|
141
228
|
|
|
142
229
|
# Name of the initializer function (resolved via initializer registry)
|
|
143
|
-
initializer: str = Field(
|
|
230
|
+
initializer: str = Field(
|
|
231
|
+
default="default_evonet", description="Name of the initializer to use"
|
|
232
|
+
)
|
|
144
233
|
|
|
145
234
|
# Connection topology for initialization
|
|
146
235
|
connection_scope: Literal["adjacent", "crosslayer"] = Field(
|
|
@@ -178,6 +267,29 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
178
267
|
structural: Optional[StructuralMutationConfig] = None
|
|
179
268
|
|
|
180
269
|
# Validators
|
|
270
|
+
@field_validator("initializer")
|
|
271
|
+
@classmethod
|
|
272
|
+
def validate_initializer(cls, name: str) -> str:
|
|
273
|
+
"""
|
|
274
|
+
Validate that the initializer is one of the allowed topology presets.
|
|
275
|
+
|
|
276
|
+
Parameter initialization is handled exclusively via weights/bias/delay blocks.
|
|
277
|
+
"""
|
|
278
|
+
allowed = {
|
|
279
|
+
"default_evonet",
|
|
280
|
+
"unconnected_evonet",
|
|
281
|
+
"identity_evonet",
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if name not in allowed:
|
|
285
|
+
raise ValueError(
|
|
286
|
+
f"Unknown EvoNet initializer '{name}'. "
|
|
287
|
+
f"Allowed values: {sorted(allowed)}. "
|
|
288
|
+
"Parameter initialization is configured via "
|
|
289
|
+
"'weights', 'bias', and 'delay'."
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
return name
|
|
181
293
|
|
|
182
294
|
@field_validator("neuron_dynamics")
|
|
183
295
|
@classmethod
|
|
@@ -101,7 +101,7 @@ class VectorComponentConfig(BaseModel):
|
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
# Evolution (mutation / crossover)
|
|
104
|
-
mutation:
|
|
104
|
+
mutation: MutationConfig = Field(
|
|
105
105
|
default=None,
|
|
106
106
|
description=(
|
|
107
107
|
"Mutation configuration. By default, 'probability' is an element-wise rate "
|