1 #ifndef THIRD_PARTY_RNNOISE_SRC_RNN_VAD_WEIGHTS_H_ 2 #define THIRD_PARTY_RNNOISE_SRC_RNN_VAD_WEIGHTS_H_ 3 4 #include <cstdint> 5 #include <cstring> 6 7 namespace rnnoise { 8 9 // Weights scaling factor. 10 const float kWeightsScale = 1.f / 256.f; 11 12 // Input layer (dense). 13 const size_t kInputLayerInputSize = 42; 14 const size_t kInputLayerOutputSize = 24; 15 const size_t kInputLayerWeights = kInputLayerInputSize * kInputLayerOutputSize; 16 extern const int8_t kInputDenseWeights[kInputLayerWeights]; 17 extern const int8_t kInputDenseBias[kInputLayerOutputSize]; 18 19 // Hidden layer (GRU). 20 const size_t kHiddenLayerOutputSize = 24; 21 const size_t kHiddenLayerWeights = 22 3 * kInputLayerOutputSize * kHiddenLayerOutputSize; 23 const size_t kHiddenLayerBiases = 3 * kHiddenLayerOutputSize; 24 extern const int8_t kHiddenGruWeights[kHiddenLayerWeights]; 25 extern const int8_t kHiddenGruRecurrentWeights[kHiddenLayerWeights]; 26 extern const int8_t kHiddenGruBias[kHiddenLayerBiases]; 27 28 // Output layer (dense). 29 const size_t kOutputLayerOutputSize = 1; 30 const size_t kOutputLayerWeights = 31 kHiddenLayerOutputSize * kOutputLayerOutputSize; 32 extern const int8_t kOutputDenseWeights[kOutputLayerWeights]; 33 extern const int8_t kOutputDenseBias[kOutputLayerOutputSize]; 34 35 } // namespace rnnoise 36 37 #endif // THIRD_PARTY_RNNOISE_SRC_RNN_VAD_WEIGHTS_H_ 38