![]() |
AIfES 2
2.0.0
|
[DEPRECATED] This file acts as a reference for new layer structures. Some of the shown functions are mandatory, some are optional. More...
Go to the source code of this file.
Data Structures | |
struct | ailayer_template |
Template for general AIfES layers. More... | |
Typedefs | |
typedef struct ailayer_template | ailayer_template_t |
Functions | |
ailayer_t * | ailayer_template (ailayer_template_t *layer, ailayer_t *input_layer) |
Initialize the given layer struct - mandatory More... | |
void | ailayer_template_forward (ailayer_t *self) |
Calculate the forward path for given layer - mandatory More... | |
void | ailayer_template_backward (ailayer_t *self) |
Calculate the backward (training) path for the given layer - depends on usability in training More... | |
void | ailayer_template_calc_result_shape (ailayer_t *self) |
Calculate the shape of the result tensor. More... | |
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 More... | |
void | ailayer_template_set_paramem (ailayer_t *self, void *memory_ptr) |
Distribute provided memory to the parameter pointers - mandatory for hidden layers More... | |
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 hidden layers More... | |
void | ailayer_template_set_trainmem (ailayer_t *self, void *memory_ptr) |
Distribute provided memory to the training gradients pointers - mandatory for hidden layers More... | |
void | ailayer_template_print_specs (const ailayer_t *self, int(*print)(const char *format,...)) |
Print the layer specification. More... | |
Variables | |
const aicore_layertype_t * | ailayer_template_type |
[DEPRECATED] This file acts as a reference for new layer structures. Some of the shown functions are mandatory, some are optional.
AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
ailayer_t* ailayer_template | ( | ailayer_template_t * | layer, |
ailayer_t * | input_layer | ||
) |
Initialize the given layer struct - mandatory
Initializes and sets all parameters needed by the layer structure.
*layer | The layer to initialize. |
*input_layer | The layer that provides the inputs to the initialized layer. |
void ailayer_template_backward | ( | ailayer_t * | self | ) |
Calculate the backward (training) path for the given layer - depends on usability in training
*self | Layer to calculate the backward path for. |
void ailayer_template_calc_result_shape | ( | ailayer_t * | self | ) |
Calculate the shape of the result tensor.
*self | Layer to calculate the resulting shape for. |
void ailayer_template_forward | ( | ailayer_t * | self | ) |
Calculate the forward path for given layer - mandatory
*self | Layer to calculate the forward path for. |
void ailayer_template_print_specs | ( | const ailayer_t * | self, |
int(*)(const char *format,...) | |||
) |
Print the layer specification.
*self | The layer to print the specification for |
Pointer to the print function to use |
void ailayer_template_set_paramem | ( | ailayer_t * | self, |
void * | memory_ptr | ||
) |
Distribute provided memory to the parameter pointers - mandatory for hidden layers
*self | The layer to set the memory fields for. |
*memory_ptr | Pointer to the buffer provided for the layer parameters. |
void ailayer_template_set_trainmem | ( | ailayer_t * | self, |
void * | memory_ptr | ||
) |
Distribute provided memory to the training gradients pointers - mandatory for hidden layers
*self | The layer to set the memory fields for. |
*memory_ptr | Pointer to the buffer provided for the layer gradients. |
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
*self | The layer to calculate the parameter memory size for |
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 hidden layers
*self | The layer to calculate the gradient memory size for. |