qiskit-machine-learning: Improve handling of missing optimizer in NN classifier/regressor
What is the expected enhancement?
When an optimizer is not passed to neural network classifier/regressor an exception occurs: AttributeError: 'NoneType' object has no attribute 'optimize'
. In this issue I suggest to improve this behavior and either raise a more meaningful exception or introduce a default optimizer, e.g. Cobyla or SLSQP.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (10 by maintainers)
Commits related to this issue
- Default optimizer for TrainableModel SLSQP is the default optimizer. Rectified type hints. — committed to darshkaushik/qiskit-machine-learning by darshkaushik 3 years ago
- Updated styling — committed to darshkaushik/qiskit-machine-learning by darshkaushik 3 years ago
- This fixes missing optimizer in NN classifier/regressor #124 (#132) * Default optimizer for TrainableModel SLSQP is the default optimizer. Rectified type hints. * Updated styling * Docstring... — committed to qiskit-community/qiskit-machine-learning by darshkaushik 3 years ago
- This fixes missing optimizer in NN classifier/regressor #124 (#132) * Default optimizer for TrainableModel SLSQP is the default optimizer. Rectified type hints. * Updated styling * Docstring... — committed to gentinettagian/qiskit-machine-learning by darshkaushik 3 years ago
There is information around contributing here https://github.com/Qiskit/qiskit-machine-learning/blob/main/CONTRIBUTING.md#contributing which also links to the main Qiskit contributing docs that have a lot of common information.
The easiest way to get the tools you need for development installed is to do a
pip install -r requirements-dev.txt
- you will see the file in the root of the repo. It has the list of all the tools needed - because they are only needed if you are doing dev they are not part of the standard requirements/install.This is likely due to different line endings in linux and windows:
\n
vs\r\n
. I guess you did not edit copyright notices, so ignore them.Yeah, please install it via
pip install pylintfileheader
. You should also haveqiskit-terra
installed in your python environment.@darshkaushik thanks, I’ll keep this issue on you.
@mattwright99, I have already invested several hours and would like to continue with it, hope that’s fine
Have gone through VQE and hope to commit by today, will let you know if I get stuck somewhere.