Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2023-10-19 23:06:52 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2023-10-19 23:06:52 +0300
commitd720955d617768aea7271076f3993e6263e8b84f (patch)
treec4913ab3d130c494f684197df7ae77d6a2abcacd
parent60ac1c6c99153a8ee5ba3e6f9f8fdd1bd3f54dc6 (diff)
Marking RDOVAE layers to quantize
-rw-r--r--dnn/torch/rdovae/export_rdovae_weights.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/dnn/torch/rdovae/export_rdovae_weights.py b/dnn/torch/rdovae/export_rdovae_weights.py
index fc31e41d..856ec93e 100644
--- a/dnn/torch/rdovae/export_rdovae_weights.py
+++ b/dnn/torch/rdovae/export_rdovae_weights.py
@@ -116,9 +116,9 @@ f"""
# encoder
encoder_dense_layers = [
('core_encoder.module.dense_1' , 'enc_dense1', 'TANH', False,),
- ('core_encoder.module.z_dense' , 'enc_zdense', 'LINEAR', False,),
- ('core_encoder.module.state_dense_1' , 'gdense1' , 'TANH', False,),
- ('core_encoder.module.state_dense_2' , 'gdense2' , 'TANH', False)
+ ('core_encoder.module.z_dense' , 'enc_zdense', 'LINEAR', True,),
+ ('core_encoder.module.state_dense_1' , 'gdense1' , 'TANH', True,),
+ ('core_encoder.module.state_dense_2' , 'gdense2' , 'TANH', True)
]
for name, export_name, _, _ in encoder_dense_layers:
@@ -127,11 +127,11 @@ f"""
encoder_gru_layers = [
- ('core_encoder.module.gru1' , 'enc_gru1', 'TANH', False),
- ('core_encoder.module.gru2' , 'enc_gru2', 'TANH', False),
- ('core_encoder.module.gru3' , 'enc_gru3', 'TANH', False),
- ('core_encoder.module.gru4' , 'enc_gru4', 'TANH', False),
- ('core_encoder.module.gru5' , 'enc_gru5', 'TANH', False),
+ ('core_encoder.module.gru1' , 'enc_gru1', 'TANH', True),
+ ('core_encoder.module.gru2' , 'enc_gru2', 'TANH', True),
+ ('core_encoder.module.gru3' , 'enc_gru3', 'TANH', True),
+ ('core_encoder.module.gru4' , 'enc_gru4', 'TANH', True),
+ ('core_encoder.module.gru5' , 'enc_gru5', 'TANH', True),
]
enc_max_rnn_units = max([dump_torch_weights(enc_writer, model.get_submodule(name), export_name, verbose=True, input_sparse=True, quantize=True)
@@ -139,11 +139,11 @@ f"""
encoder_conv_layers = [
- ('core_encoder.module.conv1.conv' , 'enc_conv1', 'TANH', False),
- ('core_encoder.module.conv2.conv' , 'enc_conv2', 'TANH', False),
- ('core_encoder.module.conv3.conv' , 'enc_conv3', 'TANH', False),
- ('core_encoder.module.conv4.conv' , 'enc_conv4', 'TANH', False),
- ('core_encoder.module.conv5.conv' , 'enc_conv5', 'TANH', False),
+ ('core_encoder.module.conv1.conv' , 'enc_conv1', 'TANH', True),
+ ('core_encoder.module.conv2.conv' , 'enc_conv2', 'TANH', True),
+ ('core_encoder.module.conv3.conv' , 'enc_conv3', 'TANH', True),
+ ('core_encoder.module.conv4.conv' , 'enc_conv4', 'TANH', True),
+ ('core_encoder.module.conv5.conv' , 'enc_conv5', 'TANH', True),
]
enc_max_conv_inputs = max([dump_torch_weights(enc_writer, model.get_submodule(name), export_name, verbose=True, quantize=False) for name, export_name, _, _ in encoder_conv_layers])
@@ -154,9 +154,9 @@ f"""
# decoder
decoder_dense_layers = [
('core_decoder.module.dense_1' , 'dec_dense1', 'TANH', False),
- ('core_decoder.module.output' , 'dec_output', 'LINEAR', False),
+ ('core_decoder.module.output' , 'dec_output', 'LINEAR', True),
('core_decoder.module.hidden_init' , 'dec_hidden_init', 'TANH', False),
- ('core_decoder.module.gru_init' , 'dec_gru_init', 'TANH', False),
+ ('core_decoder.module.gru_init' , 'dec_gru_init', 'TANH', True),
]
for name, export_name, _, _ in decoder_dense_layers:
@@ -165,22 +165,22 @@ f"""
decoder_gru_layers = [
- ('core_decoder.module.gru1' , 'dec_gru1', 'TANH', False),
- ('core_decoder.module.gru2' , 'dec_gru2', 'TANH', False),
- ('core_decoder.module.gru3' , 'dec_gru3', 'TANH', False),
- ('core_decoder.module.gru4' , 'dec_gru4', 'TANH', False),
- ('core_decoder.module.gru5' , 'dec_gru5', 'TANH', False),
+ ('core_decoder.module.gru1' , 'dec_gru1', 'TANH', True),
+ ('core_decoder.module.gru2' , 'dec_gru2', 'TANH', True),
+ ('core_decoder.module.gru3' , 'dec_gru3', 'TANH', True),
+ ('core_decoder.module.gru4' , 'dec_gru4', 'TANH', True),
+ ('core_decoder.module.gru5' , 'dec_gru5', 'TANH', True),
]
dec_max_rnn_units = max([dump_torch_weights(dec_writer, model.get_submodule(name), export_name, verbose=True, input_sparse=True, quantize=True)
for name, export_name, _, _ in decoder_gru_layers])
decoder_conv_layers = [
- ('core_decoder.module.conv1.conv' , 'dec_conv1', 'TANH', False),
- ('core_decoder.module.conv2.conv' , 'dec_conv2', 'TANH', False),
- ('core_decoder.module.conv3.conv' , 'dec_conv3', 'TANH', False),
- ('core_decoder.module.conv4.conv' , 'dec_conv4', 'TANH', False),
- ('core_decoder.module.conv5.conv' , 'dec_conv5', 'TANH', False),
+ ('core_decoder.module.conv1.conv' , 'dec_conv1', 'TANH', True),
+ ('core_decoder.module.conv2.conv' , 'dec_conv2', 'TANH', True),
+ ('core_decoder.module.conv3.conv' , 'dec_conv3', 'TANH', True),
+ ('core_decoder.module.conv4.conv' , 'dec_conv4', 'TANH', True),
+ ('core_decoder.module.conv5.conv' , 'dec_conv5', 'TANH', True),
]
dec_max_conv_inputs = max([dump_torch_weights(dec_writer, model.get_submodule(name), export_name, verbose=True, quantize=False) for name, export_name, _, _ in decoder_conv_layers])