AIfES 2  2.0.0
ailayer_elu.h
Go to the documentation of this file.
1 
43 #ifndef ELU_LAYER
44 #define ELU_LAYER
45 
46 #include "core/aifes_core.h"
47 
48 typedef struct ailayer_elu ailayer_elu_t;
49 
53 struct ailayer_elu {
63  void *alpha;
65 
70 
84  void (*elu)(const aitensor_t *x, const void *alpha, aitensor_t *result);
85 
99  void (*d_elu)(const aitensor_t *x, const void *alpha, aitensor_t *result);
100 
108  void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
109 
111 };
112 
119 
132 
154 
179 
190 
191 #ifdef AIDEBUG_PRINT_MODULE_SPECS
197 void ailayer_elu_print_specs(const ailayer_t *self, int (*print)(const char *format, ...));
198 #endif // AIDEBUG_PRINT_MODULE_SPECS
199 
200 #endif // ELU_LAYER
AIfES 2 core interface.
void ailayer_elu_forward(ailayer_t *self)
Calculate the forward pass for given ELU layer.
const aicore_layertype_t * ailayer_elu_type
ELU layer type.
void ailayer_elu_backward(ailayer_t *self)
Calculate the backward pass for the given ELU layer.
void ailayer_elu_print_specs(const ailayer_t *self, int(*print)(const char *format,...))
Print the layer specification.
ailayer_t * ailayer_elu(ailayer_elu_t *layer, ailayer_t *input_layer)
Initialize and connect the given ELU layer.
void ailayer_elu_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
Type indicator of the layer.
Definition: aifes_core.h:81
General ELU layer struct.
Definition: ailayer_elu.h:53
void(* d_elu)(const aitensor_t *x, const void *alpha, aitensor_t *result)
Required math function: Derivative of ELU.
Definition: ailayer_elu.h:99
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_elu.h:108
void * alpha
Parameter used to calculate ELU function for input values < 0.
Definition: ailayer_elu.h:63
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_elu.h:54
const aimath_dtype_t * dtype
Data type of the input and inference result values.
Definition: ailayer_elu.h:55
void(* elu)(const aitensor_t *x, const void *alpha, aitensor_t *result)
Required math function: ELU.
Definition: ailayer_elu.h:84
AIfES layer interface.
Definition: aifes_core.h:251
Indicator for the used datatype.
Definition: aifes_math.h:53
A tensor in AIfES.
Definition: aifes_math.h:98