From 3326c6d37f4f997792df8462b3ea0a3c8ffe355c Mon Sep 17 00:00:00 2001 From: Jingyong Hou Date: Thu, 11 Nov 2021 09:30:37 +0800 Subject: [PATCH] formatting --- examples/hi_xiaowen/s0/conf/mdtc.yaml | 12 ------------ kws/bin/train.py | 6 +++--- kws/model/loss.py | 1 - kws/model/mdtc.py | 2 -- kws/model/tcn.py | 2 +- 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/examples/hi_xiaowen/s0/conf/mdtc.yaml b/examples/hi_xiaowen/s0/conf/mdtc.yaml index 8f0bcc1..b82400b 100644 --- a/examples/hi_xiaowen/s0/conf/mdtc.yaml +++ b/examples/hi_xiaowen/s0/conf/mdtc.yaml @@ -1,15 +1,10 @@ - - dataset_conf: filter_conf: max_length: 2048 min_length: 0 - resample_conf: resample_rate: 16000 - speed_perturb: false - feature_extraction_conf: feature_type: 'mfcc' num_ceps: 80 @@ -17,17 +12,13 @@ dataset_conf: frame_shift: 10 frame_length: 25 dither: 1.0 - feature_dither: 0.0 - spec_aug: true spec_aug_conf: - #warp_for_time: false num_t_mask: 1 num_f_mask: 1 max_t: 20 max_f: 40 - shuffle: true shuffle_conf: shuffle_size: 1500 @@ -35,8 +26,6 @@ dataset_conf: batch_size: 100 model: - input_dim: 80 - output_dim: 2 hidden_dim: 64 preprocessing: type: none @@ -50,7 +39,6 @@ model: optim: adam optim_conf: lr: 0.001 - #warmup_step: 2000 training_config: grad_clip: 5 diff --git a/kws/bin/train.py b/kws/bin/train.py index 00c367b..915f176 100644 --- a/kws/bin/train.py +++ b/kws/bin/train.py @@ -161,9 +161,9 @@ def main(): # !!!IMPORTANT!!! # Try to export the model by script, if fails, we should refine # the code to satisfy the script export requirements - #if args.rank == 0: - #script_model = torch.jit.script(model) - #script_model.save(os.path.join(args.model_dir, 'init.zip')) + # if args.rank == 0: + # script_model = torch.jit.script(model) + # script_model.save(os.path.join(args.model_dir, 'init.zip')) executor = Executor() # If specify checkpoint, load some info from checkpoint if args.checkpoint is not None: diff --git a/kws/model/loss.py b/kws/model/loss.py index e871ef1..bd34951 100644 --- a/kws/model/loss.py +++ b/kws/model/loss.py @@ -13,7 +13,6 @@ # limitations under the License. import torch -import torch.nn.functional as F from kws.utils.mask import padding_mask diff --git a/kws/model/mdtc.py b/kws/model/mdtc.py index 765c417..4ba1e75 100644 --- a/kws/model/mdtc.py +++ b/kws/model/mdtc.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np - import torch import torch.nn as nn import torch.nn.functional as F diff --git a/kws/model/tcn.py b/kws/model/tcn.py index 7dffa5b..6a002b1 100644 --- a/kws/model/tcn.py +++ b/kws/model/tcn.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Optional +from typing import Optional import torch import torch.nn as nn