// // Created by xiangzhou on 11/9/23. // #pragma once #include "C_Tensor.h" #ifdef __cplusplus extern "C" { #endif //---------------------------------------------------------------------------- // RNN //------------------------------------------------------------------------ struct RNNAttribute { // user const char* name_; const char *direction_; // direction of RNN int num_activations_; // 2 or 4; float activation_alpha_[4]; // scaling for activations float activation_beta_[4]; // scaling for activations const char* activations_[4]; // activation functions int linear_before_reset_;// = 0; // flag to apply transformation before reset int input_forget_;// = 0; // flag to couple input and forget gate int hidden_size_; // number of hidden neurons float clip_;// = 0.0; // bounds }; typedef struct RNNAttribute GRUAttribute; typedef struct RNNAttribute LSTMAttribute; CREATE_DECL_RUN_FUN(GRU) CREATE_DECL_RUN_FUN(LSTM) #ifdef __cplusplus } #endif