pub struct Model<'a> { /* private fields */ }
Expand description
A neural network model, containing the layers of the model, and the outputs.
Implementations§
Source§impl<'a> Model<'a>
impl<'a> Model<'a>
Sourcepub fn new(
layers: Vec<&'a mut dyn Layer>,
optimizer: &'a dyn Optimizer,
cost: &'a CostFunction,
) -> Model<'a>
pub fn new( layers: Vec<&'a mut dyn Layer>, optimizer: &'a dyn Optimizer, cost: &'a CostFunction, ) -> Model<'a>
Constructs a new model given the layers.
Sourcepub fn forward(&mut self, input: Array) -> Array
pub fn forward(&mut self, input: Array) -> Array
Computes the forward pass of a model. The input should have the dimensions batch size by input size.
Auto Trait Implementations§
impl<'a> !Freeze for Model<'a>
impl<'a> !RefUnwindSafe for Model<'a>
impl<'a> !Send for Model<'a>
impl<'a> !Sync for Model<'a>
impl<'a> Unpin for Model<'a>
impl<'a> !UnwindSafe for Model<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more