AIfES 2  2.0.0
ailayer_elu_avr_pgm.h File Reference

AVR PGM implementation of the ELU layer . More...

Go to the source code of this file.

Functions

ailayer_tailayer_elu_q7_avr_pgm (ailayer_elu_q7_t *layer, ailayer_t *input_layer)
 Initializes and connect a ELU layer with the Q7 AVR PGM implementation. More...
 

Detailed Description

AVR PGM implementation of the ELU layer .

Version
2.2.0

AVR controller specific implementation of the ELU layer in Q7 data-type. For more information about the ELU layer refer to ailayer_elu.h.

Requires avr/pgmspace.h library

Function Documentation

◆ ailayer_elu_q7_avr_pgm()

ailayer_t* ailayer_elu_q7_avr_pgm ( ailayer_elu_q7_t layer,
ailayer_t input_layer 
)

Initializes and connect a ELU layer with the Q7 AVR PGM implementation.

The quantization parameters of the result tensor of the input layer must be defined constant in program memory (PROGMEM). The layer configuration is the same as with ailayer_elu_q7_default().

The quantization parameters of the result tensor are automatically set to {shift = input_layer.result.shift, zero_point = input_layer.result.zero_point} because the output values are in the interval (max(-alpha, min(input_layer.result)), max(input_layer.result)].

Example: Create the layer structure:
In C:

ailayer_elu_q7_t elu_layer = {
.alpha = AISCALAR_Q7(1.0f, 2, 0)
};
Data-type specific ELU layer struct for Q7 .
Definition: ailayer_elu_default.h:67
aiscalar_q7_t alpha
Data-type specific parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu_default.h:69

In C, C++ and on Arduino:

ailayer_elu_q7_t elu_layer = AILAYER_ELU_Q7_M(AISCALAR_Q7(1.0f, 2, 0));

Example: Initialize and connect the layer:

x = ailayer_elu_q7_avr_pgm(&elu_layer, x);
ailayer_t * ailayer_elu_q7_avr_pgm(ailayer_elu_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a ELU layer with the Q7 AVR PGM implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.