tensorflow / quantum

Hybrid Quantum-Classical Machine Learning in TensorFlow

Home Page:https://www.tensorflow.org/quantum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use a QNN with encrypted data?

sauravtii opened this issue · comments

Hi,

How can I use the model mentioned in this tutorial for this use case?

I'm not really sure what the question is, just copy the model setup over and create a classical to quantum data conversion function and you should be good to go

Actually my question is, is it possible to save the QML model in the above mentioned MNIST tutorial ?

Yes, you can save and load weights the same as other TF models

Okay, and also can it be converted it to a pytorch one (since CryPten is in Pytorch) ?

While you can use ONNX to convert between frameworks (I think), I don't think there is a standard that works with quantum. My advice would be to either convert that code to TensorFlow (looks like basic MLPs so shouldn't be hard) or convert the TFQ training to an equivalent PyTorch package (I'm sure there are QML packages in it)

Okay, by converting to Tensorflow do you mean converting CyPten code to tensorflow?

Okay, thanks!
And as you meantioned that the QNN model can be saved, can you tell how can I achieve that ?
I mean, saving the model after completing the training in the same way as a normal TF model, right?

Yes, save_weights and load_weights are what I use

Okay, thank you for your response!