| AIfES 2 2.0.0

ailayer_softsign.h
Go to the documentation of this file.
1
38 #ifndef SOFTSIGN_LAYER
39 #define SOFTSIGN_LAYER
40
41 #include "core/aifes_core.h"
42
43 typedef struct ailayer_softsign ailayer_softsign_t;
44
48 struct ailayer_softsign {
49 ailayer_t base;
55
66 void (*softsign)(const aitensor_t *x, aitensor_t *result);
67
78 void (*d_softsign)(const aitensor_t *softsign_x, aitensor_t *result);
79
87 void (*multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result);
88
90 };
91
97 extern const aicore_layertype_t *ailayer_softsign_type;
98
110 ailayer_t *ailayer_softsign(ailayer_softsign_t *layer, ailayer_t *input_layer);
111
132 void ailayer_softsign_forward(ailayer_t *self);
133
157 void ailayer_softsign_backward(ailayer_t *self);
158
168 void ailayer_softsign_calc_result_shape(ailayer_t *self);
169
170 #ifdef AIDEBUG_PRINT_MODULE_SPECS
175 void ailayer_softsign_print_specs(const ailayer_t *self);
176 #endif // AIDEBUG_PRINT_MODULE_SPECS
177
178 #endif // SOFTSIGN_LAYER
aifes_core.h
AIfES 2 core interface.
ailayer_softsign
ailayer_t * ailayer_softsign(ailayer_softsign_t *layer, ailayer_t *input_layer)
Initialize and connect the given Softsign layer.
ailayer_softsign_backward
void ailayer_softsign_backward(ailayer_t *self)
Calculate the backward pass for the given Softsign layer.
ailayer_softsign_type
const aicore_layertype_t * ailayer_softsign_type
Softsign layer type.
ailayer_softsign_forward
void ailayer_softsign_forward(ailayer_t *self)
Calculate the forward pass for given Tanh layer.
ailayer_softsign_calc_result_shape
void ailayer_softsign_calc_result_shape(ailayer_t *self)
Calculate the shape of the result tensor.
ailayer_softsign_print_specs
void ailayer_softsign_print_specs(const ailayer_t *self)
Print the layer specification.
aicore_layertype
Type indicator of the layer.
Definition: aifes_core.h:82
ailayer_softsign
General Softsign layer struct.
Definition: ailayer_softsign.h:48
ailayer_softsign::multiply
void(* multiply)(const aitensor_t *a, const aitensor_t *b, aitensor_t *result)
Required math function: Element wise tensor multiplication.
Definition: ailayer_softsign.h:87
ailayer_softsign::d_softsign
void(* d_softsign)(const aitensor_t *softsign_x, aitensor_t *result)
Required math function: Derivative of softsign.
Definition: ailayer_softsign.h:78
ailayer_softsign::softsign
void(* softsign)(const aitensor_t *x, aitensor_t *result)
Required math function: Softsign.
Definition: ailayer_softsign.h:66
ailayer_softsign::base
ailayer_t base
Inherited field members from general ailayer struct.
Definition: ailayer_softsign.h:49
ailayer
AIfES layer interface.
Definition: aifes_core.h:252
aitensor
A tensor in AIfES.
Definition: aifes_math.h:89