Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WIP] FIX: use maxiter rather than maxfun in MultiLayerPerceptron with solver='lbfgs' #10724

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

Closed
wants to merge 2 commits into from

Conversation

lesteve
Copy link
Member

@lesteve lesteve commented Feb 28, 2018

In my limited experience with LBFGS, the number of function calls is greater than the number of iterations.

The impact of this bug is that with solver='lbfgs' is probably not doing as many iterations as it should in master although I am not sure it matters that much in practice.

To get an idea how much funtion calls differ from iterations, I tweaked examples/neural_networks/plot_mnist_filters.py to be able to run for a few hundred iterations:

mlp = MLPClassifier(hidden_layer_sizes=(100,), max_iter=1000, alpha=1e-4,
                    solver='lbfgs', verbose=10, tol=1e-16, random_state=1,
                    learning_rate_init=.1)

The result: 393 iterations and 414 function calls.

Not sure whether we nest to test this, and how to test it, suggestions more than welcome!

  • add a whats_new entry once there is agreement

@lesteve lesteve changed the title [MRG] FIX: use maxiter rather than maxfun in MultiLayerPerceptron with solver='lbfgs' [WIP] FIX: use maxiter rather than maxfun in MultiLayerPerceptron with solver='lbfgs' Feb 28, 2018
@jnothman
Copy link
Member

cf. #9273

@lesteve
Copy link
Member Author

lesteve commented Feb 28, 2018

I am going to set this to WIP because I am not so convinced this is a problem. self.n_iter_ is actually updated incremented each time _loss_grad_lbfgs is called, so maybe it is fine using maxfun in fmin_l_bfgs ...

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

Successfully merging this pull request may close these issues.

2 participants