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 const fn deep( input: usize, hidden: usize, layers: usize, output: usize, ) -> Self
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_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 more