Skip to content

Commit 3a4d4ee

Browse files
authored
Merge pull request #118 from TensorSpeech/dev/keras
Training Models using Built-in Keras Function
2 parents 86e8c43 + e7d5112 commit 3a4d4ee

File tree

71 files changed

+1991
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1991
-84
lines changed

examples/conformer/config.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ model_config:
5252
prediction_num_rnns: 1
5353
prediction_rnn_units: 320
5454
prediction_rnn_type: lstm
55-
prediction_rnn_implementation: 1
55+
prediction_rnn_implementation: 2
5656
prediction_layer_norm: True
5757
prediction_projection_units: 0
5858
joint_dim: 320
@@ -77,7 +77,7 @@ learning_config:
7777
- /mnt/Miscellanea/Datasets/Speech/LibriSpeech/dev-other/transcripts.tsv
7878
test_paths:
7979
- /mnt/Miscellanea/Datasets/Speech/LibriSpeech/test-clean/transcripts.tsv
80-
tfrecords_dir: null
80+
tfrecords_dir: /mnt/Miscellanea/Datasets/Speech/LibriSpeech/tfrecords
8181

8282
optimizer_config:
8383
warmup_steps: 40000
@@ -93,3 +93,16 @@ learning_config:
9393
log_interval_steps: 300
9494
eval_interval_steps: 500
9595
save_interval_steps: 1000
96+
checkpoint:
97+
filepath: /mnt/Miscellanea/Models/local/conformer/checkpoints/{epoch:02d}.h5
98+
save_best_only: True
99+
save_weights_only: False
100+
save_freq: epoch
101+
states_dir: /mnt/Miscellanea/Models/local/conformer/states
102+
tensorboard:
103+
log_dir: /mnt/Miscellanea/Models/local/conformer/tensorboard
104+
histogram_freq: 1
105+
write_graph: True
106+
write_images: True
107+
update_freq: 'epoch'
108+
profile_batch: 2

examples/conformer/masking/train_ga_masking_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
from tensorflow_asr.models.conformer import Conformer
6868
from tensorflow_asr.optimizers.schedules import TransformerSchedule
6969

70-
config = Config(args.config, learning=True)
70+
config = Config(args.config)
7171
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
7272
text_featurizer = CharFeaturizer(config.decoder_config)
7373

examples/conformer/masking/train_ga_masking_subword_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from tensorflow_asr.models.conformer import Conformer
7474
from tensorflow_asr.optimizers.schedules import TransformerSchedule
7575

76-
config = Config(args.config, learning=True)
76+
config = Config(args.config)
7777
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
7878

7979
if args.subwords and os.path.exists(args.subwords):

examples/conformer/masking/train_masking_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
from tensorflow_asr.models.conformer import Conformer
6565
from tensorflow_asr.optimizers.schedules import TransformerSchedule
6666

67-
config = Config(args.config, learning=True)
67+
config = Config(args.config)
6868
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
6969
text_featurizer = CharFeaturizer(config.decoder_config)
7070

examples/conformer/masking/train_masking_subword_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
from tensorflow_asr.models.conformer import Conformer
7171
from tensorflow_asr.optimizers.schedules import TransformerSchedule
7272

73-
config = Config(args.config, learning=True)
73+
config = Config(args.config)
7474
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
7575

7676
if args.subwords and os.path.exists(args.subwords):

examples/conformer/save_conformer_from_weights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from tensorflow_asr.featurizers.text_featurizers import CharFeaturizer
5252
from tensorflow_asr.models.conformer import Conformer
5353

54-
config = Config(args.config, learning=True)
54+
config = Config(args.config)
5555
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
5656
text_featurizer = CharFeaturizer(config.decoder_config)
5757

examples/conformer/test_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
from tensorflow_asr.runners.base_runners import BaseTester
6060
from tensorflow_asr.models.conformer import Conformer
6161

62-
config = Config(args.config, learning=True)
62+
config = Config(args.config)
6363
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
6464
text_featurizer = CharFeaturizer(config.decoder_config)
6565

examples/conformer/test_subword_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
from tensorflow_asr.runners.base_runners import BaseTester
6565
from tensorflow_asr.models.conformer import Conformer
6666

67-
config = Config(args.config, learning=True)
67+
config = Config(args.config)
6868
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
6969

7070
if args.sentence_piece:

examples/conformer/tflite_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
assert args.saved and args.output
4545

46-
config = Config(args.config, learning=True)
46+
config = Config(args.config)
4747
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
4848
text_featurizer = CharFeaturizer(config.decoder_config)
4949

examples/conformer/tflite_subword_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
assert args.saved and args.output
4848

49-
config = Config(args.config, learning=True)
49+
config = Config(args.config)
5050
speech_featurizer = TFSpeechFeaturizer(config.speech_config)
5151

5252
if args.subwords and os.path.exists(args.subwords):

0 commit comments

Comments
 (0)