回答編集履歴
1
追記
test
CHANGED
@@ -5,3 +5,55 @@
|
|
5
5
|
` h2 = self.l2(h1)`
|
6
6
|
|
7
7
|
と書きたかったのでは。
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
----
|
12
|
+
|
13
|
+
```
|
14
|
+
|
15
|
+
def get_example(self, idx):
|
16
|
+
|
17
|
+
return self.data[idx]
|
18
|
+
|
19
|
+
```
|
20
|
+
|
21
|
+
で1つしか値を返してませんが、ここは入力と出力の**組**を返すのが本当のはず。
|
22
|
+
|
23
|
+
AutoEncoderなので正解は自分自身でよく、
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
def get_example(self, idx):
|
30
|
+
|
31
|
+
return self.data[idx], self.data[idx]
|
32
|
+
|
33
|
+
```
|
34
|
+
|
35
|
+
でしょう。
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
また、
|
40
|
+
|
41
|
+
```
|
42
|
+
|
43
|
+
model = Autoencoder()
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
だと予測する層だけで損失を計算してないので、例えば、
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
model = L.Classifier(Autoencoder(), lossfun=F.mean_squared_error)
|
54
|
+
|
55
|
+
model.compute_accuracy = False
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
とでもしましょうか。
|