Skip to content

Commit

Permalink
changed visualise function to closely match notebook (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbollar authored and dustinvtran committed Apr 28, 2017
1 parent 52fef60 commit 068f1c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/tex/tutorials/supervised-regression.tex
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ \subsubsection{Criticism}

\begin{lstlisting}[language=Python]
def visualise(X_data, y_data, w, b, n_samples=10):
w_samples = w.sample(n_samples).eval()
w_samples = w.sample(n_samples)[0].eval()
b_samples = b.sample(n_samples).eval()
plt.scatter(X_data, y_data)
inputs = np.linspace(-1, 10, num=400)
plt.scatter(X_data[:, 0], y_data)
inputs = np.linspace(-8, 8, num=400)
for ns in range(n_samples):
output = inputs * w_samples[ns] + b_samples[ns]
plt.plot(inputs, output)
Expand Down

0 comments on commit 068f1c4

Please sign in to comment.