pub struct DropoutLayer { /* private fields */ }Expand description
Dropout layer for regularization
Implementations§
Source§impl DropoutLayer
impl DropoutLayer
Trait Implementations§
Source§impl Debug for DropoutLayer
impl Debug for DropoutLayer
Source§impl Display for DropoutLayer
impl Display for DropoutLayer
Source§impl Layer for DropoutLayer
impl Layer for DropoutLayer
Source§fn forward(&mut self, input: &Tensor, training: TrainingMode) -> Result<Tensor>
fn forward(&mut self, input: &Tensor, training: TrainingMode) -> Result<Tensor>
Forward pass through the layer
Source§fn backward(&mut self, grad_output: &Tensor) -> Result<Tensor>
fn backward(&mut self, grad_output: &Tensor) -> Result<Tensor>
Backward pass through the layer
Source§fn parameters(&self) -> Vec<&Tensor>
fn parameters(&self) -> Vec<&Tensor>
Get layer parameters (weights, biases, etc.)
Source§fn parameters_mut(&mut self) -> Vec<&mut Tensor>
fn parameters_mut(&mut self) -> Vec<&mut Tensor>
Get mutable layer parameters for optimization
Source§fn gradients_mut(&mut self) -> Vec<&mut Tensor>
fn gradients_mut(&mut self) -> Vec<&mut Tensor>
Get mutable layer gradients
Source§fn output_shape(&self, input_shape: &[usize]) -> Result<Vec<usize>>
fn output_shape(&self, input_shape: &[usize]) -> Result<Vec<usize>>
Get output shape for given input shape
Source§fn set_training(&mut self, training: bool)
fn set_training(&mut self, training: bool)
Set training mode
Source§fn num_parameters(&self) -> usize
fn num_parameters(&self) -> usize
Get number of parameters
Auto Trait Implementations§
impl !RefUnwindSafe for DropoutLayer
impl !UnwindSafe for DropoutLayer
impl Freeze for DropoutLayer
impl Send for DropoutLayer
impl Sync for DropoutLayer
impl Unpin for DropoutLayer
impl UnsafeUnpin for DropoutLayer
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more