pub trait RawModelLayout {
// Required methods
fn input(&self) -> usize;
fn hidden(&self) -> usize;
fn output(&self) -> usize;
fn depth(&self) -> usize;
// Provided methods
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 { ... }
}Expand description
The RawModelLayout trait defines a minimal interface for objects capable of representing
the layout; i.e. the number of input, hidden, and output features of a neural network
model containing some number of hidden layers.
Note: This trait is implemented for the 3- and 4-tuple consiting of usize elements as
well as for the [usize; 3] and [usize; 4] array types. In both these instances, the
elements are ordered as (input, hidden, output) for the 3-element versions, and
(input, hidden, output, layers) for the 4-element versions.
Required Methods§
returns the number of hidden features for the model
Provided Methods§
the dimension of the hidden layers; (hidden, hidden)
Sourcefn dim_output(&self) -> (usize, usize)
fn dim_output(&self) -> (usize, usize)
the dimension of the output layer; (hidden, output)
Sourcefn size_input(&self) -> usize
fn size_input(&self) -> usize
the total number of input parameters in the model
the total number of hidden parameters in the model
Sourcefn size_output(&self) -> usize
fn size_output(&self) -> usize
the total number of output parameters in the model