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

Most upvoted comments

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 have qiskit-terra installed in your python environment.

@darshkaushik thanks, I’ll keep this issue on you.

This sounds like a super interesting introduction to this repo, any chance I could take this issue over @darshkaushik

@mattwright99, I have already invested several hours and would like to continue with it, hope that’s fine

@darshkaushik how is your progress working on this issue?

Have gone through VQE and hope to commit by today, will let you know if I get stuck somewhere.