meta_reward (faber_neuroevolution v1.2.4)
View SourceComposite reward computation for meta-controller training.
This module computes a multi-objective reward signal for training the meta-controller. The reward balances multiple objectives:
1. **Convergence Speed** - How quickly fitness improves 2. **Final Fitness** - Absolute performance achieved 3. **Efficiency Ratio** - Fitness gained per computation spent 4. **Diversity Awareness** - Maintains exploration capacity 5. **Normative Structure** - Preserves capacity for future adaptation
Reward Formula
The total reward is a weighted sum:
R = w1*convergence + w2*fitness + w3*efficiency + w4*diversity + w5*normative
Where weights are configured in meta_config.reward_weights.
Normalization
All reward components are normalized to [0, 1] or [-1, 1] range for stable training. Historical data is used for normalization.
Summary
Functions
Compute composite reward for a generation.
Compute individual reward components.
Normalize a reward component value.
Types
-type generation_metrics() :: #generation_metrics{generation :: pos_integer(), best_fitness :: float(), avg_fitness :: float(), worst_fitness :: float(), fitness_std_dev :: float(), fitness_delta :: float(), relative_improvement :: float(), population_diversity :: float(), strategy_entropy :: float(), evaluations_used :: pos_integer(), fitness_per_evaluation :: float(), diversity_corridors :: float(), adaptation_readiness :: float(), params_used :: #{meta_param() => float()}, timestamp :: erlang:timestamp()}.
-type meta_config() :: #meta_config{network_topology :: {pos_integer(), [pos_integer()], pos_integer()}, neuron_type :: ltc | cfc, time_constant :: float(), state_bound :: float(), reward_weights :: #{reward_component() => float()}, learning_rate :: float(), param_bounds :: #{meta_param() => {float(), float()}}, control_population_size :: boolean(), control_topology :: boolean(), history_window :: pos_integer(), momentum :: float()}.
-type meta_param() ::
mutation_rate | mutation_strength | selection_ratio | evaluations_per_individual |
max_concurrent_evaluations | population_size | add_node_rate | add_connection_rate |
complexity_penalty.
-type reward_component() ::
convergence_speed | final_fitness | efficiency_ratio | diversity_aware | normative_structure.
Functions
-spec compute(generation_metrics(), [generation_metrics()], meta_config()) -> meta_reward().
Compute composite reward for a generation.
-spec compute_components(generation_metrics(), [generation_metrics()], meta_config()) -> #{atom() => float()}.
Compute individual reward components.
Normalize a reward component value.
Uses tweann_nif:z_score/3 for NIF-accelerated Z-score computation.