Created
August 2, 2018 03:43
-
-
Save Momijinn/74db3e411da36ee23b789deae629c4c2 to your computer and use it in GitHub Desktop.
testRnn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ニューラルネットワークの構築 | |
#中間層2層の実装 | |
model = Sequential() | |
#入力層と中間層1層作ってる | |
model.add(LSTM(32, return_sequences=True, input_shape=(26,1))) #RNN | |
model.add(Activation('relu')) #Activation | |
model.add(Dropout(0.3)) #dropout | |
#中間層二層目 | |
model.add(Bidirectional(LSTM(8))) | |
model.add(Activation('relu')) | |
model.add(Dropout(0.4)) | |
#出力層 | |
#とりあえず4分類 | |
model.add(Dense(4)) | |
model.add(Activation('softmax')) | |
optimizer = SGD(decay=1e-4) | |
model.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics=['accuracy']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.01 | |
0.99 | |
0.98 | |
0.98 | |
0.98 | |
0.95 | |
0.93 | |
0.91 | |
0.9 | |
0.92 | |
0.97 | |
1.01 | |
0.99 | |
0.98 | |
0.98 | |
0.98 | |
0.95 | |
0.93 | |
0.91 | |
0.9 | |
0.92 | |
0.97 | |
1.01 | |
0.99 | |
0.98 | |
0.98 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment