alkzar90 commited on
Commit
8869fec
1 Parent(s): cc0e62a

Fix progress index

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 + 1)
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: %s' % 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--')
 
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--')