pub type ShallowParamsBase<S, D> = ModelParamsBase<S, D, ParamsBase<S, D>>;Expand description
a type alias for a shallow representation of the ModelParamsBase using a single
ParamsBase instance as the hidden layer.
Aliased Type§
pub struct ShallowParamsBase<S, D> { /* private fields */ }Implementations§
Source§impl<S, D, A> ShallowParamsBase<S, D>
impl<S, D, A> ShallowParamsBase<S, D>
Sourcepub fn default(input: D, hidden: D, output: D) -> Self
pub fn default(input: D, hidden: D, output: D) -> Self
initialize a new instance of the ShallowParamsBase with the given input, hidden,
and output dimensions using the default values for the parameters
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
returns the total number parameters within the model, including the input and output layers
returns an immutable reference to the hidden weights
returns an mutable reference to the hidden weights
Source§impl<S, A> ShallowParamsBase<S, Ix2>where
S: RawData<Elem = A>,
impl<S, A> ShallowParamsBase<S, Ix2>where
S: RawData<Elem = A>,
pub fn from_features(features: ModelFeatures) -> Self
Source§impl<A, S> ShallowParamsBase<S, Ix2>where
S: DataOwned<Elem = A>,
impl<A, S> ShallowParamsBase<S, Ix2>where
S: DataOwned<Elem = A>,
Sourcepub fn init(self) -> Self
pub fn init(self) -> Self
consumes the controller to initialize the various parameters with random values
Sourcepub fn init_rand<G, Ds>(features: ModelFeatures, distr: G) -> Self
pub fn init_rand<G, Ds>(features: ModelFeatures, distr: G) -> Self
returns a new instance of the model initialized with the given features and random distribution
Sourcepub fn glorot_normal(features: ModelFeatures) -> Self
pub fn glorot_normal(features: ModelFeatures) -> Self
initialize the model parameters using a glorot normal distribution
Sourcepub fn glorot_uniform(features: ModelFeatures) -> Selfwhere
A: Float + FromPrimitive + SampleUniform,
<A as SampleUniform>::Sampler: Clone,
Uniform<A>: Distribution<A>,
pub fn glorot_uniform(features: ModelFeatures) -> Selfwhere
A: Float + FromPrimitive + SampleUniform,
<A as SampleUniform>::Sampler: Clone,
Uniform<A>: Distribution<A>,
initialize the model parameters using a glorot uniform distribution