AIfES 2  2.0.0
ailayer_relu.h
Go to the documentation of this file.
1 
44 #ifndef RELU_LAYER
45 #define RELU_LAYER
46 
47 #include "core/aifes_core.h"
48 
49 typedef struct ailayer_relu ailayer_relu_t;
50 
54 struct ailayer_relu {
62 
73  void (*relu)(const aitensor_t *x, aitensor_t *result);
74 
88  void (*d_relu)(const aitensor_t *x, aitensor_t *result);
89 
97  void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
98 };
99 
106 
119 
141 
166 
177 
178 #ifdef AIDEBUG_PRINT_MODULE_SPECS
184 void ailayer_relu_print_specs(const ailayer_t *self, int (*print)(const char *format, ...));
185 #endif // AIDEBUG_PRINT_MODULE_SPECS
186 
187 #endif // RELU_LAYER
AIfES 2 core interface.
void ailayer_relu_print_specs(const ailayer_t *self, int(*print)(const char *format,...))
Print the layer specification.
void ailayer_relu_forward(ailayer_t *self)
Calculate the forward pass for given ReLU layer.
ailayer_t * ailayer_relu(ailayer_relu_t *layer, ailayer_t *input_layer)
Initialize and connect the given ReLU layer.
const aicore_layertype_t * ailayer_relu_type
ReLU layer type.
void ailayer_relu_backward(ailayer_t *self)
Calculate the backward pass for the given ReLU layer.
void ailayer_relu_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
Type indicator of the layer.
Definition: aifes_core.h:81
General ReLU layer struct.
Definition: ailayer_relu.h:54
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_relu.h:97
void(* d_relu)(const aitensor_t *x, aitensor_t *result)
Required math function: Derivative of ReLU.
Definition: ailayer_relu.h:88
void(* relu)(const aitensor_t *x, aitensor_t *result)
Required math function: ReLU.
Definition: ailayer_relu.h:73
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_relu.h:55
const aimath_dtype_t * dtype
Data type of the input and inference result values.
Definition: ailayer_relu.h:56
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