pub struct Sequential { /* private fields */ }Expand description
Builder for constructing models layer by layer.
Implementations§
Source§impl Sequential
impl Sequential
pub fn new(name: &str) -> Self
pub fn dense(self, in_features: usize, out_features: usize) -> Self
pub fn conv2d( self, in_channels: usize, out_channels: usize, kernel_size: usize, ) -> Self
pub fn max_pool(self, kernel_size: usize, stride: usize) -> Self
pub fn batch_norm(self, num_features: usize) -> Self
pub fn dropout(self, p: f32) -> Self
pub fn flatten(self) -> Self
pub fn relu(self) -> Self
pub fn sigmoid(self) -> Self
pub fn tanh_act(self) -> Self
pub fn softmax(self) -> Self
pub fn softmax_axis(self, axis: usize) -> Self
pub fn gelu(self) -> Self
pub fn residual(self, layers: Vec<Layer>) -> Self
pub fn attention(self, heads: usize, d_model: usize) -> Self
pub fn layer(self, layer: Layer) -> Self
pub fn build(self) -> Model
Auto Trait Implementations§
impl Freeze for Sequential
impl RefUnwindSafe for Sequential
impl Send for Sequential
impl Sync for Sequential
impl Unpin for Sequential
impl UnsafeUnpin 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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.