回答編集履歴
1
追記
answer
CHANGED
@@ -1,4 +1,30 @@
|
|
1
1
|
` h2 = self.l2(x)`
|
2
2
|
は
|
3
3
|
` h2 = self.l2(h1)`
|
4
|
-
と書きたかったのでは。
|
4
|
+
と書きたかったのでは。
|
5
|
+
|
6
|
+
----
|
7
|
+
```
|
8
|
+
def get_example(self, idx):
|
9
|
+
return self.data[idx]
|
10
|
+
```
|
11
|
+
で1つしか値を返してませんが、ここは入力と出力の**組**を返すのが本当のはず。
|
12
|
+
AutoEncoderなので正解は自分自身でよく、
|
13
|
+
|
14
|
+
```
|
15
|
+
def get_example(self, idx):
|
16
|
+
return self.data[idx], self.data[idx]
|
17
|
+
```
|
18
|
+
でしょう。
|
19
|
+
|
20
|
+
また、
|
21
|
+
```
|
22
|
+
model = Autoencoder()
|
23
|
+
```
|
24
|
+
だと予測する層だけで損失を計算してないので、例えば、
|
25
|
+
|
26
|
+
```
|
27
|
+
model = L.Classifier(Autoencoder(), lossfun=F.mean_squared_error)
|
28
|
+
model.compute_accuracy = False
|
29
|
+
```
|
30
|
+
とでもしましょうか。
|