Quanvolutional Neural Networks¶

Hi run the code on " Quanvolutional Neural Networks" (Quanvolutional Neural Networks | PennyLane Demos)
but the curve that I get is quite different
both accuracy and loss are less zigzag and the “with quantum layer” is worse than “without quantum”!

1 Like

Hi @Chicago_Girl , can you post the output for qml.about()? A difference in the versions of the libraries used could explain the difference. Can you also post a picture of the graphs you get? A minor difference might be expected.

On the other hand, note that as both classical and quantum comuting software evolve, these graphs will change over time. It seems like at this time classical-only is indeed beating quantum+classical for this particular demo. It comes to prove that adding quantum isn’t always better!

Do you have code snippet to save the model and do inferencing.
I am looking for generalisation of the solution and checking comparison & applicability in beating at all the stages of model development

Hi @Kiran_Kumar_M
Is this question related to a previous one you had asked?
I think I understand what you are asking for. You want to know how to use your trained parameters to now predict outcomes using some test data, is that right?

Take a look at this blogpost for a very simple example where they test the model in these lines of code

test_predictions = []
for x_test in X_test:
    prediction = quantum_circuit(x_test,params)
    test_predictions.append(prediction)

I believe the principle is the same.

Take a look at the blog post and let me know.