pub type DeepParamsBase<S, D> = ModelParamsBase<S, D, Vec<ParamsBase<S, D>>>;Expand description
a type alias for a deep representation of the ModelParamsBase using a vector of
parameters as the hidden layers.
Aliased Type§
pub struct DeepParamsBase<S, D> { /* private fields */ }Implementations§
Source§impl<A, S, D> DeepParamsBase<S, D>
impl<A, S, D> DeepParamsBase<S, D>
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
returns the total number parameters within the model, including the input and output layers
set the layer at the specified index in the hidden layers of the model
§Panics
Panics if the index is out of bounds or if the dimension of the provided layer is inconsistent with the others in the stack.
returns the dimension of the hidden layers
Sourcepub fn dim_output(&self) -> <D as Dimension>::Pattern
pub fn dim_output(&self) -> <D as Dimension>::Pattern
returns the dimension of the output layer
returns the hidden layer associated with the given index
returns a mutable reference to the hidden layer associated with the given index
Source§impl<A, S> DeepParamsBase<S, Ix2>where
S: RawData<Elem = A>,
impl<A, S> DeepParamsBase<S, Ix2>where
S: RawData<Elem = A>,
Sourcepub fn default(features: ModelFeatures) -> Self
pub fn default(features: ModelFeatures) -> Self
create a new instance of the model; all parameters are initialized to their defaults (i.e., zero)
Sourcepub fn ones(features: ModelFeatures) -> Self
pub fn ones(features: ModelFeatures) -> Self
create a new instance of the model; all parameters are initialized to zero
Source§impl<A, S> DeepParamsBase<S, Ix2>where
S: DataOwned<Elem = A>,
impl<A, S> DeepParamsBase<S, Ix2>where
S: DataOwned<Elem = A>,
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: Clone + Float + FromPrimitive + SampleUniform,
<S::Elem as SampleUniform>::Sampler: Clone,
Uniform<S::Elem>: Distribution<S::Elem>,
pub fn glorot_uniform(features: ModelFeatures) -> Selfwhere
A: Clone + Float + FromPrimitive + SampleUniform,
<S::Elem as SampleUniform>::Sampler: Clone,
Uniform<S::Elem>: Distribution<S::Elem>,
initialize the model parameters using a glorot uniform distribution