Trait ModelLayout

Source
pub trait ModelLayout: Copy + Debug {
Show 19 methods // Required methods fn input(&self) -> usize; fn input_mut(&mut self) -> &mut usize; fn hidden(&self) -> usize; fn hidden_mut(&mut self) -> &mut usize; fn layers(&self) -> usize; fn layers_mut(&mut self) -> &mut usize; fn output(&self) -> usize; fn output_mut(&mut self) -> &mut usize; // Provided methods fn set_input(&mut self, input: usize) -> &mut Self { ... } fn set_hidden(&mut self, hidden: usize) -> &mut Self { ... } fn set_layers(&mut self, layers: usize) -> &mut Self { ... } fn set_output(&mut self, output: usize) -> &mut Self { ... } fn dim_input(&self) -> (usize, usize) { ... } fn dim_hidden(&self) -> (usize, usize) { ... } fn dim_output(&self) -> (usize, usize) { ... } fn size(&self) -> usize { ... } fn size_input(&self) -> usize { ... } fn size_hidden(&self) -> usize { ... } fn size_output(&self) -> usize { ... }
}

Required Methods§

Source

fn input(&self) -> usize

returns a copy of the input features for the model

Source

fn input_mut(&mut self) -> &mut usize

returns a mutable reference to the input features for the model

Source

fn hidden(&self) -> usize

returns a copy of the hidden features for the model

Source

fn hidden_mut(&mut self) -> &mut usize

returns a mutable reference to the hidden features for the model

Source

fn layers(&self) -> usize

returns a copy of the number of hidden layers for the model

Source

fn layers_mut(&mut self) -> &mut usize

returns a mutable reference to the number of hidden layers for the model

Source

fn output(&self) -> usize

returns a copy of the output features for the model

Source

fn output_mut(&mut self) -> &mut usize

returns a mutable reference to the output features for the model

Provided Methods§

Source

fn set_input(&mut self, input: usize) -> &mut Self

sets the input features for the model

Source

fn set_hidden(&mut self, hidden: usize) -> &mut Self

sets the hidden features for the model

Source

fn set_layers(&mut self, layers: usize) -> &mut Self

sets the number of hidden layers for the model

Source

fn set_output(&mut self, output: usize) -> &mut Self

sets the output features for the model

Source

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

the dimension of the input layer; (input, hidden)

Source

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

the dimension of the hidden layers; (hidden, hidden)

Source

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

the dimension of the output layer; (hidden, output)

Source

fn size(&self) -> usize

the total number of parameters in the model

Source

fn size_input(&self) -> usize

the total number of input parameters in the model

Source

fn size_hidden(&self) -> usize

the total number of hidden parameters in the model

Source

fn size_output(&self) -> usize

the total number of output parameters in the model

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§