teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

d

2019/08/15 07:47

投稿

tiitoi
tiitoi

スコア21960

answer CHANGED
@@ -7,4 +7,19 @@
7
7
  from sklearn.preprocessing import scale
8
8
 
9
9
  X_data = scale(X_data)
10
+ ```
11
+
12
+ ## 追記
13
+
14
+ cost を sess.run で計算した結果を cost_history 配列に追加していくなら
15
+ 以下のようにするべきではないでしょうか。
16
+
17
+ ```python
18
+ cost_history = []
19
+ for epoch in range(training_epochs):
20
+ sess.run(training_step, feed_dict={X:X_train, Y:y_train})
21
+ cost_history.append(sess.run(cost, feed_dict={X:X_train, Y:y_train})
22
+ if epoch % 100 == 0:
23
+ W_val = sess.run(W)
24
+ b_val = sess.run(b)
10
25
  ```