Struct engram::nn::Sequential
source · pub struct Sequential {
pub layers: Vec<Box<dyn Layer>>,
/* private fields */
}
Fields§
§layers: Vec<Box<dyn Layer>>
Implementations§
source§impl Sequential
impl Sequential
pub fn new() -> Self
pub fn add_layer<T>(&mut self, layer: T)where
T: Layer + 'static,
pub fn add_layers<T>(&mut self, layers: Vec<T>)where
T: Layer + 'static,
pub fn set_optimizer<T>(&mut self, optimizer: T)where
T: Optimizer + 'static,
pub fn set_regularization<T>(&mut self, regularization: T)where
T: Regularization + 'static,
pub fn train(&mut self)
pub fn eval(&mut self)
pub fn forward(&mut self, input: &Tensor) -> Tensor
pub fn backward(&mut self, target: &Tensor, loss_fn: &Loss) -> f64
pub fn fit( &mut self, dataset: &Dataset, loss_fn: &Loss, epochs: usize, batch_size: usize )
pub fn regularize(&mut self) -> f64
pub fn step(&mut self)
pub fn predict(&mut self, input: &Tensor) -> Tensor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sequential
impl !RefUnwindSafe for Sequential
impl !Send for Sequential
impl !Sync for Sequential
impl Unpin for Sequential
impl !UnwindSafe for Sequential
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