Struct dfdx::nn::AvgPoolGlobal
source · [−]pub struct AvgPoolGlobal;
Expand description
Applies average 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.AdaptiveAvgPool2d(1)
followed by a flatten.
Examples:
let m: AvgPoolGlobal = 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 AvgPoolGlobal
impl CanUpdateWithGradients for AvgPoolGlobal
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 AvgPoolGlobal
impl Clone for AvgPoolGlobal
sourcefn clone(&self) -> AvgPoolGlobal
fn clone(&self) -> AvgPoolGlobal
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 AvgPoolGlobal
impl Default for AvgPoolGlobal
sourcefn default() -> AvgPoolGlobal
fn default() -> AvgPoolGlobal
Returns the “default value” for a type. Read more
sourceimpl LoadFromNpz for AvgPoolGlobal
impl LoadFromNpz for AvgPoolGlobal
sourceimpl<const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor3D<C, H, W, T>> for AvgPoolGlobal
impl<const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor3D<C, H, W, T>> for AvgPoolGlobal
sourceimpl<const B: usize, const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor4D<B, C, H, W, T>> for AvgPoolGlobal
impl<const B: usize, const C: usize, const H: usize, const W: usize, T: Tape> Module<Tensor4D<B, C, H, W, T>> for AvgPoolGlobal
sourceimpl<T> ModuleMut<T> for AvgPoolGlobalwhere
Self: Module<T>,
impl<T> ModuleMut<T> for AvgPoolGlobalwhere
Self: Module<T>,
type Output = <AvgPoolGlobal as Module<T>>::Output
type Output = <AvgPoolGlobal 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 AvgPoolGlobal
impl ResetParams for AvgPoolGlobal
sourceimpl SaveToNpz for AvgPoolGlobal
impl SaveToNpz for AvgPoolGlobal
impl Copy for AvgPoolGlobal
Auto Trait Implementations
impl RefUnwindSafe for AvgPoolGlobal
impl Send for AvgPoolGlobal
impl Sync for AvgPoolGlobal
impl Unpin for AvgPoolGlobal
impl UnwindSafe for AvgPoolGlobal
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