-
Notifications
You must be signed in to change notification settings - Fork 61
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
Qcnn example #834
Qcnn example #834
Conversation
What is the difference between this and PR #695? |
This PR is for an example (in the folder examples/qcnn_classifier) using the QCNN model based on PR #729. This is based on a previous suggestion by @MatteoRobbiati to have an extended example/tutorial to illustrate the use of the QCNN model. PR #695 is an outdated PR (prior to #729) that has since been closed. |
Can you please merge the main branch on this, in order to avoid conflicts due to the already merged qcnn branch? |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #834 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 48 48
Lines 6595 6595
=========================================
Hits 6595 6595
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this, it is very useful for a better understanding of the model you implemented.
Let me add some suggestions:
- this is not the first example in
qibo
based on an IPython implementation. The qPDF is another one. Personally, I think the notebook approach is very useful in terms of visualization of the problem (e.g. in the documentation), but I think this folder starts to be a bit messy.
According to this, I purpose two solutions: the first one is to remove the implementation part fromREADME.md
(I mean from## How to use the QCNN class
), which is not needed since already shown into the notebook. On this way this example will follow the line of the qPDF one. The second is to change this example into a Python script as is done for all the examples inqibo
and to move this notebook to the tutorials repository, in order to be used into the documentation.
I prefer this second option, since notebooks are useful tools but very difficult to handle with several hands. - please select only one of the two notebooks and fix it: there are some unused packages and modules there (e.g.
gates, numpy
etc.) and theqcnn
package must be loaded properly (from qibo.models.qcnn import QuantumCNN
); - add your example here.
Some small suggestions follow.
examples/qcnn_classifier/README.md
Outdated
# Quantum Convolutional Neural Network Classifier | ||
|
||
Code at: [https://github.com/qiboteam/qibo/tree/master/examples/qcnn_classifier] | ||
(https://github.com/qiboteam/qibo/tree/master/examples/qcnn_classifier). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the space between [...]
and (...)
in order to make te link work.
examples/qcnn_classifier/README.md
Outdated
![RT](images/RT.PNG) | ||
|
||
## How to use the QCNN class | ||
For more details on the QuantumCNN class, please refer to the documentation. Here we recall some of the necessary arguments when instantiating a QuantumCNN object: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add link to the documentation when it is available (where you mention the docs).
@ihpcdingwj is this ready for a second review pass? |
What is the status here @ihpcdingwj? Let me summarize some remaining tasks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some small fix to the notebook (like passing circuit.draw()
to the print
function, etc),
fixed the link2path in the README.md
and changed the name of the notebook into qcnn_demo.ipynb
.
The last suggestion is to explicitly write in the README.md
that scikit-learn
is needed to run your example. It should be better to link the official installation page.
I also suggest to rebase this branch on the master.
Thanks @MatteoRobbiati for the editing. We have made the changes suggested. Could you also clarify how do we proceed with "rebase"? |
Thank you for the modification. |
Tutorial v0
Adding example codes
Add pictures of workflow, qcnn structure, data_labels.png
add picture of qcnn structure
add picture of data structure
update with figures of workflow, schematic, data_lables
for more information, see https://pre-commit.ci
Co-authored-by: Matteo Robbiati <[email protected]>
for more information, see https://pre-commit.ci
Thanks @MatteoRobbiati. Have rewritten history :) |
Perfect! I think we are ready to merge :) |
Checklist: