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

pub struct Neuron {
    pub innov: Uuid,
    pub outgoing: Vec<Uuid>,
    pub incoming: HashMap<Uuid, Option<f32>>,
    pub bias: f32,
    pub value: f32,
    pub d_value: f32,
    pub state: f32,
    pub error: f32,
    pub activation: Activation,
    pub neuron_type: NeuronType,

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 nodetype, Some neurons like an LSTM require more variables and different interal activation logic, so encapsulating that within a normal node on the graph would be misplaced.


innov: Uuidoutgoing: Vec<Uuid>incoming: HashMap<Uuid, Option<f32>>bias: f32value: f32d_value: f32state: f32error: f32activation: Activationneuron_type: NeuronType


impl Neuron[src]

pub fn new(innov: Uuid, neuron_type: NeuronType, activation: Activation) -> Self[src]

pub fn as_mut_ptr(self) -> *mut Neuron[src]

Return this struct as a raw mutable pointer - consumes the struct

pub fn is_ready(&mut self) -> bool[src]

figure out if this node can be calculated, meaning all of the nodes pointing to it have given this node their output values. If they have, this node is ready to be activated

pub fn activate(&mut self)[src]

𝜎(Σ(w * i) + b) activate this node by calling the underlying neuron's logic for activation given the hashmap of <incoming edge innov, Option>

pub fn deactivate(&self) -> f32[src]

deactivate this node by calling the underlying neuron's logic to compute the gradient of the original output value

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 interanally

Trait Implementations

impl Clone for Neuron[src]

impl Debug for Neuron[src]

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

impl PartialEq<Neuron> 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

impl<T> Any for T where
    T: Any + Serialize + Deserialize

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Debug for T where
    T: Debug + Serialize + Deserialize + ?Sized

impl<T> Deserialize for T where
    T: DeserializeOwned

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized

impl<T> Serialize for T where
    T: Serialize + ?Sized

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

impl<T> Type for T[src]

type Meta = Concrete

Type of metadata for type.

impl<T> Type for T where
    T: ?Sized

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