majianjia / nnom

A higher-level Neural Network library for microcontrollers.
Apache License 2.0
815 stars 234 forks source link

RNN state makes model output tend towards 0 #223

Open Tom2096 opened 2 days ago

Tom2096 commented 2 days ago

Hi,

I have been following the examples in RNN-Denoise. However, when testing the quantized model, I noticed that the quantized output tends very fast towards zero:

image

Resetting the states of each RNN layer after each prediction makes the output more reasonable but does not give good noise reduction result:

image

Is there something I am missing? Note that the model used is the one provided in the repo and rest of the code is identical to the examples in RNN-Denoise. Thanks!

Tom2096 commented 2 days ago

Note that the model works well in python keras with stateful=True. The input to the above screenshot is one of the noised audio samples from the training dataset, and is preprocessed with the same methods listed in the repo.