| AIfES 2 2.0.0

ailayer_tanh.h
Go to the documentation of this file.
1
37 #ifndef TANH_LAYER
38 #define TANH_LAYER
39
40 #include "core/aifes_core.h"
41
42 typedef struct ailayer_tanh ailayer_tanh_t;
43
47 struct ailayer_tanh {
48 ailayer_t base;
54
65 void (*tanh)(const aitensor_t *x, aitensor_t *result);
66
77 void (*d_tanh)(const aitensor_t *tanh_x, aitensor_t *result);
78
86 void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
87
89 };
90
96 extern const aicore_layertype_t *ailayer_tanh_type;
97
109 ailayer_t *ailayer_tanh(ailayer_tanh_t *layer, ailayer_t *input_layer);
110
131 void ailayer_tanh_forward(ailayer_t *self);
132
156 void ailayer_tanh_backward(ailayer_t *self);
157
167 void ailayer_tanh_calc_result_shape(ailayer_t *self);
168
169 #ifdef AIDEBUG_PRINT_MODULE_SPECS
174 void ailayer_tanh_print_specs(const ailayer_t *self);
175 #endif // AIDEBUG_PRINT_MODULE_SPECS
176
177 #endif // TANH_LAYER
aifes_core.h
AIfES 2 core interface.
ailayer_tanh_type
const aicore_layertype_t * ailayer_tanh_type
Tanh layer type.
ailayer_tanh
ailayer_t * ailayer_tanh(ailayer_tanh_t *layer, ailayer_t *input_layer)
Initialize and connect the given Tanh layer.
ailayer_tanh_forward
void ailayer_tanh_forward(ailayer_t *self)
Calculate the forward pass for given Tanh layer.
ailayer_tanh_backward
void ailayer_tanh_backward(ailayer_t *self)
Calculate the backward pass for the given Tanh layer.
ailayer_tanh_calc_result_shape
void ailayer_tanh_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
ailayer_tanh_print_specs
void ailayer_tanh_print_specs(const ailayer_t *self)
Print the layer specification.
aicore_layertype
Type indicator of the layer.
Definition: aifes_core.h:82
ailayer_tanh
General Tanh layer struct.
Definition: ailayer_tanh.h:47
ailayer_tanh::tanh
void(* tanh)(const aitensor_t *x, aitensor_t *result)
Required math function: Tanh.
Definition: ailayer_tanh.h:65
ailayer_tanh::d_tanh
void(* d_tanh)(const aitensor_t *tanh_x, aitensor_t *result)
Required math function: Derivative of tanh.
Definition: ailayer_tanh.h:77
ailayer_tanh::multiply
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_tanh.h:86
ailayer_tanh::base
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_tanh.h:48
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89