rnnoise icon indicating copy to clipboard operation
rnnoise copied to clipboard

How to convert the model to rnnoise_data_little.c

Open AotYan opened this issue 1 year ago • 6 comments

Firstly, thank you for updating the rnnoise, Now I can convert the model to rnnoise_data.c by using dump_rnnoise_weights.py, I want to konw how to convert the model to rnnoise_data_little.c

AotYan avatar Aug 16 '24 01:08 AotYan

It's the same conversion. It's just that the "little" models were trained with sparsification (which isn't yet well documented, sorry)

jmvalin avatar Aug 19 '24 05:08 jmvalin

@AotYan please see my comment in #246

BancoLin avatar Dec 30 '24 02:12 BancoLin

@BancoLin thank you for your advice, I have another question, in my train script the sparsify_start ,sparsify_stop , sparsify_interval, and sparsify_exponent remain unchanged, while the epochs are 200 and each epoch takes 12500 steps, when i dump the checkpoint file rnnoise_2.pth into the rnnoise_data_little.c, the array length is not the same as writer provided, for example: the length of gru1_input_weights_float i got is 147456,

static const float gru1_input_weights_float[147456]

while in write's file, is:

static const float gru1_input_weights_float[58976]

how can i reduce the length?

AotYan avatar Jun 27 '25 07:06 AotYan

@BancoLin thank you for your advice, I have another question, in my train script the sparsify_start ,sparsify_stop , sparsify_interval, and sparsify_exponent remain unchanged, while the epochs are 200 and each epoch takes 12500 steps, when i dump the checkpoint file rnnoise_2.pth into the rnnoise_data_little.c, the array length is not the same as writer provided, for example: the length of gru1_input_weights_float i got is 147456,

static const float gru1_input_weights_float[147456]

while in write's file, is:

static const float gru1_input_weights_float[58976]

how can i reduce the length?

Did you dump the last checkpoint file to check the length? Dumping rnnoise_2.pth seems too early, the model hasn't been sparsified yet.

BancoLin avatar Jun 30 '25 05:06 BancoLin

@BancoLin rnnoise_200.pth is the same length as rnnoise_2.pth

AotYan avatar Jun 30 '25 05:06 AotYan

The number of weights in gru1_input_weights_float should be equal to 3densitynb_inputs*nb_outputs.

jmvalin avatar Jul 06 '25 02:07 jmvalin