Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to choose the parameters in the function of lr_finder.find #3

Open
xuzhang5788 opened this issue May 1, 2018 · 2 comments
Open

Comments

@xuzhang5788
Copy link

xuzhang5788 commented May 1, 2018

How to set the values of start_lr, end_lr, batch_size and epochs? In my model, I couldn't get the figures like your example.

I used
lr_finder.find(X_train, y_train, start_lr=0.0001, end_lr=1, batch_size=512, epochs=5)
lr_finder.plot_loss(n_skip_beginning=20, n_skip_end=5)

Then I got a figure like this.
loss_lr

lr_finder.plot_loss_change(sma=20, n_skip_beginning=20, n_skip_end=5, y_lim=(-0.1, 0.1))
image

Could you give me some advice to use other parameters to find a good lr? Many thanks

@surmenok
Copy link
Owner

surmenok commented May 4, 2018

One possibility is that start_lr is too high. Usually, for CNNs and small dense networks the parameters you use work fine, but for some cases (e.g. RNNs) LR 0.0001 could be too high. Try lower values, e.g. 0.000001.
If it doesn't work even with low starting learning rate, it's possible that there are errors in the implementation of the model.
Try to reduce the dataset to a small size (e.g. 100 examples) and check if the model can learn to predict correct labels on the training set (overfit to the training set).

@xuzhang5788
Copy link
Author

Thank you so much. I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants