Struct dfdx::nn::modules::MaxPoolGlobal
source · pub struct MaxPoolGlobal;
Expand description
Applies max pooling over an entire image, fully reducing the height and width dimensions:
- 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 _: Tensor<Rank1<5>, f32, _> = m.forward(dev.zeros::<Rank3<5, 16, 8>>());
let _: Tensor<Rank2<10, 5>, f32, _> = m.forward(dev.zeros::<Rank4<10, 5, 16, 8>>());
Trait Implementations§
source§impl Clone for MaxPoolGlobal
impl Clone for MaxPoolGlobal
source§fn clone(&self) -> MaxPoolGlobal
fn clone(&self) -> MaxPoolGlobal
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for MaxPoolGlobal
impl Default for MaxPoolGlobal
source§fn default() -> MaxPoolGlobal
fn default() -> MaxPoolGlobal
Returns the “default value” for a type. Read more