evolib 0.2.0b4.dev7__tar.gz → 0.2.0b4.dev9__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.dev7/evolib.egg-info → evolib-0.2.0b4.dev9}/PKG-INFO +1 -2
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/README.md +0 -1
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/config_guide.md +9 -6
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/config_parameter.md +144 -37
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/evonet_component_config.py +31 -3
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/vector_component_config.py +41 -10
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/initializers/evonet_initializers.py +10 -47
- evolib-0.2.0b4.dev9/evolib/initializers/registry.py +112 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/interfaces/enums.py +1 -2
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9/evolib.egg-info}/PKG-INFO +1 -2
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/02_strategies/01_step_by_step_evolution.py +2 -2
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/06_evolving_mutation_strength_as_a_module.py +1 -1
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/pyproject.toml +1 -1
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_config_loader.py +1 -1
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_evonet_neuron_dynamics.py +3 -4
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_initializer_evonet.py +3 -4
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_initializer_net.py +3 -3
- evolib-0.2.0b4.dev7/evolib/initializers/registry.py +0 -89
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/LICENSE +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/MANIFEST.in +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_core_individual.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_core_population.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_crossover.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_evonet_structural_mutation.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_mutation.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_replacement.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_reproduction.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_selection.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_operators_strategy.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_public_api.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_representation_evonet.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_representation_netvector.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_representation_vector.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_utils_benchmarks.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_utils_history_logger.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_utils_loss_functions.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/api_utils_plotting.rst +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/conf.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/getting_started.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/docs/index.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/api.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/base_component_config.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/component_registry.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/config/schema.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/core/README.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/core/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/core/individual.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/core/population.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/envs/gym_wrapper.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/globals/README.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/globals/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/globals/numeric.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/initializers/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/initializers/net_initializers.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/initializers/vector_initializers.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/interfaces/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/interfaces/enum_helpers.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/interfaces/structs.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/interfaces/types.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/io/checkpoint.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/io/serialization.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/README.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/crossover.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/evonet_structural_mutation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/heli.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/mutation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/replacement.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/reproduction.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/selection.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/operators/strategy.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/registry/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/registry/replacement_registry.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/registry/selection_registry.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/registry/strategy_registry.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/_apply_config_mapping.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/base.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/composite.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/dummy.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/evo_params.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/evonet.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/netvector.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/representation/vector.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/README.md +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/__init__.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/benchmarks.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/config_loader.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/fitness.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/heli_experiment_logger.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/heli_utils.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/history_logger.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/lineage_logger.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/loss_functions.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/parallel.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/plotting.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/random.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib/utils/registry.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib.egg-info/SOURCES.txt +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib.egg-info/dependency_links.txt +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib.egg-info/requires.txt +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/evolib.egg-info/top_level.txt +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/01_basic_usage/01_getting_started.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/01_basic_usage/02_mutation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/01_basic_usage/03_population_mutation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/01_basic_usage/04_fitness.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/02_strategies/02_mu_lambda_step.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/02_strategies/03_mu_lambda.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/02_strategies/04_flexible.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/01_history.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/02_plotting.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/03_compare_runs.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/04_exponential_decay_vs_static.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/05_adaptive_global_vs_static.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/06_adaptive_individual_vs_static.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/07_selection_comparison.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/08_selection_pressure.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/09_selection_vs_mutation_pressure.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/10_selection_stochastic_vs_deterministic.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/03_comparisons/11_crossover_comparison.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/04_function_approximation/01_polynomial_sine.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/04_function_approximation/02_sine_point_approximation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/04_function_approximation/03_approximation_with_noise.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/01_fitness_landscape_exploration.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/02_rosenbrock_surface_path.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/03_vector_control.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/04_vector_control_with_obstacles.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/05_advanced_topics/05_piecewise_linear_xsys.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/06_netvector/01_netvector_sine_approximation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/06_netvector/02_netvector_modulated_output.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/06_netvector/03_netvector_gain_and_bias.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/01_sine_approximation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/02_sine_delay.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/03_delay_bitseq_echo.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/04_leaky_temporal_smoothing.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/05_image_approximation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/06_structural_xor.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/07_recurrent_bit_prediction.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/08_recurrent_timeseries.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/07_evonet/09_recurrent_trading.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/08_gym/01_frozen_lake.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/08_gym/02_cliff_walking.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/08_gym/03_cartpole.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/08_gym/04_lunar_lander.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/08_gym/05_bipedal_walker.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/09_meta_learning/01_lamarck_linear_mapping.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/examples/09_meta_learning/02_meta_mapping_baldwin.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/setup.cfg +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_benchmarks.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_elitism_preserves_best_fitness.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_evonet_deepcopy.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_evonet_vector_io.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_mutation.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/tests/test_population.py +0 -0
- {evolib-0.2.0b4.dev7 → evolib-0.2.0b4.dev9}/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.dev9
|
|
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
|
|
@@ -30,7 +30,7 @@ evolution:
|
|
|
30
30
|
modules:
|
|
31
31
|
test-vector: # logical module name
|
|
32
32
|
type: vector
|
|
33
|
-
initializer:
|
|
33
|
+
initializer: uniform
|
|
34
34
|
dim: 2
|
|
35
35
|
bounds: [-1.0, 1.0]
|
|
36
36
|
|
|
@@ -89,7 +89,7 @@ modules:
|
|
|
89
89
|
xs:
|
|
90
90
|
type: vector
|
|
91
91
|
dim: 6
|
|
92
|
-
initializer:
|
|
92
|
+
initializer: uniform
|
|
93
93
|
bounds: [0.0, 6.283185307] # [0, 2π]
|
|
94
94
|
mutation:
|
|
95
95
|
strategy: adaptive_individual
|
|
@@ -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. `uniform`, `zero`, `normal`, `fixed`). |
|
|
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: uniform
|
|
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 | Topology preset (e.g. `default`, `unconnected`, `identity`). 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` | 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
|
|
@@ -30,6 +30,7 @@ from evolib.config.base_component_config import (
|
|
|
30
30
|
EvoNetNeuronDynamicsConfig,
|
|
31
31
|
StructuralMutationConfig,
|
|
32
32
|
)
|
|
33
|
+
from evolib.interfaces.enums import RepresentationType
|
|
33
34
|
|
|
34
35
|
Bounds = Tuple[float, float]
|
|
35
36
|
|
|
@@ -189,7 +190,6 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
189
190
|
type: evonet
|
|
190
191
|
dim: [4, 6, 2] # input, hidden, output
|
|
191
192
|
activation: [linear, relu, sigmoid] # single activation or list per layer
|
|
192
|
-
initializer: normal_evonet # weight/bias initializer
|
|
193
193
|
|
|
194
194
|
weights:
|
|
195
195
|
initializer: normal
|
|
@@ -209,7 +209,10 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
209
209
|
model_config = ConfigDict(extra="forbid")
|
|
210
210
|
|
|
211
211
|
# Module type is fixed to "evonet"
|
|
212
|
-
type:
|
|
212
|
+
type: RepresentationType = Field(
|
|
213
|
+
default=RepresentationType.EVONET,
|
|
214
|
+
description='Fixed module discriminator; must be "evonet" for this schema.',
|
|
215
|
+
)
|
|
213
216
|
|
|
214
217
|
# Layer structure: list of neuron counts per layer [input, hidden..., output]
|
|
215
218
|
dim: list[int]
|
|
@@ -228,7 +231,9 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
228
231
|
recurrent: Optional[Literal["none", "direct", "local", "all"]] = "none"
|
|
229
232
|
|
|
230
233
|
# Name of the initializer function (resolved via initializer registry)
|
|
231
|
-
initializer: str = Field(
|
|
234
|
+
initializer: str = Field(
|
|
235
|
+
default="default", description="Name of the initializer to use"
|
|
236
|
+
)
|
|
232
237
|
|
|
233
238
|
# Connection topology for initialization
|
|
234
239
|
connection_scope: Literal["adjacent", "crosslayer"] = Field(
|
|
@@ -266,6 +271,29 @@ class EvoNetComponentConfig(BaseModel):
|
|
|
266
271
|
structural: Optional[StructuralMutationConfig] = None
|
|
267
272
|
|
|
268
273
|
# Validators
|
|
274
|
+
@field_validator("initializer")
|
|
275
|
+
@classmethod
|
|
276
|
+
def validate_initializer(cls, name: str) -> str:
|
|
277
|
+
"""
|
|
278
|
+
Validate that the initializer is one of the allowed topology presets.
|
|
279
|
+
|
|
280
|
+
Parameter initialization is handled exclusively via weights/bias/delay blocks.
|
|
281
|
+
"""
|
|
282
|
+
allowed = {
|
|
283
|
+
"default",
|
|
284
|
+
"unconnected",
|
|
285
|
+
"identity",
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if name not in allowed:
|
|
289
|
+
raise ValueError(
|
|
290
|
+
f"Unknown EvoNet initializer '{name}'. "
|
|
291
|
+
f"Allowed values: {sorted(allowed)}. "
|
|
292
|
+
"Parameter initialization is configured via "
|
|
293
|
+
"'weights', 'bias', and 'delay'."
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
return name
|
|
269
297
|
|
|
270
298
|
@field_validator("neuron_dynamics")
|
|
271
299
|
@classmethod
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# SPDX-License-Identifier: MIT
|
|
2
2
|
from typing import Any, Literal, Optional, Tuple, Union
|
|
3
3
|
|
|
4
|
-
from pydantic import
|
|
4
|
+
from pydantic import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
ConfigDict,
|
|
7
|
+
Field,
|
|
8
|
+
ValidationInfo,
|
|
9
|
+
field_validator,
|
|
10
|
+
model_validator,
|
|
11
|
+
)
|
|
5
12
|
|
|
6
13
|
from evolib.config.base_component_config import CrossoverConfig, MutationConfig
|
|
7
14
|
from evolib.interfaces.enums import RepresentationType
|
|
@@ -21,7 +28,7 @@ class VectorComponentConfig(BaseModel):
|
|
|
21
28
|
type: vector
|
|
22
29
|
structure: flat # "flat" | "net"
|
|
23
30
|
dim: 16 # or a list for structured cases
|
|
24
|
-
initializer:
|
|
31
|
+
initializer: normal # name from the initializer registry
|
|
25
32
|
bounds: [-1.0, 1.0]
|
|
26
33
|
mutation:
|
|
27
34
|
strategy: constant
|
|
@@ -86,7 +93,7 @@ class VectorComponentConfig(BaseModel):
|
|
|
86
93
|
values: Optional[list[float]] = Field(
|
|
87
94
|
default=None,
|
|
88
95
|
description=(
|
|
89
|
-
"Explicit values for '
|
|
96
|
+
"Explicit values for 'fixed' initializer. If 'dim' is absent it "
|
|
90
97
|
"will be inferred from the length of 'values'."
|
|
91
98
|
),
|
|
92
99
|
)
|
|
@@ -101,8 +108,7 @@ class VectorComponentConfig(BaseModel):
|
|
|
101
108
|
)
|
|
102
109
|
|
|
103
110
|
# Evolution (mutation / crossover)
|
|
104
|
-
mutation:
|
|
105
|
-
default=None,
|
|
111
|
+
mutation: MutationConfig = Field(
|
|
106
112
|
description=(
|
|
107
113
|
"Mutation configuration. By default, 'probability' is an element-wise rate "
|
|
108
114
|
"(per gene) in [0,1]; operators may optionally treat it as an apply gate."
|
|
@@ -143,18 +149,16 @@ class VectorComponentConfig(BaseModel):
|
|
|
143
149
|
@classmethod
|
|
144
150
|
def set_dim_for_fixed_vector(cls, config: dict[str, Any]) -> dict[str, Any]:
|
|
145
151
|
"""
|
|
146
|
-
If using '
|
|
152
|
+
If using 'fixed', ensure 'values' is provided and infer 'dim' if absent.
|
|
147
153
|
|
|
148
154
|
This keeps YAML concise and catches common mistakes early.
|
|
149
155
|
"""
|
|
150
156
|
initializer = config.get("initializer")
|
|
151
157
|
values = config.get("values")
|
|
152
158
|
|
|
153
|
-
if initializer == "
|
|
159
|
+
if initializer == "fixed":
|
|
154
160
|
if not values:
|
|
155
|
-
raise ValueError(
|
|
156
|
-
"When using 'fixed_vector', 'values' must be provided."
|
|
157
|
-
)
|
|
161
|
+
raise ValueError("When using 'fixed', 'values' must be provided.")
|
|
158
162
|
if "dim" not in config:
|
|
159
163
|
config["dim"] = len(values)
|
|
160
164
|
return config
|
|
@@ -181,3 +185,30 @@ class VectorComponentConfig(BaseModel):
|
|
|
181
185
|
else:
|
|
182
186
|
raise TypeError("dim must be an int or list of ints")
|
|
183
187
|
return dim
|
|
188
|
+
|
|
189
|
+
@field_validator("initializer")
|
|
190
|
+
@classmethod
|
|
191
|
+
def validate_initializer(cls, name: str, info: ValidationInfo) -> str:
|
|
192
|
+
"""Validate allowed initializer names and provide clear errors for deprecated
|
|
193
|
+
names."""
|
|
194
|
+
if not isinstance(name, str) or not name.strip():
|
|
195
|
+
raise ValueError("initializer must be a non-empty string")
|
|
196
|
+
|
|
197
|
+
name = name.strip()
|
|
198
|
+
|
|
199
|
+
allowed = {"normal", "uniform", "zero", "fixed", "adaptive"}
|
|
200
|
+
if name not in allowed:
|
|
201
|
+
raise ValueError(
|
|
202
|
+
f"Unknown initializer '{name}'. " f"Allowed: {sorted(allowed)}"
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
# structure-aware check (only if structure is available in the data)
|
|
206
|
+
data = info.data or {}
|
|
207
|
+
structure = data.get("structure") or "flat"
|
|
208
|
+
if structure == "net" and name != "normal":
|
|
209
|
+
raise ValueError(
|
|
210
|
+
"For structure='net', initializer must be 'normal' "
|
|
211
|
+
"(use initializer: normal and structure: net)."
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
return name
|
|
@@ -173,28 +173,7 @@ def _build_architecture(
|
|
|
173
173
|
)
|
|
174
174
|
|
|
175
175
|
|
|
176
|
-
def
|
|
177
|
-
"""
|
|
178
|
-
Initializes an EvoNet without connections.
|
|
179
|
-
|
|
180
|
-
Args:
|
|
181
|
-
config (FullConfig): Full experiment configuration
|
|
182
|
-
module (str): Module name (e.g. "brain")
|
|
183
|
-
|
|
184
|
-
Returns:
|
|
185
|
-
EvoNet: Initialized EvoNet representation
|
|
186
|
-
"""
|
|
187
|
-
para = EvoNet()
|
|
188
|
-
cfg = config.modules[module].model_copy(deep=True)
|
|
189
|
-
para.apply_config(cfg)
|
|
190
|
-
|
|
191
|
-
_build_architecture(para, cfg, connection_init="none")
|
|
192
|
-
_apply_bias_init(para, cfg)
|
|
193
|
-
|
|
194
|
-
return para
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
def initializer_normal_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
176
|
+
def initializer_default_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
198
177
|
"""
|
|
199
178
|
Build a standard EvoNet architecture and initialize parameters according to the
|
|
200
179
|
explicit configuration blocks.
|
|
@@ -203,9 +182,6 @@ def initializer_normal_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
|
203
182
|
- Weights are initialized using `cfg.weights`.
|
|
204
183
|
- Biases are initialized using `cfg.bias`.
|
|
205
184
|
- Delay (if configured) is initialized using `cfg.delay`.
|
|
206
|
-
|
|
207
|
-
No implicit parameter initialization is performed here.
|
|
208
|
-
All parameter distributions are controlled explicitly via the config.
|
|
209
185
|
"""
|
|
210
186
|
|
|
211
187
|
para = EvoNet()
|
|
@@ -219,36 +195,23 @@ def initializer_normal_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
|
219
195
|
return para
|
|
220
196
|
|
|
221
197
|
|
|
222
|
-
def
|
|
223
|
-
"""
|
|
224
|
-
Backward-compatible alias for the standard EvoNet initializer. Will be removed.
|
|
225
|
-
|
|
226
|
-
Parameter initialization is controlled by `cfg.weights`, `cfg.bias`,
|
|
227
|
-
and `cfg.delay`.
|
|
228
|
-
"""
|
|
229
|
-
return initializer_normal_evonet(config, module)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
def initializer_zero_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
198
|
+
def initializer_unconnected_evonet(config: FullConfig, module: str) -> EvoNet:
|
|
233
199
|
"""
|
|
234
|
-
|
|
200
|
+
Initializes an EvoNet without connections.
|
|
235
201
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
202
|
+
Args:
|
|
203
|
+
config (FullConfig): Full experiment configuration
|
|
204
|
+
module (str): Module name (e.g. "brain")
|
|
239
205
|
|
|
240
|
-
|
|
206
|
+
Returns:
|
|
207
|
+
EvoNet: Initialized EvoNet representation
|
|
241
208
|
"""
|
|
242
|
-
|
|
243
209
|
para = EvoNet()
|
|
244
210
|
cfg = config.modules[module].model_copy(deep=True)
|
|
245
211
|
para.apply_config(cfg)
|
|
246
212
|
|
|
247
|
-
_build_architecture(para, cfg, connection_init="
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
para.net.set_weights(np.zeros(para.net.num_weights))
|
|
251
|
-
para.net.set_biases(np.zeros(para.net.num_biases))
|
|
213
|
+
_build_architecture(para, cfg, connection_init="none")
|
|
214
|
+
_apply_bias_init(para, cfg)
|
|
252
215
|
|
|
253
216
|
return para
|
|
254
217
|
|