| AIfES 2 2.0.0

ailayer_elu.h
Go to the documentation of this file.
1
40 #ifndef ELU_LAYER
41 #define ELU_LAYER
42
43 #include "core/aifes_core.h"
44
45 typedef struct ailayer_elu ailayer_elu_t;
46
50 struct ailayer_elu {
51 ailayer_t base;
59 void *alpha;
60 const aimath_dtype_t *alpha_dtype;
62
67
81 void (*elu)(const aitensor_t *x, const void *alpha, aitensor_t *result);
82
96 void (*d_elu)(const aitensor_t *x, const void *alpha, aitensor_t *result);
97
105 void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
106
108 };
109
115 extern const aicore_layertype_t *ailayer_elu_type;
116
128 ailayer_t *ailayer_elu(ailayer_elu_t *layer, ailayer_t *input_layer);
129
150 void ailayer_elu_forward(ailayer_t *self);
151
175 void ailayer_elu_backward(ailayer_t *self);
176
186 void ailayer_elu_calc_result_shape(ailayer_t *self);
187
188 #ifdef AIDEBUG_PRINT_MODULE_SPECS
193 void ailayer_elu_print_specs(const ailayer_t *self);
194 #endif // AIDEBUG_PRINT_MODULE_SPECS
195
196 #endif // ELU_LAYER
aifes_core.h
AIfES 2 core interface.
ailayer_elu_forward
void ailayer_elu_forward(ailayer_t *self)
Calculate the forward pass for given ELU layer.
ailayer_elu_type
const aicore_layertype_t * ailayer_elu_type
ELU layer type.
ailayer_elu_backward
void ailayer_elu_backward(ailayer_t *self)
Calculate the backward pass for the given ELU layer.
ailayer_elu
ailayer_t * ailayer_elu(ailayer_elu_t *layer, ailayer_t *input_layer)
Initialize and connect the given ELU layer.
ailayer_elu_print_specs
void ailayer_elu_print_specs(const ailayer_t *self)
Print the layer specification.
ailayer_elu_calc_result_shape
void ailayer_elu_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
aicore_layertype
Type indicator of the layer.
Definition: aifes_core.h:82
ailayer_elu
General ELU layer struct.
Definition: ailayer_elu.h:50
ailayer_elu::d_elu
void(* d_elu)(const aitensor_t *x, const void *alpha, aitensor_t *result)
Required math function: Derivative of ELU.
Definition: ailayer_elu.h:96
ailayer_elu::multiply
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_elu.h:105
ailayer_elu::alpha_dtype
const aimath_dtype_t * alpha_dtype
Data type of scalar parameter .
Definition: ailayer_elu.h:60
ailayer_elu::alpha
void * alpha
Parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu.h:59
ailayer_elu::base
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_elu.h:51
ailayer_elu::elu
void(* elu)(const aitensor_t *x, const void *alpha, aitensor_t *result)
Required math function: ELU.
Definition: ailayer_elu.h:81
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
aimath_dtype
Indicator for the used datatype.
Definition: aifes_math.h:44
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89