AIfES 2  2.0.0
ailayer_maxpool2d_default.h File Reference

Default implementation of the MaxPool2D layer . More...

Go to the source code of this file.

Typedefs

typedef struct ailayer_maxpool2d ailayer_maxpool2d_f32_t
 

Functions

ailayer_tailayer_maxpool2d_f32_default (ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a Conv2D layer with the F32 default implementation. More...
 
ailayer_tailayer_maxpool2d_cfirst_f32_default (ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation. More...
 
ailayer_tailayer_maxpool2d_chw_f32_default (ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation. More...
 
ailayer_tailayer_maxpool2d_clast_f32_default (ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation. More...
 
ailayer_tailayer_maxpool2d_hwc_f32_default (ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation. More...
 

Detailed Description

Default implementation of the MaxPool2D layer .

Version
2.2.0
Date
18.10.2021

Hardware independent implementations of the MaxPool2D layer in F32 data-type. For more information about the MaxPool2D layer refer to ailayer_maxpool2d.h.

Function Documentation

◆ ailayer_maxpool2d_cfirst_f32_default()

ailayer_t* ailayer_maxpool2d_cfirst_f32_default ( ailayer_maxpool2d_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation.

Code examples are given in the description of ailayer_maxpool2d_f32_default().

Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_maxpool2d_chw_f32_default()

ailayer_t* ailayer_maxpool2d_chw_f32_default ( ailayer_maxpool2d_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation.

Code examples are given in the description of ailayer_maxpool2d_f32_default().

Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_maxpool2d_clast_f32_default()

ailayer_t* ailayer_maxpool2d_clast_f32_default ( ailayer_maxpool2d_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation.

Code examples are given in the description of ailayer_maxpool2d_f32_default().

Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_maxpool2d_f32_default()

ailayer_t* ailayer_maxpool2d_f32_default ( ailayer_maxpool2d_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a Conv2D layer with the F32 default implementation.

Example: Create the layer structure:
In C:

ailayer_maxpool2d_f32_t maxpool2d_layer = {
.pool_size = {2, 2},
.stride = {2, 2},
.padding = {0, 0}
};
General layer structure.
Definition: ailayer_maxpool2d.h:51
uint16_t pool_size[2]
Size of the pooling kernel ( ).
Definition: ailayer_maxpool2d.h:61

In C, C++ and on Arduino:

ailayer_maxpool2d_t maxpool2d_layer = AILAYER_CONV2D_F32_A(
/* pool_size =*/ HW(2, 2),
/* stride =*/ HW(2, 2),
/* padding =*/ HW(0, 0)
);

Example: Initialize and connect the layer for data with channels first (all options are equivalent):

maxpool2d_layer.channel_axis = 1;
x = ailayer_maxpool2d_f32_default(&maxpool2d_layer, x);
ailayer_t * ailayer_maxpool2d_f32_default(ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Conv2D layer with the F32 default implementation.
int8_t channel_axis
Index of the channel axis (1 for channels first and -1 or 3 for channels last).
Definition: ailayer_maxpool2d.h:65

or

x = ailayer_maxpool2d_cfirst_f32_default(&maxpool2d_layer, x);
ailayer_t * ailayer_maxpool2d_cfirst_f32_default(ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation.

or

x = ailayer_maxpool2d_chw_f32_default(&maxpool2d_layer, x);
ailayer_t * ailayer_maxpool2d_chw_f32_default(ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a MaxPool2D layer (channels first) with the F32 default implementation.

Example: Initialize and connect the layer for data with channels last (all options are equivalent):

maxpool2d_layer.channel_axis = -1;
x = ailayer_maxpool2d_f32_default(&maxpool2d_layer, x);

or

x = ailayer_maxpool2d_clast_f32_default(&maxpool2d_layer, x);
ailayer_t * ailayer_maxpool2d_clast_f32_default(ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation.

or

x = ailayer_maxpool2d_hwc_f32_default(&maxpool2d_layer, x);
ailayer_t * ailayer_maxpool2d_hwc_f32_default(ailayer_maxpool2d_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_maxpool2d_hwc_f32_default()

ailayer_t* ailayer_maxpool2d_hwc_f32_default ( ailayer_maxpool2d_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a MaxPool2D layer (channels last) with the F32 default implementation.

Code examples are given in the description of ailayer_maxpool2d_f32_default().

Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.