Spaces:
Runtime error
Runtime error
Fix progress index
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ if cost_function == 'RMSE-Loss':
|
|
78 |
# Perform gradient descent
|
79 |
for i in range(NUM_ITER):
|
80 |
# Update progress bar.
|
81 |
-
progress_bar.progress(i
|
82 |
|
83 |
# Update parameters.
|
84 |
w -= learning_rate * grad_loss(w)
|
@@ -87,7 +87,7 @@ if cost_function == 'RMSE-Loss':
|
|
87 |
if (i+1)%100==0:
|
88 |
# report the loss at the current epoch
|
89 |
status_text.text(
|
90 |
-
'Trained loss is
|
91 |
|
92 |
# add a line to the plot
|
93 |
plt.plot(X[jnp.dot(X, w).argsort(), 1], jnp.dot(X, w).sort(), 'c--')
|
|
|
78 |
# Perform gradient descent
|
79 |
for i in range(NUM_ITER):
|
80 |
# Update progress bar.
|
81 |
+
progress_bar.progress(i)
|
82 |
|
83 |
# Update parameters.
|
84 |
w -= learning_rate * grad_loss(w)
|
|
|
87 |
if (i+1)%100==0:
|
88 |
# report the loss at the current epoch
|
89 |
status_text.text(
|
90 |
+
'Trained loss at epoch %s is %s' % (i, loss(w)))
|
91 |
|
92 |
# add a line to the plot
|
93 |
plt.plot(X[jnp.dot(X, w).argsort(), 1], jnp.dot(X, w).sort(), 'c--')
|