You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make it possible to return the best learning rate without making a plot.
I suggest you refactor some code and pull the calculation of statistics out of the plotting function.
I think all of the statistics should be computed in the range_test function and I think the range_test function should return the optimal learning rate.
The text was updated successfully, but these errors were encountered:
lrs = np.array(lr_finder.history["lr"])
losses = np.array(lr_finder.history["loss"])
min_grad_idx = None
try:
min_grad_idx = (np.gradient(np.array(losses))).argmin()
except ValueError:
print("Failed to compute the gradients, there might not be enough points.")
if min_grad_idx is not None:
best_lr = lrs[min_grad_idx]
print(f"Best lr:", best_lr)
Please make it possible to return the best learning rate without making a plot.
I suggest you refactor some code and pull the calculation of statistics out of the plotting function.
I think all of the statistics should be computed in the range_test function and I think the range_test function should return the optimal learning rate.
The text was updated successfully, but these errors were encountered: