Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNN state makes model output tend towards 0 #223

Open
Tom2096 opened this issue Jul 3, 2024 · 2 comments
Open

RNN state makes model output tend towards 0 #223

Tom2096 opened this issue Jul 3, 2024 · 2 comments

Comments

@Tom2096
Copy link

Tom2096 commented Jul 3, 2024

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
Copy link
Author

Tom2096 commented Jul 3, 2024

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.

@majianjia
Copy link
Owner

Hi @Tom2096
Since the training isn't quantization-aware, it's possible that the weights distribution might become extreme. Keras should perform well in this scenario because it uses floating point representations. However, after quantization, there is a loss of weight resolution. Try stopping the training after a very short period, maybe just 1 or 2 epochs, to see if there's an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants