AIfES 2 2.0.0
ailayer_tanh_avr_pgm.h File Reference

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

Go to the source code of this file.

Functions

ailayer_tailayer_tanh_q7_avr_pgm (ailayer_tanh_q7_t *layer, ailayer_t *input_layer)
 Initializes and connect a Tanh layer with the Q7 AVR PGM implementation. More...
 

Detailed Description

AVR PGM implementation of the Tanh layer .

Version
2.0alpha

AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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

Requires avr/pgmspace.h library

Function Documentation

◆ ailayer_tanh_q7_avr_pgm()

ailayer_t * ailayer_tanh_q7_avr_pgm ( ailayer_tanh_q7_t layer,
ailayer_t input_layer 
)

Initializes and connect a Tanh 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_tanh_q7_default().

The quantization parameters of the result tensor are automatically set to {shift = 7, zero_point = 0} because the output values are in the interval (-1, 1).

Example: Create the layer structure:

ailayer_tanh_q7_t tanh_layer;
General Tanh layer struct.
Definition: ailayer_tanh.h:50

or

ailayer_tanh_q7_t tanh_layer = AILAYER_TANH_Q7_M();

Example: Initialize and connect the layer:

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