From bc8ed4031bb2e4f4a660ac469555d49a4b08b274 Mon Sep 17 00:00:00 2001 From: Anique Date: Mon, 16 Apr 2018 14:53:25 -0700 Subject: [PATCH] Update 03_linreg_starter.py Bug: Loss redefined twice for different variables Fix: The second loss variable is renamed --- examples/03_linreg_starter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/03_linreg_starter.py b/examples/03_linreg_starter.py index 99ea784f..fda97c85 100644 --- a/examples/03_linreg_starter.py +++ b/examples/03_linreg_starter.py @@ -68,8 +68,8 @@ for x, y in data: # Execute train_op and get the value of loss. # Don't forget to feed in data for placeholders - _, loss = ########## TO DO ############ - total_loss += loss + _, l = ########## TO DO ############ + total_loss += l print('Epoch {0}: {1}'.format(i, total_loss/n_samples)) @@ -91,4 +91,4 @@ # plt.plot(data[:,0], data[:,1], 'bo', label='Real data') # plt.plot(data[:,0], data[:,0] * w_out + b_out, 'r', label='Predicted data') # plt.legend() -# plt.show() \ No newline at end of file +# plt.show()