pub struct SpatialDropoutLayer { /* private fields */ }Expand description
Spatial dropout for convolutional layers
Implementations§
Trait Implementations§
Source§impl Debug for SpatialDropoutLayer
impl Debug for SpatialDropoutLayer
Source§impl Display for SpatialDropoutLayer
impl Display for SpatialDropoutLayer
Source§impl Layer for SpatialDropoutLayer
impl Layer for SpatialDropoutLayer
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 SpatialDropoutLayer
impl !UnwindSafe for SpatialDropoutLayer
impl Freeze for SpatialDropoutLayer
impl Send for SpatialDropoutLayer
impl Sync for SpatialDropoutLayer
impl Unpin for SpatialDropoutLayer
impl UnsafeUnpin for SpatialDropoutLayer
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