質問編集履歴
1
RNNのエラー→LSTMのエラー
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,21 +42,21 @@
|
|
42
42
|
|
43
43
|
IndexError Traceback (most recent call last)
|
44
44
|
|
45
|
-
/tmp/ipykernel_
|
45
|
+
/tmp/ipykernel_344/3488387848.py in <module>
|
46
|
-
|
46
|
+
|
47
|
-
1
|
47
|
+
21 #total_rnn_loss += rnn_loss*len(X_batch)
|
48
|
-
|
48
|
+
|
49
|
-
|
49
|
+
22
|
50
|
-
|
50
|
+
|
51
|
-
--->
|
51
|
+
---> 23 lstm_loss = lstm_model.forward(X_batch, T_batch)
|
52
|
-
|
52
|
+
|
53
|
-
|
53
|
+
24 lstm_model.backward()
|
54
|
-
|
54
|
+
|
55
|
-
2
|
55
|
+
25 optimizer2.update(lstm_model.params, lstm_model.grads)
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
-
/tmp/ipykernel_17
|
59
|
+
/tmp/ipykernel_344/3951171937.py in forward(self, xs, ts)
|
60
60
|
|
61
61
|
30 def forward(self, xs, ts):
|
62
62
|
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
|
72
72
|
|
73
|
-
/tmp/ipykernel_
|
73
|
+
/tmp/ipykernel_344/877901989.py in forward(self, x, t)
|
74
74
|
|
75
75
|
69 self.t = self.t.argmax(axis=0)
|
76
76
|
|
@@ -84,7 +84,7 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
|
87
|
-
/tmp/ipykernel_
|
87
|
+
/tmp/ipykernel_344/689892580.py in cross_entropy_error(y, t)
|
88
88
|
|
89
89
|
26 batch_size = y.shape[0]
|
90
90
|
|