qiskit-machine-learning
qiskit-machine-learning copied to clipboard
Add `SamplerQNN` class using terra primitives
Summary
This PR presents a reference implementation of a Qiskit NeuralNetwork that leverages the newly introduced primitives (so far, this class is based on the terra interface). It closes issue #400.
Details and comments
This PR is blocked by the release of Qiskit-terra that will include gradients and changes in the primitives interface.
Open Points of Discussion
- [ ] Where to set keyword args -> all keyword?
- [ ] Hoy to define typehints: list vs sequence vs numpy array...
TO-DO
- [ ] Add reno
- [ ] Add deprecation warnings
Why would this not be in neural networks (same comment for the kernel PR but in kernels of course) and subclass NeuralNetwork. I would think we would place this for what it is not what its built from. I realize its all draft and work in progress, so I am not going to comment beyond this aspect for now. Maybe because its all work in progress it just did not get that far yet.
Why would this not be in
neural networks(same comment for the kernel PR but in kernels of course) and subclass NeuralNetwork. I would think we would place this for what it is not what its built from. I realize its all draft and work in progress, so I am not going to comment beyond this aspect for now. Maybe because its all work in progress it just did not get that far yet.
Yes, I totally agree, I just moved my primitives PoC directory as-is from a different repo, but the class definitely fits better into neural_networks.
Pull Request Test Coverage Report for Build 3373322648
- 157 of 170 (92.35%) changed or added relevant lines in 5 files are covered.
- 2 unchanged lines in 1 file lost coverage.
- Overall coverage increased (+0.07%) to 88.925%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| qiskit_machine_learning/neural_networks/sampler_qnn.py | 130 | 143 | 90.91% |
| <!-- | Total: | 157 | 170 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| qiskit_machine_learning/neural_networks/neural_network.py | 2 | 92.08% |
| <!-- | Total: | 2 |
| Totals | |
|---|---|
| Change from base Build 3366556544: | 0.07% |
| Covered Lines: | 3541 |
| Relevant Lines: | 3982 |