[−][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>>
bias: f32
value: f32
d_value: f32
state: f32
error: f32
activation: Activation
neuron_type: NeuronType
Methods
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]
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> Any for T where
T: Any + Serialize + Deserialize,
[src]
T: Any + Serialize + Deserialize,
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
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> Debug for T where
T: Debug + Serialize + Deserialize + ?Sized,
[src]
T: Debug + Serialize + Deserialize + ?Sized,
impl<T> Deserialize for T where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: 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> Same<T> for T
type Output = T
Should always be Self
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
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<T> Type for T where
T: ?Sized,
[src]
T: ?Sized,
default fn meta(self: *const T) -> <T as Type>::Meta
[src]
default fn data(self: *const T) -> *const ()
[src]
default fn data_mut(self: *mut T) -> *mut ()
[src]
default fn dangling(t: <T as Type>::Meta) -> NonNull<T>
[src]
default fn fatten(thin: *mut (), t: <T as Type>::Meta) -> *mut T
[src]
const METATYPE: MetaType
[src]
type Meta: 'static
fn meta_type(self: *const Self) -> MetaType
[src]
impl<T> Type for T
[src]
const METATYPE: MetaType
[src]
type Meta = Concrete
Type of metadata for type.
fn meta(self: *const T) -> <T as Type>::Meta
[src]
fn data(self: *const T) -> *const ()
[src]
fn data_mut(self: *mut T) -> *mut ()
[src]
fn dangling(_t: <T as Type>::Meta) -> NonNull<T>
[src]
fn fatten(thin: *mut (), _t: <T as Type>::Meta) -> *mut T
[src]
fn meta_type(self: *const Self) -> MetaType
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,