pub trait ModelExt<T>: Model<T>where
Self::Layout: ModelLayout,{
Show 17 methods
// Provided methods
fn replace_config(&mut self, config: Self::Config) -> Self::Config { ... }
fn replace_params(
&mut self,
params: DeepModelParams<T>,
) -> DeepModelParams<T> { ... }
fn set_config(&mut self, config: Self::Config) -> &mut Self { ... }
fn set_params(&mut self, params: DeepModelParams<T>) -> &mut Self { ... }
fn input_layer(&self) -> &Params<T> { ... }
fn input_layer_mut(&mut self) -> &mut Params<T> { ... }
fn hidden_layers(&self) -> &Vec<Params<T>> ⓘ { ... }
fn hidden_layers_mut(&mut self) -> &mut Vec<Params<T>> ⓘ { ... }
fn output_layer(&self) -> &Params<T> { ... }
fn output_layer_mut(&mut self) -> &mut Params<T> { ... }
fn set_input_layer(&mut self, layer: Params<T>) -> &mut Self { ... }
fn set_hidden_layers(&mut self, layers: Vec<Params<T>>) -> &mut Self { ... }
fn set_output_layer(&mut self, layer: Params<T>) -> &mut Self { ... }
fn input_dim(&self) -> (usize, usize) { ... }
fn hidden_dim(&self) -> (usize, usize) { ... }
fn hidden_layers_count(&self) -> usize { ... }
fn output_dim(&self) -> (usize, usize) { ... }
}Provided Methods§
Sourcefn replace_config(&mut self, config: Self::Config) -> Self::Config
fn replace_config(&mut self, config: Self::Config) -> Self::Config
replace the current configuration and returns the old one;
Sourcefn replace_params(&mut self, params: DeepModelParams<T>) -> DeepModelParams<T>
fn replace_params(&mut self, params: DeepModelParams<T>) -> DeepModelParams<T>
replace the current model parameters and returns the old one
Sourcefn set_config(&mut self, config: Self::Config) -> &mut Self
fn set_config(&mut self, config: Self::Config) -> &mut Self
overrides the current configuration and returns a mutable reference to the model
Sourcefn set_params(&mut self, params: DeepModelParams<T>) -> &mut Self
fn set_params(&mut self, params: DeepModelParams<T>) -> &mut Self
overrides the current model parameters and returns a mutable reference to the model
Sourcefn input_layer(&self) -> &Params<T>
fn input_layer(&self) -> &Params<T>
returns an immutable reference to the input layer;
Sourcefn input_layer_mut(&mut self) -> &mut Params<T>
fn input_layer_mut(&mut self) -> &mut Params<T>
returns a mutable reference to the input layer;
returns an immutable reference to the hidden layer(s);
returns a mutable reference to the hidden layer(s);
Sourcefn output_layer(&self) -> &Params<T>
fn output_layer(&self) -> &Params<T>
returns an immutable reference to the output layer;
Sourcefn output_layer_mut(&mut self) -> &mut Params<T>
fn output_layer_mut(&mut self) -> &mut Params<T>
returns a mutable reference to the output layer;
fn set_input_layer(&mut self, layer: Params<T>) -> &mut Self
fn set_output_layer(&mut self, layer: Params<T>) -> &mut Self
Sourcefn input_dim(&self) -> (usize, usize)
fn input_dim(&self) -> (usize, usize)
returns a 2-tuple representing the dimensions of the input layer; (input, hidden)
returns a 2-tuple representing the dimensions of the hidden layers; (hidden, hidden)
returns the total number of hidden layers in the model;
Sourcefn output_dim(&self) -> (usize, usize)
fn output_dim(&self) -> (usize, usize)
returns a 2-tuple representing the dimensions of the output layer; (hidden, output)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.