lc_population (faber_neuroevolution v1.2.4)

View Source

LC Population Manager - Evolves Liquid Conglomerate controller TWEANNs.

This gen_server manages a population of LC controller neural networks that compete to be the active controller. Each controller is evaluated over a "trial period" (e.g., 5000 evaluations) and rewarded based on:

1. Fitness improvement velocity (faster learning = better) 2. Training efficiency (fewer evaluations to reach target) 3. Avoiding premature convergence (not getting stuck at low fitness) 4. Resource efficiency (low memory/CPU usage)

Evolution Strategy

- Population of N LC TWEANNs (default: 10) - Each generation: trial period for each controller - Active controller is the champion from last generation - After each trial, compute reward using lc_reward:compute_trial_reward/1 - Select top 50% as parents, mutate to create offspring - Repeat

Time Constants

- Trial period: 5000 evaluations (tau_l0 * 5) - Generation: N * trial_period evaluations - Champion persistence: 3 generations (give good controllers time)

Summary

Functions

Get the active LC controller's recommendations. This is called by task_silo to get hyperparameters from the LC TWEANN.

Get hyperparameter recommendations from the active LC TWEANN. Sensors are fed to the network, outputs are scaled to hyperparameter ranges.

Get current population state for monitoring.

Report evolution metrics for reward computation. Called by task_silo after each cohort/generation.

Reset population (start fresh evolution).

Start LC population manager with default config.

Start LC population manager with custom config.

Functions

get_active_controller(Pid)

-spec get_active_controller(pid()) -> {ok, pid()} | {error, no_controller}.

Get the active LC controller's recommendations. This is called by task_silo to get hyperparameters from the LC TWEANN.

get_recommendations(Pid, SensorInputs)

-spec get_recommendations(pid(), map()) -> map().

Get hyperparameter recommendations from the active LC TWEANN. Sensors are fed to the network, outputs are scaled to hyperparameter ranges.

get_state(Pid)

-spec get_state(pid()) -> map().

Get current population state for monitoring.

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(Config)

report_metrics(Pid, Metrics)

-spec report_metrics(pid(), map()) -> ok.

Report evolution metrics for reward computation. Called by task_silo after each cohort/generation.

reset(Pid)

-spec reset(pid()) -> ok.

Reset population (start fresh evolution).

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start LC population manager with default config.

start_link(Config)

-spec start_link(map()) -> {ok, pid()} | {error, term()}.

Start LC population manager with custom config.

terminate(Reason, State)