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 
64  void (*mse_gradients)(const aitensor_t *predicted, const aitensor_t *target, aitensor_t *result);
65 
71  void (*mse_loss)(const aitensor_t *predicted, const aitensor_t *target, void *result);
72 
74 };
75 
82 
94 ailoss_t *ailoss_mse(ailoss_mse_t *loss, ailayer_t *input_layer);
95 
118 void ailoss_mse_calc_delta(ailoss_t *self, const aitensor_t *target_data);
119 
144 void ailoss_mse_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result);
145 
146 #ifdef AIDEBUG_PRINT_MODULE_SPECS
152 #endif // AIDEBUG_PRINT_MODULE_SPECS
153 
154 #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:121
AIfES layer interface.
Definition: aifes_core.h:252
General Mean Squared Error (MSE) loss struct.
Definition: ailoss_mse.h:50
void(* mse_gradients)(const aitensor_t *predicted, const aitensor_t *target, aitensor_t *result)
Required math function: Gradient calculation of MSE loss function.
Definition: ailoss_mse.h:64
const aimath_dtype_t * dtype
Main data type of the loss.
Definition: ailoss_mse.h:52
void(* mse_loss)(const aitensor_t *predicted, const aitensor_t *target, void *result)
Required math function: Calculation of the MSE loss function.
Definition: ailoss_mse.h:71
ailoss_t base
Inherited field members from general ailoss struct.
Definition: ailoss_mse.h:51
AIfES loss interface.
Definition: aifes_core.h:385
Indicator for the used datatype.
Definition: aifes_math.h:44
A tensor in AIfES.
Definition: aifes_math.h:89