faber_neuroevolution_sup (faber_neuroevolution v1.2.4)

View Source

Top-level supervisor for faber_neuroevolution.

This supervisor manages: - Liquid Conglomerate (LC) supervisor for resource/task/distribution silos - Dynamic neuroevolution server supervisor for training sessions

Usage

Use the API functions to start and stop neuroevolution servers:

Config = #neuro_config{...}, {ok, Pid} = faber_neuroevolution_sup:start_server(Config), faber_neuroevolution_sup:stop_server(Pid).

Summary

Functions

Start the supervisor.

Start a neuroevolution server with given configuration.

Start a neuroevolution server with configuration and options.

Stop a neuroevolution server.

Types

mutation_config/0

-type mutation_config() ::
          #mutation_config{weight_mutation_rate :: float(),
                           weight_perturb_rate :: float(),
                           weight_perturb_strength :: float(),
                           add_node_rate :: float(),
                           add_connection_rate :: float(),
                           toggle_connection_rate :: float(),
                           add_sensor_rate :: float(),
                           add_actuator_rate :: float(),
                           mutate_neuron_type_rate :: float(),
                           mutate_time_constant_rate :: float()}.

neuro_config/0

-type neuro_config() ::
          #neuro_config{population_size :: pos_integer(),
                        evaluations_per_individual :: pos_integer(),
                        selection_ratio :: float(),
                        mutation_rate :: float(),
                        mutation_strength :: float(),
                        reservoir_mutation_rate :: float() | undefined,
                        reservoir_mutation_strength :: float() | undefined,
                        readout_mutation_rate :: float() | undefined,
                        readout_mutation_strength :: float() | undefined,
                        topology_mutation_config :: mutation_config() | undefined,
                        max_evaluations :: pos_integer() | infinity,
                        max_generations :: pos_integer() | infinity,
                        target_fitness :: float() | undefined,
                        network_topology :: {pos_integer(), [pos_integer()], pos_integer()},
                        evaluator_module :: module(),
                        evaluator_options :: map(),
                        event_handler :: {module(), term()} | undefined,
                        meta_controller_config :: term() | undefined,
                        speciation_config :: speciation_config() | undefined,
                        realm :: binary(),
                        publish_events :: boolean(),
                        evaluation_mode :: direct | distributed | mesh,
                        mesh_config :: map() | undefined,
                        evaluation_timeout :: pos_integer(),
                        max_concurrent_evaluations :: pos_integer() | undefined,
                        strategy_config :: term() | undefined,
                        lc_chain_config :: term() | undefined,
                        checkpoint_interval :: pos_integer() | undefined,
                        checkpoint_config :: map() | undefined,
                        seed_networks :: [term()]}.

speciation_config/0

-type speciation_config() ::
          #speciation_config{enabled :: boolean(),
                             compatibility_threshold :: float(),
                             c1_excess :: float(),
                             c2_disjoint :: float(),
                             c3_weight_diff :: float(),
                             target_species :: pos_integer(),
                             threshold_adjustment_rate :: float(),
                             min_species_size :: pos_integer(),
                             max_stagnation :: non_neg_integer(),
                             species_elitism :: float(),
                             interspecies_mating_rate :: float()}.

Functions

start_link()

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

Start the supervisor.

start_server(Config)

-spec start_server(Config) -> {ok, pid()} | {error, term()} when Config :: neuro_config().

Start a neuroevolution server with given configuration.

start_server(Config, Options)

-spec start_server(Config, Options) -> {ok, pid()} | {error, term()}
                      when Config :: neuro_config(), Options :: proplists:proplist().

Start a neuroevolution server with configuration and options.

stop_server(Pid)

-spec stop_server(Pid) -> ok | {error, term()} when Pid :: pid().

Stop a neuroevolution server.