25 #ifndef TEMPLATE_LAYER
26 #define TEMPLATE_LAYER
39 uint32_t example_configuration;
118 #ifdef AIDEBUG_PRINT_MODULE_SPECS
void ailayer_template_print_specs(const ailayer_t *self)
Print the layer specification.
void ailayer_template_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
void ailayer_template_set_trainmem(ailayer_t *self, void *memory_ptr)
Distribute provided memory to the training gradients pointers - mandatory for hidden layers
uint32_t ailayer_template_sizeof_paramem(const ailayer_t *self)
Calculate and return the parameter memory size needed for this layer - mandatory for hidden layers
void ailayer_template_set_paramem(ailayer_t *self, void *memory_ptr)
Distribute provided memory to the parameter pointers - mandatory for hidden layers
ailayer_t * ailayer_template(ailayer_template_t *layer, ailayer_t *input_layer)
Initialize the given layer struct - mandatory
void ailayer_template_forward(ailayer_t *self)
Calculate the forward path for given layer - mandatory
void ailayer_template_backward(ailayer_t *self)
Calculate the backward (training) path for the given layer - depends on usability in training
uint32_t ailayer_template_sizeof_trainmem(const ailayer_t *self)
Calculate and return the necessary memory size needed by this layer for training - mandatory for hidd...
Type indicator of the layer.
Definition: aifes_core.h:82
Template for general AIfES layers.
Definition: ailayer_template.h:35
aitensor_t * gradients[2]
Gradients structure for the back propagation algorithm.
Definition: ailayer_template.h:50
void * optimem[2]
Memory field used by the trainings optimizer.
Definition: ailayer_template.h:51
void(* tensor_add)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Function pointer to the used tensor addition.
Definition: ailayer_template.h:55
void(* copy_tensor)(const aitensor_t *from, aitensor_t *to)
Function pointer to the used tensor copy function.
Definition: ailayer_template.h:54
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_template.h:36
uint16_t result_shape[2]
Inference result tensor shape (n x m matrix).
Definition: ailayer_template.h:47
aitensor_t * trainable_params[2]
Pointer to the weights and biases (which are the trainable parameters).
Definition: ailayer_template.h:49
AIfES layer interface.
Definition: aifes_core.h:252
A tensor in AIfES.
Definition: aifes_math.h:89