質問編集履歴

1

classの修正

2019/09/01 02:40

投稿

howareyou1245
howareyou1245

スコア20

test CHANGED
File without changes
test CHANGED
@@ -14,9 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- class mlp(chainer.Chain):
17
+ class logis(chainer.Chain):
18
-
19
-
20
18
 
21
19
  def __init__(self):
22
20
 
@@ -26,27 +24,21 @@
26
24
 
27
25
  with self.init_scope():
28
26
 
29
- self.fc1 = L.Linear(None,400)
27
+ self.l1 = L.Linear(None,2)
30
28
 
31
- self.fc2 = L.Linear(400,400)
29
+
32
-
33
- self.fc3 = L.Linear(400,2)
34
30
 
35
31
 
36
32
 
37
33
  def forward(self,x):
38
34
 
39
- h = F.softmax(self.fc1(x))
35
+ h = F.softmax(self.l1(x))
40
-
41
- h = F.softmax(self.fc2(h))
42
-
43
- h = self.fc3(h)
44
36
 
45
37
  return h
46
38
 
47
39
 
48
40
 
49
- pred = mlp()
41
+ pred = logis()
50
42
 
51
43
  net = L.Classifier(pred)
52
44