neuron_info (macula_tweann v0.18.1)
View SourceNeuron Introspection API.
This module provides introspection capabilities for neurons in macula-tweann. It can extract information from both neuron records and running neuron processes.
Usage
From a neuron record:
Info = neuron_info:get_neuron_info(NeuronRecord), #{neuron_type := Type, time_constant := Tau} = Info.
From a running neuron process:
Info = neuron_info:get_neuron_info(NeuronPid), #{neuron_type := cfc, internal_state := State} = Info.
Returned Information
The returned map contains:
neuron_type - standard | ltc | cfc time_constant - tau value (for LTC/CfC neurons) state_bound - A value (for LTC/CfC neurons) internal_state - current x(t) state (for LTC/CfC neurons) activation_function - the activation function atom plasticity_function - the plasticity function (if any) input_count - number of input connections output_count - number of output connections capabilities - list of neuron capabilities
Summary
Functions
Get a human-readable description of a neuron type.
Get capabilities for a neuron type.
Get comprehensive information about a neuron.
Get just the neuron type.
Check if a neuron type has temporal memory.
Types
-type neuron_info() :: #{neuron_type := standard | ltc | cfc, time_constant := float(), state_bound := float(), internal_state := float(), activation_function := atom(), plasticity_function := atom() | undefined, input_count := non_neg_integer(), output_count := non_neg_integer(), capabilities := [atom()]}.
Functions
Get a human-readable description of a neuron type.
Get capabilities for a neuron type.
Returns a list of atoms describing what the neuron type can do:
temporal_memory - Can remember past inputs adaptive_dynamics - Time constant varies with input fast_inference - Optimized for production speed ode_accurate - Uses accurate ODE integration hebbian_plasticity - Supports Hebbian learning modulated_plasticity - Supports neuromodulation
-spec get_neuron_info(Neuron) -> neuron_info() when Neuron :: #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()} | pid().
Get comprehensive information about a neuron.
Accepts either a neuron record or a running neuron process pid. Returns a map with all available neuron information.
-spec get_neuron_type(Neuron) -> standard | ltc | cfc | unknown when Neuron :: #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()} | pid() | neuron_info().
Get just the neuron type.
-spec is_temporal(Neuron) -> boolean() when Neuron :: #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()} | standard | ltc | cfc | neuron_info().
Check if a neuron type has temporal memory.