[−][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 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: NeuronId
neuron_type: NeuronType
activated_value: f32
deactivated_value: f32
current_state: f32
previous_state: f32
error: f32
bias: f32
Implementations
impl Neuron
[src]
pub fn new(
id: NeuronId,
neuron_type: NeuronType,
activation: Activation,
direction: NeuronDirection
) -> Self
[src]
id: NeuronId,
neuron_type: NeuronType,
activation: Activation,
direction: NeuronDirection
) -> Self
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]
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 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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
pub fn erased_serialize(
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
[src]
&self,
serializer: &mut dyn Serializer
) -> Result<Ok, Error>
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,