回答編集履歴
1
d
test
CHANGED
@@ -17,3 +17,33 @@
|
|
17
17
|
X_data = scale(X_data)
|
18
18
|
|
19
19
|
```
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
## 追記
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
cost を sess.run で計算した結果を cost_history 配列に追加していくなら
|
28
|
+
|
29
|
+
以下のようにするべきではないでしょうか。
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```python
|
34
|
+
|
35
|
+
cost_history = []
|
36
|
+
|
37
|
+
for epoch in range(training_epochs):
|
38
|
+
|
39
|
+
sess.run(training_step, feed_dict={X:X_train, Y:y_train})
|
40
|
+
|
41
|
+
cost_history.append(sess.run(cost, feed_dict={X:X_train, Y:y_train})
|
42
|
+
|
43
|
+
if epoch % 100 == 0:
|
44
|
+
|
45
|
+
W_val = sess.run(W)
|
46
|
+
|
47
|
+
b_val = sess.run(b)
|
48
|
+
|
49
|
+
```
|