pub struct ModelFeatures { /* private fields */ }Expand description
The ModelFeatures provides a common way of defining the layout of a model. This is
used to define the number of input features, the number of hidden layers, the number of
hidden features, and the number of output features.
Implementations§
Source§impl ModelFeatures
impl ModelFeatures
pub fn new( input: usize, hidden: usize, layers: usize, output: usize, ) -> ModelFeatures
Sourcepub const fn input_mut(&mut self) -> &mut usize
pub const fn input_mut(&mut self) -> &mut usize
returns a mutable reference to the input features for the model
returns a copy of the hidden features for the model
returns a mutable reference to the hidden features for the model
Sourcepub const fn layers(&self) -> usize
pub const fn layers(&self) -> usize
returns a copy of the number of hidden layers for the model
Sourcepub const fn layers_mut(&mut self) -> &mut usize
pub const fn layers_mut(&mut self) -> &mut usize
returns a mutable reference to the number of hidden layers for the model
Sourcepub const fn output_mut(&mut self) -> &mut usize
pub const fn output_mut(&mut self) -> &mut usize
returns a mutable reference to the output features for the model
Sourcepub fn set_input(&mut self, input: usize) -> &mut ModelFeatures
pub fn set_input(&mut self, input: usize) -> &mut ModelFeatures
sets the input features for the model
sets the hidden features for the model
Sourcepub fn set_layers(&mut self, layers: usize) -> &mut ModelFeatures
pub fn set_layers(&mut self, layers: usize) -> &mut ModelFeatures
sets the number of hidden layers for the model
Sourcepub fn set_output(&mut self, output: usize) -> &mut ModelFeatures
pub fn set_output(&mut self, output: usize) -> &mut ModelFeatures
sets the output features for the model
Sourcepub fn with_input(self, input: usize) -> ModelFeatures
pub fn with_input(self, input: usize) -> ModelFeatures
consumes the current instance and returns a new instance with the given input
consumes the current instance and returns a new instance with the given hidden features
Sourcepub fn with_layers(self, layers: usize) -> ModelFeatures
pub fn with_layers(self, layers: usize) -> ModelFeatures
consumes the current instance and returns a new instance with the given number of hidden layers
Sourcepub fn with_output(self, output: usize) -> ModelFeatures
pub fn with_output(self, output: usize) -> ModelFeatures
consumes the current instance and returns a new instance with the given output features
the dimension of the hidden layers; (hidden, hidden)
Sourcepub fn dim_output(&self) -> (usize, usize)
pub fn dim_output(&self) -> (usize, usize)
the dimension of the output layer; (hidden, output)
Sourcepub fn size_input(&self) -> usize
pub fn size_input(&self) -> usize
the total number of input parameters in the model
the total number of hidden parameters in the model
Sourcepub fn size_output(&self) -> usize
pub fn size_output(&self) -> usize
the total number of output parameters in the model
Trait Implementations§
Source§impl Clone for ModelFeatures
impl Clone for ModelFeatures
Source§fn clone(&self) -> ModelFeatures
fn clone(&self) -> ModelFeatures
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelFeatures
impl Debug for ModelFeatures
Source§impl Default for ModelFeatures
impl Default for ModelFeatures
Source§fn default() -> ModelFeatures
fn default() -> ModelFeatures
Source§impl<'de> Deserialize<'de> for ModelFeatures
impl<'de> Deserialize<'de> for ModelFeatures
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelFeatures, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModelFeatures, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for ModelFeatures
impl Display for ModelFeatures
Source§impl Hash for ModelFeatures
impl Hash for ModelFeatures
Source§impl ModelLayout for ModelFeatures
impl ModelLayout for ModelFeatures
Source§fn input_mut(&mut self) -> &mut usize
fn input_mut(&mut self) -> &mut usize
Source§fn layers_mut(&mut self) -> &mut usize
fn layers_mut(&mut self) -> &mut usize
Source§fn output_mut(&mut self) -> &mut usize
fn output_mut(&mut self) -> &mut usize
Source§fn set_layers(&mut self, layers: usize) -> &mut Self
fn set_layers(&mut self, layers: usize) -> &mut Self
Source§fn set_output(&mut self, output: usize) -> &mut Self
fn set_output(&mut self, output: usize) -> &mut Self
Source§fn dim_output(&self) -> (usize, usize)
fn dim_output(&self) -> (usize, usize)
Source§fn size_input(&self) -> usize
fn size_input(&self) -> usize
Source§fn size_output(&self) -> usize
fn size_output(&self) -> usize
Source§impl Ord for ModelFeatures
impl Ord for ModelFeatures
Source§fn cmp(&self, other: &ModelFeatures) -> Ordering
fn cmp(&self, other: &ModelFeatures) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ModelFeatures
impl PartialEq for ModelFeatures
Source§impl PartialOrd for ModelFeatures
impl PartialOrd for ModelFeatures
Source§impl Serialize for ModelFeatures
impl Serialize for ModelFeatures
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ModelFeatures
impl Eq for ModelFeatures
impl StructuralPartialEq for ModelFeatures
Auto Trait Implementations§
impl Freeze for ModelFeatures
impl RefUnwindSafe for ModelFeatures
impl Send for ModelFeatures
impl Sync for ModelFeatures
impl Unpin for ModelFeatures
impl UnwindSafe for ModelFeatures
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more