| AIfES 2 2.0.0

ailayer_relu.h
Go to the documentation of this file.
1
41 #ifndef RELU_LAYER
42 #define RELU_LAYER
43
44 #include "core/aifes_core.h"
45
46 typedef struct ailayer_relu ailayer_relu_t;
47
51 struct ailayer_relu {
52 ailayer_t base;
58
69 void (*relu)(const aitensor_t *x, aitensor_t *result);
70
84 void (*d_relu)(const aitensor_t *x, aitensor_t *result);
85
93 void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
94 };
95
101 extern const aicore_layertype_t *ailayer_relu_type;
102
114 ailayer_t *ailayer_relu(ailayer_relu_t *layer, ailayer_t *input_layer);
115
136 void ailayer_relu_forward(ailayer_t *self);
137
161 void ailayer_relu_backward(ailayer_t *self);
162
172 void ailayer_relu_calc_result_shape(ailayer_t *self);
173
174 #ifdef AIDEBUG_PRINT_MODULE_SPECS
179 void ailayer_relu_print_specs(const ailayer_t *self);
180 #endif // AIDEBUG_PRINT_MODULE_SPECS
181
182 #endif // RELU_LAYER
aifes_core.h
AIfES 2 core interface.
ailayer_relu_forward
void ailayer_relu_forward(ailayer_t *self)
Calculate the forward pass for given ReLU layer.
ailayer_relu
ailayer_t * ailayer_relu(ailayer_relu_t *layer, ailayer_t *input_layer)
Initialize and connect the given ReLU layer.
ailayer_relu_type
const aicore_layertype_t * ailayer_relu_type
ReLU layer type.
ailayer_relu_backward
void ailayer_relu_backward(ailayer_t *self)
Calculate the backward pass for the given ReLU layer.
ailayer_relu_print_specs
void ailayer_relu_print_specs(const ailayer_t *self)
Print the layer specification.
ailayer_relu_calc_result_shape
void ailayer_relu_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_relu
General ReLU layer struct.
Definition: ailayer_relu.h:51
ailayer_relu::multiply
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_relu.h:93
ailayer_relu::d_relu
void(* d_relu)(const aitensor_t *x, aitensor_t *result)
Required math function: Derivative of ReLU.
Definition: ailayer_relu.h:84
ailayer_relu::relu
void(* relu)(const aitensor_t *x, aitensor_t *result)
Required math function: ReLU.
Definition: ailayer_relu.h:69
ailayer_relu::base
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_relu.h:52
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89