AIfES 2  2.0.0
aicore_optitype Struct Reference

Type indicator of the optimizer to check for the optimizer type. More...

#include <aifes_core.h>

Data Fields

const char * name
 Name of the optimizer type (for example "ADAM")
 
void(* print_specs )(const aiopti_t *self)
 Set a function to print specs of the optimizer. More...
 

Detailed Description

Type indicator of the optimizer to check for the optimizer type.

Every optimizer should have a constant global variable of this type which indicates the optimizer type.
Example for the adam optimizer:

const aicore_optitype_t aiopti_adam_type_s = {
#ifdef AIDEBUG_PRINT_MODULE_SPECS
.name = "ADAM",
.print_specs = aiopti_adam_print_specs
#else
.name = 0,
.print_specs = 0
#endif
};
const aicore_optitype_t *aiopti_adam_type = &aiopti_adam_type_s;
void aiopti_adam_print_specs(const aiopti_t *self)
Print the optimizer specification.
const aicore_optitype_t * aiopti_adam_type
Adam optimizer type.
Type indicator of the optimizer to check for the optimizer type.
Definition: aifes_core.h:160
const char * name
Name of the optimizer type (for example "ADAM")
Definition: aifes_core.h:161

Checks for the optimizer type can look like this:

aiopti_t *example_optimizer;
if(example_optimizer->optimizer_type == aiopti_adam_type){
...
}
AIfES optimizer interface.
Definition: aifes_core.h:438
const aicore_optitype_t * optimizer_type
Type of the optimizer (for example aiopti_sgd_type)
Definition: aifes_core.h:439

Field Documentation

◆ print_specs

void(* print_specs) (const aiopti_t *self)

Set a function to print specs of the optimizer.

This function should only be set in the debug mode when prints are required (to save memory otherwise)

Parameters
selfThe optimizer
*printA function for printing (for example printf)

The documentation for this struct was generated from the following file: