Skip to content

Commit 4f9167c

Browse files
Srikanth MADIKERIqindazhu
authored andcommitted
wsj/s5/steps/nnet3/chain2/train.sh: out-of-range regularize added as an option. reading cache starts from 1st iteration.
1 parent 6d25e94 commit 4f9167c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

egs/wsj/s5/steps/nnet3/chain2/train.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ shuffle_buffer_size=1000 # This "buffer_size" variable controls randomization o
5050

5151

5252
l2_regularize=
53+
out_of_range_regularize=0.01
5354
multilingual_eg=false
5455

5556
# End configuration section
@@ -183,16 +184,17 @@ while [ $x -lt $num_iters ]; do
183184
nnet3-chain-train2 --use-gpu=$use_gpu \
184185
--leaky-hmm-coefficient=$leaky_hmm_coefficient \
185186
--xent-regularize=$xent_regularize \
187+
--out-of-range-regularize=$out_of_range_regularize \
186188
$l2_regularize_opt \
187189
--print-interval=10 \
188190
"nnet3-am-init $dir/0_trans.mdl $dir/${x}.raw - | nnet3-am-copy --learning-rate=$lrate - - |" $den_fst_dir \
189-
"ark:nnet3-chain-copy-egs $egs_opts scp:$egs_dir/${name}_subset.scp ark:- | nnet3-chain-merge-egs $multilingual_eg_opts --minibatch-size=$groups_per_minibatch ark:- ark:-|" \
191+
"ark:nnet3-chain-copy-egs $egs_opts scp:$egs_dir/${name}_subset.scp ark:- | nnet3-chain-merge-egs $multilingual_eg_opts --minibatch-size=1:64 ark:- ark:-|" \
190192
$dir/${next_x}_${name}.mdl || touch $dir/.error_diagnostic &
191193
done
192194
fi
193195

194196
cache_io_opt="--write-cache=$dir/cache.$next_x"
195-
if [ $x -gt 1 -a -f $dir/cache.$x ]; then
197+
if [ $x -gt 0 -a -f $dir/cache.$x ]; then
196198
cache_io_opt="$cache_io_opt --read-cache=$dir/cache.$x"
197199
fi
198200
for j in $(seq $num_jobs); do
@@ -207,6 +209,7 @@ while [ $x -lt $num_iters ]; do
207209
$cmd $gpu_cmd_opt $dir/log/train.$x.$j.log \
208210
nnet3-chain-train2 \
209211
$parallel_train_opts $verbose_opt \
212+
--out-of-range-regularize=$out_of_range_regularize \
210213
$cache_io_opt \
211214
--use-gpu=$use_gpu --apply-deriv-weights=$apply_deriv_weights \
212215
--leaky-hmm-coefficient=$leaky_hmm_coefficient --xent-regularize=$xent_regularize \

0 commit comments

Comments
 (0)