beatmup.nnets.Pooling2D

class beatmup.nnets.Pooling2D

2D pooling operation computed on GPU. Has a single input and a single output. Constraints:

  • Input and output are 3D tensors with values in [0, 1] range sampled over 8 bits.

  • Number of feature maps is a multiple of 4.

  • Pooling area is of square shape.

  • Strides are equal along X and Y.

  • Average pooling only accepts valid zero padding,

Raspberry Pi-related constraints:

  • Pi cannot sample more than 256 channels to compute a single output value. Actual practical limit is yet lower: pooling size may be limited by 10. When the limit is reached, Pi OpenGL driver reports an out of memory error (0x505).

__init__(self: beatmup.nnets.Pooling2D, name: str, operator: beatmup.nnets.Pooling2D.Operator, size: int, stride: int = 0, padding: beatmup.nnets.Padding = <Padding.VALID: 1>) None

Instantiates a 2D pooling operation.

Parameters:
  • name – layer name.

  • op – pooling operator.

  • size – spatial pooling operational size.

  • stride – pooling stride; if 0, the size is used.

  • padding – zero padding applied to the input.

Methods

__init__(self, name, operator, size, stride, ...)

Instantiates a 2D pooling operation.

Attributes

AVERAGE

MAX

input_count

Number of operation inputs

name

Operation name

output_count

Number of operation outputs