Skip to content

Commit

Permalink
Add BiLSTM (microsoft#492)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherrylone authored Apr 15, 2020
1 parent b4f6e13 commit 3953cca
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ def __init__(self):
super(RNN, self).__init__()
self.rnn = nn.LSTM(
input_size=29, # character num.
hidden_size=16, # RNN or LSTM hidden layer, 设置的稍大一些可能效果更佳,此处仅作对比
hidden_size=8, # RNN or LSTM hidden layer, 设置的稍大一些可能效果更佳,此处仅作对比
num_layers=1,
batch_first=True,
bidirectional=True # 双向LSTM, 若设置为False,对应hidden_size增大两倍
)
self.out = nn.Linear(16, 10)
self.softmax = nn.Softmax() # classification, softmax
Expand Down

0 comments on commit 3953cca

Please sign in to comment.