prevision_quantum_nn.models.pennylane_backend.qnn_pennylane_qubit
¶
Qubit module
Module Contents¶
Classes¶
Class PennylaneQubitNeuralNetwork. |
-
class
prevision_quantum_nn.models.pennylane_backend.qnn_pennylane_qubit.
PennylaneQubitNeuralNetwork
(params)¶ Bases:
prevision_quantum_nn.models.pennylane_backend.qnn_pennylane.PennylaneNeuralNetwork
Class PennylaneQubitNeuralNetwork.
Implements a neural network on a discrete qubit architecture
-
dev
¶ device to be used to train the model
- Type
qml.device
-
build
(self, weights_file=None)¶ builds the backend and the device
-
check_encoding
(self)¶ Checks encoding consistency.
- Raises
ValueError if invalid encoding for qubit calculation –
-
initialize_weights
(self, weights_file=None)¶ Initializes weights.
- Parameters
weights_file (str) – option, if None, the weights will be initialized randomly if not None, weights will be loaded from file
-
encode_data
(self, features)¶ Encodes data according to encoding method.
-
layers
(self, variables)¶ Layers of the model.
Depending on layer_type, the layers will either be custom or template
- Parameters
variables (list) – weights of the model
-
output_layer
(self)¶ Output layer.
- Returns
quantum observables
- Return type
list
-