Struct intricate::layers::initializers::NormalRandomInitializer
source · Expand description
A Initializer that generates random numbers in a normal distribution based on a mean and a
standard deviation provided by the new method
Fields§
§mean: f32The mean for the Normal distribution
standard_deviation: f32The standard deviation for the Normal distribution
Implementations§
Trait Implementations§
source§impl Clone for NormalRandomInitializer
impl Clone for NormalRandomInitializer
source§fn clone(&self) -> NormalRandomInitializer
fn clone(&self) -> NormalRandomInitializer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for NormalRandomInitializer
impl Debug for NormalRandomInitializer
source§impl Deserialize for NormalRandomInitializer
impl Deserialize for NormalRandomInitializer
source§fn deserialize(
deserializer: &mut Deserializer<'_>
) -> Result<Self, SavefileError>
fn deserialize(
deserializer: &mut Deserializer<'_>
) -> Result<Self, SavefileError>
Deserialize and return an instance of Self from the given deserializer.
source§impl From<NormalRandomInitializer> for Initializer
impl From<NormalRandomInitializer> for Initializer
source§fn from(v: NormalRandomInitializer) -> Self
fn from(v: NormalRandomInitializer) -> Self
Converts to this type from the input type.
source§impl InitializerTrait for NormalRandomInitializer
impl InitializerTrait for NormalRandomInitializer
source§fn initialize_0d<'a>(&self, _layer: &dyn Layer<'a>) -> f32
fn initialize_0d<'a>(&self, _layer: &dyn Layer<'a>) -> f32
Generates just one number based on the Initializer’s implementation
source§fn initialize_1d<'a>(&self, count: usize, _layer: &dyn Layer<'a>) -> Vec<f32> ⓘ
fn initialize_1d<'a>(&self, count: usize, _layer: &dyn Layer<'a>) -> Vec<f32> ⓘ
Generates a Vec of numbers initialized based on the Initializer’s implementation
source§impl Introspect for NormalRandomInitializer
impl Introspect for NormalRandomInitializer
source§fn introspect_value(&self) -> String
fn introspect_value(&self) -> String
Returns the value of the object, excluding children, as a string.
Exactly what the value returned here is depends on the type.
For some types, like a plain array, there isn’t much of a value,
the entire information of object resides in the children.
For other cases, like a department in an organisation, it might
make sense to have the value be the name, and have all the other properties
as children.
source§fn introspect_child(
&self,
index: usize
) -> Option<Box<dyn IntrospectItem<'_> + '_>>
fn introspect_child(
&self,
index: usize
) -> Option<Box<dyn IntrospectItem<'_> + '_>>
Returns an the name and &dyn Introspect for the child with the given index,
or if no child with that index exists, None.
All the children should be indexed consecutively starting at 0 with no gaps,
all though there isn’t really anything stopping the user of the trait to have
any arbitrary index strategy, consecutive numbering 0, 1, 2, … etc is strongly
encouraged.
source§fn introspect_len(&self) -> usize
fn introspect_len(&self) -> usize
Returns the total number of children.
The default implementation calculates this by simply calling introspect_child with
higher and higher indexes until it returns None.
It gives up if the count reaches 10000. If your type can be bigger
and you want to be able to introspect it, override this method.
source§impl Serialize for NormalRandomInitializer
impl Serialize for NormalRandomInitializer
source§fn serialize(&self, serializer: &mut Serializer<'_>) -> Result<(), SavefileError>
fn serialize(&self, serializer: &mut Serializer<'_>) -> Result<(), SavefileError>
Serialize self into the given serializer.