AIfES 2  2.0.0
ailayer_dense_cmsis.h File Reference

Arm CMSIS implementation of the Dense layer for Arm Cortex processors. More...

Go to the source code of this file.

Functions

ailayer_tailayer_dense_f32_cmsis (ailayer_dense_t *layer, ailayer_t *input_layer)
 Initializes and connect a Dense layer with the F32 CMSIS implementation. More...
 

Detailed Description

Arm CMSIS implementation of the Dense layer for Arm Cortex processors.

Version
2.0alpha

AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.

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

Arm CMSIS implementations of the Dense layer in F32 data-type. These implementations are specifically designed for the Arm Cortex processors and take advantage of SIMD instructions. For more information about the Dense layer refer to ailayer_dense.h.

Function Documentation

◆ ailayer_dense_f32_cmsis()

ailayer_t* ailayer_dense_f32_cmsis ( ailayer_dense_t layer,
ailayer_t input_layer 
)

Initializes and connect a Dense layer with the F32 CMSIS implementation.

Example: Create the layer structure with pretrained weights:

// Use constant data only for inference. For training remove the const qualifier!!
const float weights_data_dense[] = {-10.1164f, -8.4212f, 5.4396f, 7.297f, -7.6482f, -9.0155f};
const float bias_data_dense[] = {-2.9653f, 2.3677f, -1.5968f};
ailayer_dense_f32_t dense_layer = {
.neurons = 3,
.weights.data = (float *) weights_data_dense,
.bias.data = (float *) bias_data_dense
};
General Dense layer structure.
Definition: ailayer_dense.h:72
uint32_t neurons
Layer neurons count (number of outputs).
Definition: ailayer_dense.h:82

Example: Create the layer structure for training:

ailayer_dense_f32_t dense_layer = {
.neurons = 3
};

Example: Initialize and connect the layer:

x = ailayer_dense_f32_cmsis(&dense_layer, x);
ailayer_t * ailayer_dense_f32_cmsis(ailayer_dense_t *layer, ailayer_t *input_layer)
Initializes and connect a Dense layer with the F32 CMSIS implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.