qiskit-machine-learning
qiskit-machine-learning copied to clipboard
Quantum CNN
What should we add?
I wanted to contribute a new tutorial on Quantum CNN using Pytorch Lightning. I am following this approach using jupyter notebooks.
The implementation uses sklearn
'blobs
dataset to perform binary classification of 2-dimensional data points. It features Quantum convolution and pooling layers. Shall I create a pull request for this?
Hi, thanks a lot for the suggestion and sorry for the long delay. I think, such a tutorial is a good idea. We don't have pytorch lightning on the dependencies list, so please make use of plain pytorch. If you have any questions let me know.
Hi, we already have code written with Qiskit for generating quantum circuits for the exact same tutorial referenced. But it is not published anywhere. Let think what's the best way to proceed.
@dlasecki I'd love see some progress on this topic, I don't have time to work on this on my own or in a collaboration with anybody. So any ideas are very welcome!
@dlasecki I tried to follow the code of the referenced tutorial in qiskit and used TorchConnector to train it, but the model does not seem to converge and it takes a lot of time to finish even a single epoch. Using GPU is not beneficial as the number of samples are less (~100) and even when I used GPU the per cent utilization was negligible.
In the torch connector tutorial, the authors use only 2 qubits when here using 16 qubits (images resized to 4 x 4) is taking quite a time.
@Gopal-Dahale may we help somehow?
Let
@Gopal-Dahale may we help somehow?
Let me make the code a little bit readable. You can find my current progress here. I was also trying to make a single qubit CNN using this as a reference.
@dlasecki I tried to follow the code of the referenced tutorial in qiskit and used TorchConnector to train it, but the model does not seem to converge and it takes a lot of time to finish even a single epoch. Using GPU is not beneficial as the number of samples are less (~100) and even when I used GPU the per cent utilization was negligible.
In the torch connector tutorial, the authors use only 2 qubits when here using 16 qubits (images resized to 4 x 4) is taking quite a time.
Hi, if your code is in a good shape for us to follow, you might open a draft PR and we might have a look. Perhaps some things could be optimized or improved.
Closed in #462