Fix for style check

This commit is contained in:
Yifan Yang 2023-03-08 11:17:21 +08:00
parent fcd60160be
commit 322f954aa4
6 changed files with 38 additions and 26 deletions

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_0.85_hard_1.py \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_hard_1.py \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_0.85_hard_1.py \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_hard_1.py \
--full-libri 1 \
--max-duration 750
"""
@ -697,7 +697,9 @@ def compute_loss(
)
# Works with a BPE model
decoding_graph = k2.fast_ctc_graph(token_ids, modified=False, device=device, max_repeat=1)
decoding_graph = k2.fast_ctc_graph(
token_ids, modified=False, device=device, max_repeat=1
)
dense_fsa_vec = k2.DenseFsaVec(
ctc_output,
supervision_segments,

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_0.85_hard_2.py \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_hard_2.py \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_0.85_hard_2.py \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_hard_2.py \
--full-libri 1 \
--max-duration 750
"""
@ -697,7 +697,9 @@ def compute_loss(
)
# Works with a BPE model
decoding_graph = k2.fast_ctc_graph(token_ids, modified=False, device=device, max_repeat=2)
decoding_graph = k2.fast_ctc_graph(
token_ids, modified=False, device=device, max_repeat=2
)
dense_fsa_vec = k2.DenseFsaVec(
ctc_output,
supervision_segments,

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.03 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.03 \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.03 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.03 \
--full-libri 1 \
--max-duration 750
"""
@ -705,10 +705,12 @@ def compute_loss(
)
# non-blank arcs self-loop penalty
all_self_blanks_idx = decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
all_self_blanks_idx = (
decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
)
blank_self_loops_idx = decoding_graph.arcs.values()[:, 2] == 0
decoding_graph.scores[all_self_blanks_idx] = -0.03
decoding_graph.scores[blank_self_loops_idx] = 0.0
decoding_graph.scores[all_self_blanks_idx] = -0.03
decoding_graph.scores[blank_self_loops_idx] = 0.0
ctc_loss = k2.ctc_loss(
decoding_graph=decoding_graph,

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.04 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.04 \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.04 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.04 \
--full-libri 1 \
--max-duration 750
"""
@ -705,10 +705,12 @@ def compute_loss(
)
# non-blank arcs self-loop penalty
all_self_blanks_idx = decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
all_self_blanks_idx = (
decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
)
blank_self_loops_idx = decoding_graph.arcs.values()[:, 2] == 0
decoding_graph.scores[all_self_blanks_idx] = -0.04
decoding_graph.scores[blank_self_loops_idx] = 0.0
decoding_graph.scores[all_self_blanks_idx] = -0.04
decoding_graph.scores[blank_self_loops_idx] = 0.0
ctc_loss = k2.ctc_loss(
decoding_graph=decoding_graph,

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.05 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.05 \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_0.05 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_0.05 \
--full-libri 1 \
--max-duration 750
"""
@ -705,10 +705,12 @@ def compute_loss(
)
# non-blank arcs self-loop penalty
all_self_blanks_idx = decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
all_self_blanks_idx = (
decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
)
blank_self_loops_idx = decoding_graph.arcs.values()[:, 2] == 0
decoding_graph.scores[all_self_blanks_idx] = -0.05
decoding_graph.scores[blank_self_loops_idx] = 0.0
decoding_graph.scores[all_self_blanks_idx] = -0.05
decoding_graph.scores[blank_self_loops_idx] = 0.0
ctc_loss = k2.ctc_loss(
decoding_graph=decoding_graph,

View File

@ -27,7 +27,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--world-size 4 \
--num-epochs 40 \
--start-epoch 21 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_5 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_5 \
--full-libri 1 \
--max-duration 300
@ -38,7 +38,7 @@ export CUDA_VISIBLE_DEVICES="0,1,2,3"
--num-epochs 40 \
--start-epoch 21 \
--use-fp16 1 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_soft_5 \
--exp-dir pruned_transducer_stateless4_ctc_bs_withoutlconv/exp_960_21to40_soft_5 \
--full-libri 1 \
--max-duration 750
"""
@ -705,10 +705,12 @@ def compute_loss(
)
# non-blank arcs self-loop penalty
all_self_blanks_idx = decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
all_self_blanks_idx = (
decoding_graph.arcs.values()[:, 0] == decoding_graph.arcs.values()[:, 1]
)
blank_self_loops_idx = decoding_graph.arcs.values()[:, 2] == 0
decoding_graph.scores[all_self_blanks_idx] = -5.00
decoding_graph.scores[blank_self_loops_idx] = 0.0
decoding_graph.scores[all_self_blanks_idx] = -5.00
decoding_graph.scores[blank_self_loops_idx] = 0.0
ctc_loss = k2.ctc_loss(
decoding_graph=decoding_graph,