I was wondering how to use the Pytorch interface the best way in order to apply a QNode on multiple inputs of a dataset X,Y. I was thinking something like :
@qml.qnode(dev,interface="torch") def circuit(parameters, x): # do some quantum operations # return an expectation value giving probability # output in a binary supervised learning setup return qml.expval(qml.PauliZ(0)) def apply_loss(labels, predictions): # define loss return loss def cost(var, X, Y): predictions = ? # define cost
To define the cost, would we have to loop over all examples in X and Y to get their predictions? I guess since batching is not available yet right? Yet how to do so if we define X,Y to be tensors in order to apply our optimizer on the variable var ?
Thanks in advance for help