AIfES 2 2.0.0
ailoss_crossentropy.h
Go to the documentation of this file.
1
53#ifndef CROSSENTROPY_LOSS
54#define CROSSENTROPY_LOSS
55
56#include "core/aifes_core.h"
59
73
81 void (*tensor_sub)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
82
98 void (*crossentropy)(const aitensor_t *predicted_data, const aitensor_t *target_data, void *result);
99
101};
102
109
122
148void ailoss_crossentropy_calc_delta(ailoss_t *self, const aitensor_t *target_data);
149
180void ailoss_crossentropy_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result);
181
195
196#ifdef AIDEBUG_PRINT_MODULE_SPECS
203#endif // AIDEBUG_PRINT_MODULE_SPECS
204
205#endif // CROSSENTROPY_LOSS
AIfES 2 core interface.
Base layer implementation of the Sigmoid activation layer.
Base layer implementation of the Softmax activation layer.
void ailoss_crossentropy_calc_delta(ailoss_t *self, const aitensor_t *target_data)
Calculate the combined derivative of the given Cross-Entropy loss and the output layer for error back...
void ailoss_crossentropy_dummy_backward(ailayer_t *self)
Dummy backward-function for the output layer of the model.
const aicore_losstype_t * ailoss_crossentropy_type
Cross-Entropy loss type.
void ailoss_crossentropy_calc_loss(ailoss_t *self, const aitensor_t *target_data, void *result)
Calculate the Cross-Entropy loss on the given target data.
void ailoss_crossentropy_print_specs(const ailoss_t *self)
Print the loss specification.
ailoss_t * ailoss_crossentropy(ailoss_crossentropy_t *loss, ailayer_t *input_layer)
Initialize and connect the given Cross-Entropy loss.
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 Cross-Entropy loss struct.
Definition: ailoss_crossentropy.h:65
void(* tensor_sub)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor subtraction.
Definition: ailoss_crossentropy.h:81
const aimath_dtype_t * dtype
Main data type of the loss.
Definition: ailoss_crossentropy.h:67
void(* crossentropy)(const aitensor_t *predicted_data, const aitensor_t *target_data, void *result)
Required math function: Cross-Entropy between two tensors.
Definition: ailoss_crossentropy.h:98
ailoss_t base
Inherited field members from general ailoss struct.
Definition: ailoss_crossentropy.h:66
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