Closed Herutriana44 closed 9 months ago
I think you should create an issue here: https://github.com/qiskit-community/qiskit-machine-learning as it is related to qiskit machine learning.
Honestly, I don't get the question. But if you have a trained model and you are running inference on quantum hardware, then this is the way to go:
from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Session
from qiskit_machine_learning.algorithms import VQC
IBM_API = "MY_IBM_API"
service = QiskitRuntimeService(token=IBM_API, channel="ibm_quantum")
backend = service.backend("ibm_perth")
sampler = Sampler(session=Session(service=service, backend=backend))
vqc = VQC.load("saved_model")
vqc.neural_network.sampler = sampler
X = ...
vqc.predict(X)
I think you should create an issue here: https://github.com/qiskit-community/qiskit-machine-learning as it is related to qiskit machine learning.
Honestly, I don't get the question. But if you have a trained model and you are running inference on quantum hardware, then this is the way to go:
from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Session from qiskit_machine_learning.algorithms import VQC IBM_API = "MY_IBM_API" service = QiskitRuntimeService(token=IBM_API, channel="ibm_quantum") backend = service.backend("ibm_perth") sampler = Sampler(session=Session(service=service, backend=backend)) vqc = VQC.load("saved_model") vqc.neural_network.sampler = sampler X = ... vqc.predict(X)
Thanks, I Will try this
Thanks both. I'll close this now because it's best to continue any further necessary discussion on the Machine Learning repo, but please feel free to raise more issues here if they're part of Qiskit core.
Environment
Issue
i have quantum machine learning deployment project. but i'm so confused for load VQC model and predict on real backend. bellow is one of my code from my this project
any suggestion?