質問編集履歴

1

ショートコードがエラーになるのを修正

2017/08/25 09:13

投稿

iwahara
iwahara

スコア6

test CHANGED
File without changes
test CHANGED
@@ -44,6 +44,18 @@
44
44
 
45
45
  ```python
46
46
 
47
+ from keras.models import Sequential
48
+
49
+ from keras.layers.core import Dense, Activation, Dropout
50
+
51
+ from keras.optimizers import SGD
52
+
53
+ import numpy as np
54
+
55
+ from keras.utils import np_utils
56
+
57
+
58
+
47
59
  model = Sequential()
48
60
 
49
61
  model.add(Dense(64, activation='relu', input_dim=3))
@@ -54,7 +66,7 @@
54
66
 
55
67
  model.add(Dropout(0.5))
56
68
 
57
- model.add(Dense(nb_classes, activation='softmax'))
69
+ model.add(Dense(3, activation='softmax'))
58
70
 
59
71
  sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)
60
72