|
|
@ -113,7 +113,8 @@ class U2STBaseModel(nn.Layer):
|
|
|
|
asr_weight: float=0.0,
|
|
|
|
asr_weight: float=0.0,
|
|
|
|
ignore_id: int=IGNORE_ID,
|
|
|
|
ignore_id: int=IGNORE_ID,
|
|
|
|
lsm_weight: float=0.0,
|
|
|
|
lsm_weight: float=0.0,
|
|
|
|
length_normalized_loss: bool=False):
|
|
|
|
length_normalized_loss: bool=False,
|
|
|
|
|
|
|
|
**kwargs):
|
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|
|
|
|
assert 0.0 <= ctc_weight <= 1.0, ctc_weight
|
|
|
|
|
|
|
|
|
|
|
|
super().__init__()
|
|
|
|
super().__init__()
|
|
|
@ -650,7 +651,7 @@ class U2STModel(U2STBaseModel):
|
|
|
|
odim=vocab_size,
|
|
|
|
odim=vocab_size,
|
|
|
|
enc_n_units=encoder.output_size(),
|
|
|
|
enc_n_units=encoder.output_size(),
|
|
|
|
blank_id=0,
|
|
|
|
blank_id=0,
|
|
|
|
dropout_rate=model_conf['ctc_dropout_rate'],
|
|
|
|
dropout_rate=model_conf['ctc_dropoutrate'],
|
|
|
|
reduction=True, # sum
|
|
|
|
reduction=True, # sum
|
|
|
|
batch_average=True, # sum / batch_size
|
|
|
|
batch_average=True, # sum / batch_size
|
|
|
|
grad_norm_type=model_conf['ctc_grad_norm_type'])
|
|
|
|
grad_norm_type=model_conf['ctc_grad_norm_type'])
|
|
|
|