[][src]Struct radiate::models::neat::neuron::Neuron

pub struct Neuron {
    pub id: NeuronId,
    pub neuron_type: NeuronType,
    pub activated_value: f32,
    pub deactivated_value: f32,
    pub current_state: f32,
    pub previous_state: f32,
    pub error: f32,
    pub bias: f32,
    // some fields omitted
}

Neuron is a wrapper around a neuron providing only what is needed for a neuron to be added to the NEAT graph, while the neuron encapsulates the neural network logic for the specific node type, Some neurons like an LSTM require more variables and different internal activation logic, so encapsulating that within a normal node on the graph would be misplaced.

Fields

id: NeuronIdneuron_type: NeuronTypeactivated_value: f32deactivated_value: f32current_state: f32previous_state: f32error: f32bias: f32

Implementations

impl Neuron[src]

pub fn new(
    id: NeuronId,
    neuron_type: NeuronType,
    activation: Activation,
    direction: NeuronDirection
) -> Self
[src]

pub fn add_incoming(&mut self, edge: &Edge)[src]

Add incoming edge

pub fn add_outgoing(&mut self, edge: EdgeId)[src]

Add outgoing edge

pub fn update_incoming(&mut self, edge: &Edge, weight: f32)[src]

Update incoming edge

pub fn remove_incoming(&mut self, edge: &Edge)[src]

Remove incoming edge

pub fn remove_outgoing(&mut self, edge: EdgeId)[src]

Remove outgoing edge

pub fn incoming_edges(&self) -> &[NeuronLink][src]

Get incoming edge ids.

pub fn outgoing_edges(&self) -> &[EdgeId][src]

Get outgoing edge ids.

pub fn activate(&mut self)[src]

𝜎(Σ(w * i) + b) activate this node by calling the underlying neuron's logic for activation

pub fn reset_neuron(&mut self)[src]

each Neuron has a base layer of reset which needs to happen but on top of that each neuron might need to do more internally

pub fn clone_with_values(&self) -> Self[src]

Trait Implementations

impl Clone for Neuron[src]

impl Debug for Neuron[src]

impl<'de> Deserialize<'de> for Neuron[src]

impl Serialize for Neuron[src]

Auto Trait Implementations

impl RefUnwindSafe for Neuron

impl Send for Neuron

impl Sync for Neuron

impl Unpin for Neuron

impl UnwindSafe for Neuron

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,