[−][src]Struct radiate::models::neat::neuron::Neuron
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.
Fields
innov: Uuid
outgoing: Vec<Uuid>
incoming: HashMap<Uuid, Option<f32>>
activation: Activation
direction: NeuronDirection
neuron_type: NeuronType
activated_value: f32
deactivated_value: f32
current_state: f32
previous_state: f32
error: f32
bias: f32
Methods
impl Neuron
[src]
pub fn new(
innov: Uuid,
neuron_type: NeuronType,
activation: Activation,
direction: NeuronDirection
) -> Self
[src]
innov: Uuid,
neuron_type: NeuronType,
activation: Activation,
direction: NeuronDirection
) -> Self
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 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
pub fn clone_with_values(&self) -> Self
[src]
Trait Implementations
impl Clone for Neuron
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Neuron
[src]
impl<'de> Deserialize<'de> for Neuron
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,