mutation_helpers (macula_tweann v0.18.1)
View SourceHelper functions for genome mutation operations.
This module provides utility functions used by mutation operators for linking network elements and weight management.
Summary
Functions
Create a random weight tuple.
Find a link that can be split to insert a neuron.
Get layer coordinate from element ID.
Get weight of a link between two elements.
Link a neuron to an actuator.
Link a neuron to a target (neuron or actuator).
Link a sensor to a neuron.
Link a source (sensor or neuron) to a neuron.
Perturb a list of LTC weights.
Select a random LTC or CfC neuron from the agent's network.
Select a random neuron from the agent's network.
Update source element to output to new target.
Update target element to receive from new source.
Functions
Create a random weight tuple.
-spec find_splittable_link(term()) -> {term(), term(), {float(), float(), float(), list()}} | {error, no_links}.
Find a link that can be split to insert a neuron.
Get layer coordinate from element ID.
Get weight of a link between two elements.
-spec link_neuron_to_actuator(term(), term(), #actuator{id :: term(), name :: term(), type :: term(), cx_id :: term(), scape :: term(), vl :: term(), fanin_ids :: term(), generation :: term(), format :: term(), parameters :: term(), gt_parameters :: term(), phys_rep :: term(), vis_rep :: term(), pre_f :: term(), post_f :: term(), innovation :: term()}) -> ok.
Link a neuron to an actuator.
-spec link_neuron_to_target(term(), #neuron{id :: term(), generation :: term(), cx_id :: term(), pre_processor :: term(), signal_integrator :: term(), af :: term(), post_processor :: term(), pf :: term(), aggr_f :: term(), input_idps :: term(), input_idps_modulation :: term(), output_ids :: term(), ro_ids :: term(), neuron_type :: term(), time_constant :: term(), state_bound :: term(), ltc_backbone_weights :: term(), ltc_head_weights :: term(), internal_state :: term(), innovation :: term()}, term()) -> ok.
Link a neuron to a target (neuron or actuator).
-spec link_sensor_to_neuron(term(), #sensor{id :: term(), name :: term(), type :: term(), cx_id :: term(), scape :: term(), vl :: term(), fanout_ids :: term(), generation :: term(), format :: term(), parameters :: term(), gt_parameters :: term(), phys_rep :: term(), vis_rep :: term(), pre_f :: term(), post_f :: term(), innovation :: term()}, term()) -> ok.
Link a sensor to a neuron.
-spec link_source_to_neuron(term(), term(), #neuron{id :: term(), generation :: term(), cx_id :: term(), pre_processor :: term(), signal_integrator :: term(), af :: term(), post_processor :: term(), pf :: term(), aggr_f :: term(), input_idps :: term(), input_idps_modulation :: term(), output_ids :: term(), ro_ids :: term(), neuron_type :: term(), time_constant :: term(), state_bound :: term(), ltc_backbone_weights :: term(), ltc_head_weights :: term(), internal_state :: term(), innovation :: term()}) -> ok.
Link a source (sensor or neuron) to a neuron.
Perturb a list of LTC weights.
Select a random LTC or CfC neuron from the agent's network.
Select a random neuron from the agent's network.
Update source element to output to new target.
Update target element to receive from new source.