From 895a086fdd02e6727789e146152631263abc25dc Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Mon, 29 Nov 2021 08:17:59 +0000 Subject: [PATCH] rename the config.feat_size and the config.vocab.size to input_size and output_size --- examples/librispeech/asr1/RESULTS.md | 2 +- paddlespeech/s2t/exps/deepspeech2/bin/test_hub.py | 4 ++-- paddlespeech/s2t/exps/deepspeech2/model.py | 8 ++++---- paddlespeech/s2t/models/ds2/deepspeech2.py | 4 ++-- paddlespeech/s2t/models/ds2_online/deepspeech2.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/librispeech/asr1/RESULTS.md b/examples/librispeech/asr1/RESULTS.md index 19300ade..3dad7acb 100644 --- a/examples/librispeech/asr1/RESULTS.md +++ b/examples/librispeech/asr1/RESULTS.md @@ -24,4 +24,4 @@ | transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention | 6.725063021977743 | 0.047417 | | transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_greedy_search | 6.725063021977743 | 0.053922 | | transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_prefix_beam_search | 6.725063021977743 | 0.053180 | -| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.725063021977743 | 0.041026 | \ No newline at end of file +| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.725063021977743 | 0.041026 | diff --git a/paddlespeech/s2t/exps/deepspeech2/bin/test_hub.py b/paddlespeech/s2t/exps/deepspeech2/bin/test_hub.py index 831bd1ad..b8544dc2 100644 --- a/paddlespeech/s2t/exps/deepspeech2/bin/test_hub.py +++ b/paddlespeech/s2t/exps/deepspeech2/bin/test_hub.py @@ -110,8 +110,8 @@ class DeepSpeech2Tester_hub(): def setup_model(self): config = self.config.clone() with UpdateConfig(config): - config.model.feat_size = self.collate_fn_test.feature_size - config.model.dict_size = self.collate_fn_test.vocab_size + config.model.input_dim = self.collate_fn_test.feature_size + config.model.output_dim = self.collate_fn_test.vocab_size if self.args.model_type == 'offline': model = DeepSpeech2Model.from_config(config.model) diff --git a/paddlespeech/s2t/exps/deepspeech2/model.py b/paddlespeech/s2t/exps/deepspeech2/model.py index e827414d..3e4ff1a8 100644 --- a/paddlespeech/s2t/exps/deepspeech2/model.py +++ b/paddlespeech/s2t/exps/deepspeech2/model.py @@ -154,11 +154,11 @@ class DeepSpeech2Trainer(Trainer): config = self.config.clone() with UpdateConfig(config): if self.train: - config.model.feat_size = self.train_loader.collate_fn.feature_size - config.model.dict_size = self.train_loader.collate_fn.vocab_size + config.model.input_dim = self.train_loader.collate_fn.feature_size + config.model.output_dim = self.train_loader.collate_fn.vocab_size else: - config.model.feat_size = self.test_loader.collate_fn.feature_size - config.model.dict_size = self.test_loader.collate_fn.vocab_size + config.model.input_dim = self.test_loader.collate_fn.feature_size + config.model.output_dim = self.test_loader.collate_fn.vocab_size if self.args.model_type == 'offline': model = DeepSpeech2Model.from_config(config.model) diff --git a/paddlespeech/s2t/models/ds2/deepspeech2.py b/paddlespeech/s2t/models/ds2/deepspeech2.py index 4a7a7c15..317abc69 100644 --- a/paddlespeech/s2t/models/ds2/deepspeech2.py +++ b/paddlespeech/s2t/models/ds2/deepspeech2.py @@ -249,8 +249,8 @@ class DeepSpeech2Model(nn.Layer): The model built from config. """ model = cls( - feat_size=config.feat_size, - dict_size=config.dict_size, + feat_size=config.input_dim, + dict_size=config.output_dim, num_conv_layers=config.num_conv_layers, num_rnn_layers=config.num_rnn_layers, rnn_size=config.rnn_layer_size, diff --git a/paddlespeech/s2t/models/ds2_online/deepspeech2.py b/paddlespeech/s2t/models/ds2_online/deepspeech2.py index da04d5c5..d134239f 100644 --- a/paddlespeech/s2t/models/ds2_online/deepspeech2.py +++ b/paddlespeech/s2t/models/ds2_online/deepspeech2.py @@ -381,8 +381,8 @@ class DeepSpeech2ModelOnline(nn.Layer): The model built from config. """ model = cls( - feat_size=config.feat_size, - dict_size=config.dict_size, + feat_size=config.input_dim, + dict_size=config.output_dim, num_conv_layers=config.num_conv_layers, num_rnn_layers=config.num_rnn_layers, rnn_size=config.rnn_layer_size,