Struct dfdx::nn::MaxPoolGlobal
source · [−]pub struct MaxPoolGlobal;
Expand description
Applies max pooling over an entire image, fully reducing the height and width dimensions:
- Reduces 2d (C, L) to 1d (C, )
- Reduces 3d (C, H, W) to 1d (C, )
- Reduces 4d (B, C, H, W) to 2d (B, C)
Pytorch equivalent: torch.nn.AdaptiveMaxPool2d(1)
followed by a flatten.
Examples:
let m: MaxPoolGlobal = Default::default();
let _: Tensor1D<5> = m.forward(Tensor3D::<5, 16, 8>::zeros());
let _: Tensor2D<10, 5> = m.forward(Tensor4D::<10, 5, 16, 8>::zeros());
Trait Implementations
sourceimpl CanUpdateWithGradients for MaxPoolGlobal
impl CanUpdateWithGradients for MaxPoolGlobal
sourcefn update<G: GradientProvider>(&mut self, _: &mut G, _: &mut UnusedTensors)
fn update<G: GradientProvider>(&mut self, _: &mut G, _: &mut UnusedTensors)
Updates self given the GradientProvider. When any parameters that
are NOT present in
G
, then this function should
add the tensor’s UniqueId to UnusedTensors. Read moresourceimpl Clone for MaxPoolGlobal
impl Clone for MaxPoolGlobal
sourcefn clone(&self) -> MaxPoolGlobal
fn clone(&self) -> MaxPoolGlobal
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Default for MaxPoolGlobal
impl Default for MaxPoolGlobal
sourcefn default() -> MaxPoolGlobal
fn default() -> MaxPoolGlobal
Returns the “default value” for a type. Read more
sourceimpl LoadFromNpz for MaxPoolGlobal
impl LoadFromNpz for MaxPoolGlobal
sourceimpl<const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor3D<C, H, W, T>> for MaxPoolGlobal
impl<const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor3D<C, H, W, T>> for MaxPoolGlobal
sourceimpl<const B: usize, const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor4D<B, C, H, W, T>> for MaxPoolGlobal
impl<const B: usize, const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor4D<B, C, H, W, T>> for MaxPoolGlobal
sourceimpl<T> ModuleMut<T> for MaxPoolGlobalwhere
Self: Module<T>,
impl<T> ModuleMut<T> for MaxPoolGlobalwhere
Self: Module<T>,
type Output = <MaxPoolGlobal as Module<T>>::Output
type Output = <MaxPoolGlobal as Module<T>>::Output
The type that this unit produces given
Input
.sourcefn forward_mut(&mut self, input: T) -> Self::Output
fn forward_mut(&mut self, input: T) -> Self::Output
sourceimpl ResetParams for MaxPoolGlobal
impl ResetParams for MaxPoolGlobal
sourceimpl SaveToNpz for MaxPoolGlobal
impl SaveToNpz for MaxPoolGlobal
impl Copy for MaxPoolGlobal
Auto Trait Implementations
impl RefUnwindSafe for MaxPoolGlobal
impl Send for MaxPoolGlobal
impl Sync for MaxPoolGlobal
impl Unpin for MaxPoolGlobal
impl UnwindSafe for MaxPoolGlobal
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more