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
Sourcepub const fn deep(
input: usize,
hidden: usize,
output: usize,
layers: usize,
) -> Self
pub const fn deep( input: usize, hidden: usize, output: usize, layers: usize, ) -> Self
creates a new instance of ModelFeatures for a deep neurao network, using the given
input, hidden, and output features with the given number of hidden layers
Sourcepub const fn shallow(input: usize, hidden: usize, output: usize) -> Self
pub const fn shallow(input: usize, hidden: usize, output: usize) -> Self
returns a new instance of ModelFeatures for a shallow neural network, using the
given features for the input, output, and single hidden layer
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
Sourcepub const fn inner(&self) -> ModelFormat
pub const fn inner(&self) -> ModelFormat
returns a copy of the inner format for the model
Sourcepub const fn inner_mut(&mut self) -> &mut ModelFormat
pub const fn inner_mut(&mut self) -> &mut ModelFormat
returns a mutable reference to the inner format 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
sets the hidden features for the model
Sourcepub fn set_layers(&mut self, layers: usize) -> &mut Self
pub fn set_layers(&mut self, layers: usize) -> &mut Self
sets the number of hidden layers for the model
Sourcepub fn set_output(&mut self, output: usize) -> &mut Self
pub fn set_output(&mut self, output: usize) -> &mut Self
sets the output features for the model
Sourcepub fn with_input(self, input: usize) -> Self
pub fn with_input(self, input: usize) -> Self
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) -> Self
pub fn with_layers(self, layers: usize) -> Self
consumes the current instance and returns a new instance with the given number of hidden layers
Sourcepub fn with_output(self, output: usize) -> Self
pub fn with_output(self, output: usize) -> Self
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§const fn clone_from(&mut self, source: &Self)
const 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§impl<'de> Deserialize<'de> for ModelFeatures
impl<'de> Deserialize<'de> for ModelFeatures
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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_input(&mut self, input: usize) -> &mut Self
fn set_input(&mut self, input: usize) -> &mut Self
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
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> 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> CallInPlace<T> for Twhere
T: CallInto<T>,
impl<T> CallInPlace<T> for Twhere
T: CallInto<T>,
Source§fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
call_on_mut method allows an object to be passed onto a function that takes a mutable reference
to the object. This is useful for cases where you want to perform an operation on
an object and mutate it in the process.Source§impl<T> CallInto<T> for T
impl<T> CallInto<T> for T
Source§impl<T> CallOn<T> for Twhere
T: CallInto<T>,
impl<T> CallOn<T> for Twhere
T: CallInto<T>,
Source§fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
call_on method allows an object to be passed onto a function that takes a reference
to the object. This is useful for cases where you want to perform an operation on
an object without needing to extract it from a container or context.