sync the variable name to others

pull/1350/head
Junkun 4 years ago
parent f866059b74
commit 44408e5211

@ -3,7 +3,7 @@ error_rate_type: char-bleu
decoding_method: fullsentence # 'fullsentence', 'simultaneous' decoding_method: fullsentence # 'fullsentence', 'simultaneous'
beam_size: 10 beam_size: 10
word_reward: 0.7 word_reward: 0.7
maxlen_ratio: 0.3 maxlenratio: 0.3
decoding_chunk_size: -1 # decoding chunk size. Defaults to -1. decoding_chunk_size: -1 # decoding chunk size. Defaults to -1.
# <0: for decoding, use full chunk. # <0: for decoding, use full chunk.
# >0: for decoding, use fixed chunk size as set. # >0: for decoding, use fixed chunk size as set.

@ -4,7 +4,7 @@ error_rate_type: char-bleu
decoding_method: fullsentence # 'fullsentence', 'simultaneous' decoding_method: fullsentence # 'fullsentence', 'simultaneous'
beam_size: 10 beam_size: 10
word_reward: 0.7 word_reward: 0.7
maxlen_ratio: 0.3 maxlenratio: 0.3
decoding_chunk_size: -1 # decoding chunk size. Defaults to -1. decoding_chunk_size: -1 # decoding chunk size. Defaults to -1.
# <0: for decoding, use full chunk. # <0: for decoding, use full chunk.
# >0: for decoding, use fixed chunk size as set. # >0: for decoding, use fixed chunk size as set.

@ -408,7 +408,7 @@ class U2STTester(U2STTrainer):
decoding_method=decode_cfg.decoding_method, decoding_method=decode_cfg.decoding_method,
beam_size=decode_cfg.beam_size, beam_size=decode_cfg.beam_size,
word_reward=decode_cfg.word_reward, word_reward=decode_cfg.word_reward,
maxlen_ratio=decode_cfg.maxlen_ratio, maxlenratio=decode_cfg.maxlenratio,
decoding_chunk_size=decode_cfg.decoding_chunk_size, decoding_chunk_size=decode_cfg.decoding_chunk_size,
num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks, num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks,
simulate_streaming=decode_cfg.simulate_streaming) simulate_streaming=decode_cfg.simulate_streaming)
@ -436,7 +436,7 @@ class U2STTester(U2STTrainer):
decoding_method=decode_cfg.decoding_method, decoding_method=decode_cfg.decoding_method,
beam_size=decode_cfg.beam_size, beam_size=decode_cfg.beam_size,
word_reward=decode_cfg.word_reward, word_reward=decode_cfg.word_reward,
maxlen_ratio=decode_cfg.maxlen_ratio, maxlenratio=decode_cfg.maxlenratio,
decoding_chunk_size=decode_cfg.decoding_chunk_size, decoding_chunk_size=decode_cfg.decoding_chunk_size,
num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks, num_decoding_left_chunks=decode_cfg.num_decoding_left_chunks,
simulate_streaming=decode_cfg.simulate_streaming) simulate_streaming=decode_cfg.simulate_streaming)

@ -264,7 +264,7 @@ class U2STBaseModel(nn.Layer):
speech_lengths: paddle.Tensor, speech_lengths: paddle.Tensor,
beam_size: int=10, beam_size: int=10,
word_reward: float=0.0, word_reward: float=0.0,
maxlen_ratio: float=0.5, maxlenratio: float=0.5,
decoding_chunk_size: int=-1, decoding_chunk_size: int=-1,
num_decoding_left_chunks: int=-1, num_decoding_left_chunks: int=-1,
simulate_streaming: bool=False, ) -> paddle.Tensor: simulate_streaming: bool=False, ) -> paddle.Tensor:
@ -274,7 +274,7 @@ class U2STBaseModel(nn.Layer):
speech_length (paddle.Tensor): (batch, ) speech_length (paddle.Tensor): (batch, )
beam_size (int): beam size for beam search beam_size (int): beam size for beam search
word_reward (float): word reward used in beam search word_reward (float): word reward used in beam search
maxlen_ratio (float): max length ratio to bound the length of translated text maxlenratio (float): max length ratio to bound the length of translated text
decoding_chunk_size (int): decoding chunk for dynamic chunk decoding_chunk_size (int): decoding chunk for dynamic chunk
trained model. trained model.
<0: for decoding, use full chunk. <0: for decoding, use full chunk.
@ -297,7 +297,7 @@ class U2STBaseModel(nn.Layer):
num_decoding_left_chunks, num_decoding_left_chunks,
simulate_streaming) # (B, maxlen, encoder_dim) simulate_streaming) # (B, maxlen, encoder_dim)
maxlen = max(int(encoder_out.shape[1] * maxlen_ratio), 5) maxlen = max(int(encoder_out.shape[1] * maxlenratio), 5)
hyp = {"score": 0.0, "yseq": [self.sos], "cache": None} hyp = {"score": 0.0, "yseq": [self.sos], "cache": None}
hyps = [hyp] hyps = [hyp]
@ -475,7 +475,7 @@ class U2STBaseModel(nn.Layer):
decoding_method: str, decoding_method: str,
beam_size: int, beam_size: int,
word_reward: float=0.0, word_reward: float=0.0,
maxlen_ratio: float=0.5, maxlenratio: float=0.5,
decoding_chunk_size: int=-1, decoding_chunk_size: int=-1,
num_decoding_left_chunks: int=-1, num_decoding_left_chunks: int=-1,
simulate_streaming: bool=False): simulate_streaming: bool=False):
@ -511,7 +511,7 @@ class U2STBaseModel(nn.Layer):
feats_lengths, feats_lengths,
beam_size=beam_size, beam_size=beam_size,
word_reward=word_reward, word_reward=word_reward,
maxlen_ratio=maxlen_ratio, maxlenratio=maxlenratio,
decoding_chunk_size=decoding_chunk_size, decoding_chunk_size=decoding_chunk_size,
num_decoding_left_chunks=num_decoding_left_chunks, num_decoding_left_chunks=num_decoding_left_chunks,
simulate_streaming=simulate_streaming) simulate_streaming=simulate_streaming)

Loading…
Cancel
Save