| AIfES 2 2.0.0

aialgo_sequential_training.h
Go to the documentation of this file.
1
24 #ifndef AIALGO_SEQUENTIAL_TRAINING
25 #define AIALGO_SEQUENTIAL_TRAINING
26
27 #include "core/aifes_core.h"
28 #include "core/aifes_math.h"
29 #include "basic/base/aimath/aimath_basic.h"
30 #include "basic/base/aimath/aimath_q31.h"
31
42 uint32_t aialgo_sizeof_training_memory(aimodel_t *model, aiopti_t *optimizer);
43
56 uint8_t aialgo_schedule_training_memory(aimodel_t *model, aiopti_t *optimizer, void *memory_ptr, uint32_t memory_size);
57
63 void aialgo_init_model_for_training(aimodel_t *model, aiopti_t *optimizer);
64
70 void aialgo_backward_model(aimodel_t *model, aitensor_t *target_data);
71
105 uint8_t aialgo_train_model(aimodel_t *model, aitensor_t *input_tensor, aitensor_t *target_tensor, aiopti_t *optimizer, uint32_t batch_size);
106
114 uint8_t aialgo_calc_loss_model_f32(aimodel_t *model, aitensor_t *input_data, aitensor_t *target_data, float *result);
115
123 uint8_t aialgo_calc_loss_model_q31(aimodel_t *model, aitensor_t *input_data, aitensor_t *target_data, aiscalar_q31_t *result);
124
130 void aialgo_zero_gradients_model(aimodel_t *model, aiopti_t *optimizer);
131
137 void aialgo_update_params_model(aimodel_t *model, aiopti_t *optimizer);
138
145 void aialgo_print_loss_specs(ailoss_t *loss);
146
153 void aialgo_print_optimizer_specs(aiopti_t *opti);
154
162 void aialgo_initialize_parameters_model(aimodel_t *model);
163
164 #endif // AIALGO_SEQUENTIAL_TRAINING
aialgo_zero_gradients_model
void aialgo_zero_gradients_model(aimodel_t *model, aiopti_t *optimizer)
Set the gradients to zero.
aialgo_update_params_model
void aialgo_update_params_model(aimodel_t *model, aiopti_t *optimizer)
Perform the optimization step on the model parameters.
aialgo_init_model_for_training
void aialgo_init_model_for_training(aimodel_t *model, aiopti_t *optimizer)
Initialize the optimization memory of the model layers.
aialgo_train_model
uint8_t aialgo_train_model(aimodel_t *model, aitensor_t *input_tensor, aitensor_t *target_tensor, aiopti_t *optimizer, uint32_t batch_size)
Perform one training epoch on all data batches of the dataset using backpropagation.
aialgo_calc_loss_model_q31
uint8_t aialgo_calc_loss_model_q31(aimodel_t *model, aitensor_t *input_data, aitensor_t *target_data, aiscalar_q31_t *result)
Calculate the loss in Q31 data type.
aialgo_print_optimizer_specs
void aialgo_print_optimizer_specs(aiopti_t *opti)
Print the optimizer specs.
aialgo_schedule_training_memory
uint8_t aialgo_schedule_training_memory(aimodel_t *model, aiopti_t *optimizer, void *memory_ptr, uint32_t memory_size)
Assign the memory for model training.
aialgo_sizeof_training_memory
uint32_t aialgo_sizeof_training_memory(aimodel_t *model, aiopti_t *optimizer)
Calculate the memory requirements for model training.
aialgo_calc_loss_model_f32
uint8_t aialgo_calc_loss_model_f32(aimodel_t *model, aitensor_t *input_data, aitensor_t *target_data, float *result)
Calculate the loss in F32 data type.
aialgo_print_loss_specs
void aialgo_print_loss_specs(ailoss_t *loss)
Print the loss specs.
aialgo_initialize_parameters_model
void aialgo_initialize_parameters_model(aimodel_t *model)
Initialize the parameters of the given model with their default initialization method.
aialgo_backward_model
void aialgo_backward_model(aimodel_t *model, aitensor_t *target_data)
Perform the backward pass.
aifes_core.h
AIfES 2 core interface.
aifes_math.h
AIfES 2 math interface.
aimath_basic.h
Basic data-type independent math operations.
aimath_q31.h
Definition of the Q31 (aiq31) data-type.
ailoss
AIfES loss interface.
Definition: aifes_core.h:385
aimodel
AIfES artificial neural network model.
Definition: aifes_core.h:181
aiopti
AIfES optimizer interface.
Definition: aifes_core.h:438
aiscalar_q31
Single quantized Q31 value/scalar.
Definition: aimath_q31.h:156
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89