AIfES 2  2.0.0
ailoss_mse.h
Go to the documentation of this file.
1 
40 #ifndef MSE_LOSS
41 #define MSE_LOSS
42 
43 #include "core/aifes_core.h"
44 
45 typedef struct ailoss_mse ailoss_mse_t;
50 struct ailoss_mse {
58 
66  void (*tensor_sub)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
67 
75  void (*norm_squared)(const aitensor_t *x, void *result);
76 
78 };
79 
86 
98 ailoss_t *ailoss_mse(ailoss_mse_t *loss, ailayer_t *input_layer);
99 
122 void ailoss_mse_calc_delta(ailoss_t *self, const aitensor_t *target_data);
123 
148 void ailoss_mse_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result);
149 
150 #ifdef AIDEBUG_PRINT_MODULE_SPECS
156 #endif // AIDEBUG_PRINT_MODULE_SPECS
157 
158 #endif // MSE_LOSS
AIfES 2 core interface.
void ailoss_mse_calc_delta(ailoss_t *self, const aitensor_t *target_data)
Calculate the derivative of the given MSE loss for error backpropagation.
ailoss_t * ailoss_mse(ailoss_mse_t *loss, ailayer_t *input_layer)
Initialize and connect the given MSE loss.
const aicore_losstype_t * ailoss_mse_type
Mean Squared Error loss type.
void ailoss_mse_print_specs(const ailoss_t *self)
Print the loss specification.
void ailoss_mse_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result)
Calculate the MSE loss on the given target data.
Type indicator of the loss to check for the loss type.
Definition: aifes_core.h:118
AIfES layer interface.
Definition: aifes_core.h:249
General Mean Squared Error (MSE) loss struct.
Definition: ailoss_mse.h:50
void(* tensor_sub)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor subtraction.
Definition: ailoss_mse.h:66
const aimath_dtype_t * dtype
Main data type of the loss.
Definition: ailoss_mse.h:52
ailoss_t base
Inherited field members from general ailoss struct.
Definition: ailoss_mse.h:51
void(* norm_squared)(const aitensor_t *x, void *result)
Required math function: Squared sum of tensor elements.
Definition: ailoss_mse.h:75
AIfES loss interface.
Definition: aifes_core.h:355
Indicator for the used datatype.
Definition: aifes_math.h:44
A tensor in AIfES.
Definition: aifes_math.h:89