Trait ModelExt

Source
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§

Source

fn replace_config(&mut self, config: Self::Config) -> Self::Config

replace the current configuration and returns the old one;

Source

fn replace_params(&mut self, params: DeepModelParams<T>) -> DeepModelParams<T>

replace the current model parameters and returns the old one

Source

fn set_config(&mut self, config: Self::Config) -> &mut Self

overrides the current configuration and returns a mutable reference to the model

Source

fn set_params(&mut self, params: DeepModelParams<T>) -> &mut Self

overrides the current model parameters and returns a mutable reference to the model

Source

fn input_layer(&self) -> &Params<T>

returns an immutable reference to the input layer;

Source

fn input_layer_mut(&mut self) -> &mut Params<T>

returns a mutable reference to the input layer;

Source

fn hidden_layers(&self) -> &Vec<Params<T>>

returns an immutable reference to the hidden layer(s);

Source

fn hidden_layers_mut(&mut self) -> &mut Vec<Params<T>>

returns a mutable reference to the hidden layer(s);

Source

fn output_layer(&self) -> &Params<T>

returns an immutable reference to the output layer;

Source

fn output_layer_mut(&mut self) -> &mut Params<T>

returns a mutable reference to the output layer;

Source

fn set_input_layer(&mut self, layer: Params<T>) -> &mut Self

Source

fn set_hidden_layers(&mut self, layers: Vec<Params<T>>) -> &mut Self

Source

fn set_output_layer(&mut self, layer: Params<T>) -> &mut Self

Source

fn input_dim(&self) -> (usize, usize)

returns a 2-tuple representing the dimensions of the input layer; (input, hidden)

Source

fn hidden_dim(&self) -> (usize, usize)

returns a 2-tuple representing the dimensions of the hidden layers; (hidden, hidden)

Source

fn hidden_layers_count(&self) -> usize

returns the total number of hidden layers in the model;

Source

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.

Implementors§

Source§

impl<M, T> ModelExt<T> for M
where M: Model<T>, M::Layout: ModelLayout,