| 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 {
51 ailoss_t base;
52 const aimath_dtype_t *dtype;
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
81 extern const aicore_losstype_t *ailoss_mse_type;
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
151 void ailoss_mse_print_specs(const ailoss_t *self);
152 #endif // AIDEBUG_PRINT_MODULE_SPECS
153
154 #endif // MSE_LOSS
aifes_core.h
AIfES 2 core interface.
ailoss_mse_calc_delta
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_mse
ailoss_t * ailoss_mse(ailoss_mse_t *loss, ailayer_t *input_layer)
Initialize and connect the given MSE loss.
ailoss_mse_type
const aicore_losstype_t * ailoss_mse_type
Mean Squared Error loss type.
ailoss_mse_print_specs
void ailoss_mse_print_specs(const ailoss_t *self)
Print the loss specification.
ailoss_mse_calc_loss
void ailoss_mse_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result)
Calculate the MSE loss on the given target data.
aicore_losstype
Type indicator of the loss to check for the loss type.
Definition: aifes_core.h:121
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
ailoss_mse
General Mean Squared Error (MSE) loss struct.
Definition: ailoss_mse.h:50
ailoss_mse::mse_gradients
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
ailoss_mse::dtype
const aimath_dtype_t * dtype
Main data type of the loss.
Definition: ailoss_mse.h:52
ailoss_mse::mse_loss
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_mse::base
ailoss_t base
Inherited field members from general ailoss struct.
Definition: ailoss_mse.h:51
ailoss
AIfES loss interface.
Definition: aifes_core.h:385
aimath_dtype
Indicator for the used datatype.
Definition: aifes_math.h:44
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89