@ -128,8 +128,8 @@ class DeepSpeech2Model(nn.Layer):
num_rnn_layers=3,#Number of stacking RNN layers.
num_rnn_layers=3,#Number of stacking RNN layers.
rnn_layer_size=1024,#RNN layer size (number of RNN cells).
rnn_layer_size=1024,#RNN layer size (number of RNN cells).
use_gru=True,#Use gru if set True. Use simple rnn if set False.
use_gru=True,#Use gru if set True. Use simple rnn if set False.
share_rnn_weights=True#Whether to share input-hidden weights between forward and backward directional RNNs.Notice that for GRU, weight sharing is not supported.
share_rnn_weights=True,#Whether to share input-hidden weights between forward and backward directional RNNs.Notice that for GRU, weight sharing is not supported.
))
ctc_grad_norm_type='instance',))
ifconfigisnotNone:
ifconfigisnotNone:
config.merge_from_other_cfg(default)
config.merge_from_other_cfg(default)
returndefault
returndefault
@ -142,7 +142,8 @@ class DeepSpeech2Model(nn.Layer):
rnn_size=1024,
rnn_size=1024,
use_gru=False,
use_gru=False,
share_rnn_weights=True,
share_rnn_weights=True,
blank_id=0):
blank_id=0,
ctc_grad_norm_type='instance'):
super().__init__()
super().__init__()
self.encoder=CRNNEncoder(
self.encoder=CRNNEncoder(
feat_size=feat_size,
feat_size=feat_size,
@ -160,7 +161,8 @@ class DeepSpeech2Model(nn.Layer):