Skip to content

Commit 21fa225

Browse files
MorvanZhouMorvan Zhou
authored and
Morvan Zhou
committed
update
1 parent 1e57fa6 commit 21fa225

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tutorial-contents/503_visualize_gradient_descent.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import matplotlib.pyplot as plt
1313
from mpl_toolkits.mplot3d import Axes3D
1414

15-
LR = .1
15+
LR = 0.1
1616
REAL_PARAMS = [1.2, 2.5]
1717
INIT_PARAMS = [[5, 4],
18-
[0, 0],
18+
[5, 1],
1919
[2, 4.5]][2]
2020

2121
x = np.linspace(-1, 1, 200, dtype=np.float32)
@@ -53,7 +53,7 @@
5353
print('a=', a_, 'b=', b_)
5454
plt.figure(1)
5555
plt.scatter(x, y, c='b') # plot data
56-
plt.plot(x, result, 'r-') # plot line fitting
56+
plt.plot(x, result, 'r-', lw=2) # plot line fitting
5757
# 3D cost figure
5858
fig = plt.figure(2); ax = Axes3D(fig)
5959
a3D, b3D = np.meshgrid(np.linspace(-2, 7, 30), np.linspace(-2, 7, 30)) # parameter space

0 commit comments

Comments
 (0)