pub struct Dropout3d {
pub one_minus_p: f32,
pub training: bool,
}
Expand description
Apply 3D channel-wise dropout during training.
Randomly zero out entire channels independently with probability p
.
This layer expects the channels to be last, i.e., the input shape should be
NDHWC
or DHWC
where: N
is the batch dimension, D
is the depth,
H
is the input image height, W
is the input image width, and C
is
the number of input channels.
The remaining channels are scaled by 1 / (1-p)
to
maintain the expected value of each element. Unlike traditional dropout,
which zeros individual entries, this layer zeros entire channels. This is
often beneficial for convolutional layers processing 3D data, like in
medical imaging or video processing.
Fields§
§one_minus_p: f32
1-p
, where p
is the probability of zeroing a channel. p
is default to
Dropout3d::DEFAULT_P
if not specified.
training: bool
Whether the layer is in training mode. Default to Dropout3d::DEFAULT_TRAINING
if not
specified.
Implementations§
Trait Implementations§
Source§impl Buildable for Dropout3d
impl Buildable for Dropout3d
Source§type Builder = Dropout3dBuilder
type Builder = Dropout3dBuilder
Source§impl Builder<Dropout3d> for Dropout3dBuilder
impl Builder<Dropout3d> for Dropout3dBuilder
Source§impl Module<&Array> for Dropout3d
impl Module<&Array> for Dropout3d
Source§fn training_mode(&mut self, mode: bool)
fn training_mode(&mut self, mode: bool)
Source§impl ModuleParameters for Dropout3d
impl ModuleParameters for Dropout3d
Source§fn freeze_parameters(&mut self, recursive: bool)
fn freeze_parameters(&mut self, recursive: bool)
Source§fn unfreeze_parameters(&mut self, recursive: bool)
fn unfreeze_parameters(&mut self, recursive: bool)
Source§fn parameters(&self) -> ModuleParamRef<'_>
fn parameters(&self) -> ModuleParamRef<'_>
Source§fn parameters_mut(&mut self) -> ModuleParamMut<'_>
fn parameters_mut(&mut self) -> ModuleParamMut<'_>
Source§fn trainable_parameters(&self) -> ModuleParamRef<'_>
fn trainable_parameters(&self) -> ModuleParamRef<'_>
Source§fn all_frozen(&self) -> Option<bool>
fn all_frozen(&self) -> Option<bool>
None
if there are no parameters.Source§fn any_frozen(&self) -> Option<bool>
fn any_frozen(&self) -> Option<bool>
None
if there are no parameters.Source§fn update(&mut self, parameters: ModuleParam)
fn update(&mut self, parameters: ModuleParam)
Source§fn update_flattened(&mut self, flattened_parameters: FlattenedModuleParam)
fn update_flattened(&mut self, flattened_parameters: FlattenedModuleParam)
Auto Trait Implementations§
impl Freeze for Dropout3d
impl RefUnwindSafe for Dropout3d
impl Send for Dropout3d
impl Sync for Dropout3d
impl Unpin for Dropout3d
impl UnwindSafe for Dropout3d
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Option
.Source§impl<T> IntoStrideBy for T
impl<T> IntoStrideBy for T
Source§impl<T> ModuleParametersExt for Twhere
T: ModuleParameters,
impl<T> ModuleParametersExt for Twhere
T: ModuleParameters,
Source§impl<T> Parameter for Twhere
T: ModuleParameters,
impl<T> Parameter for Twhere
T: ModuleParameters,
Source§fn is_frozen(&self) -> Option<bool>
fn is_frozen(&self) -> Option<bool>
None
if the parameter is a module that has no
parameters.