AIfES 2 2.0.0
ailoss_mse.h
Go to the documentation of this file.
1
43#ifndef MSE_LOSS
44#define MSE_LOSS
45
46#include "core/aifes_core.h"
47
48typedef struct ailoss_mse ailoss_mse_t;
53struct ailoss_mse {
61
69 void (*tensor_sub)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
70
78 void (*norm_squared)(const aitensor_t *x, void *result);
79
81};
82
89
102
125void ailoss_mse_calc_delta(ailoss_t *self, const aitensor_t *target_data);
126
151void ailoss_mse_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result);
152
153#ifdef AIDEBUG_PRINT_MODULE_SPECS
160#endif // AIDEBUG_PRINT_MODULE_SPECS
161
162#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.
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.
ailoss_t * ailoss_mse(ailoss_mse_t *loss, ailayer_t *input_layer)
Initialize and connect the given MSE 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.
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:53
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:69
const aimath_dtype_t * dtype
Main data type of the loss.
Definition: ailoss_mse.h:55
ailoss_t base
Inherited field members from general ailoss struct.
Definition: ailoss_mse.h:54
void(* norm_squared)(const aitensor_t *x, void *result)
Required math function: Squared sum of tensor elements.
Definition: ailoss_mse.h:78
AIfES loss interface.
Definition: aifes_core.h:358
Indicator for the used datatype.
Definition: aifes_math.h:47
A tensor in AIfES.
Definition: aifes_math.h:92