AIfES 2
2.0.0
|
Default implementation of the Adam optimizer . More...
Go to the source code of this file.
Data Structures | |
struct | aiopti_adam_f32 |
Data-type specific Adam optimizer struct for F32 . More... | |
Typedefs | |
typedef struct aiopti_adam_f32 | aiopti_adam_f32_t |
Functions | |
aiopti_t * | aiopti_adam_f32_default (aiopti_adam_f32_t *opti) |
Initializes an Adam optimizer with the F32 default implementation. More... | |
void | aiopti_adam_f32_default_begin_step (aiopti_t *self) |
F32 default implementation of the aiopti.begin_step function for ADAM More... | |
void | aiopti_adam_f32_default_end_step (aiopti_t *self) |
F32 default implementation of the aiopti.end_step function for ADAM More... | |
Default implementation of the Adam optimizer .
Hardware independent implementations of the Adam optimizer in F32 , Q31 data-type. For more information about the Adam optimizer refer to aiopti_adam.h.
aiopti_t* aiopti_adam_f32_default | ( | aiopti_adam_f32_t * | opti | ) |
Initializes an Adam optimizer with the F32 default implementation.
Example: Create the optimizer structure:
In C:
In C, C++ and on Arduino:
Example: Initialize the optimizer:
*opti | The optimizer structure to initialize. |
void aiopti_adam_f32_default_begin_step | ( | aiopti_t * | self | ) |
F32 default implementation of the aiopti.begin_step function for ADAM
Implementation of aiopti.begin_step.
The ADAM optimizer needs some modification of the learning rate in every optimization step. This function deals with aiscalars and has to be implemented for every data-type individually.
The calculations are:
\[ lr_t \leftarrow lr \cdot \frac{\sqrt{1 - \beta^t_2}} {(1 - \beta_1)^t} \]
This is not primary time critical function, because it only deals with scalars -> No special hardware implementation necessary (but possible).
*self | The optimizer structure |
void aiopti_adam_f32_default_end_step | ( | aiopti_t * | self | ) |
F32 default implementation of the aiopti.end_step function for ADAM
Implementation of aiopti.end_step.
The ADAM optimizer needs some modification of the learning rate in every optimization step. This function deals with aiscalars and has to be implemented for every data-type individually.
The calculations are:
\[ \beta^t_1 \leftarrow \beta^t_1 \cdot \beta_1 \]
\[ \beta^t_2 \leftarrow \beta^t_2 \cdot \beta_2 \]
This is not primary time critical function, because it only deals with scalars -> No special hardware implementation necessary (but possible).
*self | The optimizer structure |