You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current pytket.PytketDevice a compilation pass is applied every time the PennyLane circuit is run (in apply()). This results in a compilation pass every time the variational parameters (or trainable parameters) of a circuit are changed i.e. in a hybrid neural network that is being trained with PyTorch or TensorFlow.
New behavior
When a PennyLaneQNode is passed to the pytket.PytketDevice, keep track of what parameters are trainable (for example the ones we request gradients for...) and replace them with fresh_symbol equivalents in the construction of the circuit (e.g. at this line as suggested by @kyasci Kentaro Yamamoto)
Then during the apply() function replace the value of the parameters after compilation.
Questions
Is this something that can be easily implemented?
Would it create problems on some backends?
Who needs this feature?
Does it make training faster on hardware backends?
The text was updated successfully, but these errors were encountered:
Current behavior
In the current
pytket.PytketDevice
a compilation pass is applied every time thePennyLane
circuit is run (inapply()
). This results in a compilation pass every time the variational parameters (or trainable parameters) of a circuit are changed i.e. in a hybrid neural network that is being trained withPyTorch
orTensorFlow
.New behavior
When a
PennyLane
QNode
is passed to thepytket.PytketDevice
, keep track of what parameters are trainable (for example the ones we request gradients for...) and replace them withfresh_symbol
equivalents in the construction of the circuit (e.g. at this line as suggested by @kyasci Kentaro Yamamoto)Then during the
apply()
function replace the value of the parameters after compilation.Questions
The text was updated successfully, but these errors were encountered: