Hindi
भाषाएँ
English
Bengali
French
Hindi
Italian
Japanese
Korean
Malayalam
Russian
Spanish
Tamil
Turkish
Vietnamese
Shortcuts



VQC

class VQC(num_qubits=None, feature_map=None, ansatz=None, loss='cross_entropy', optimizer=None, warm_start=False, quantum_instance=None, initial_point=None, callback=None)[स्रोत]

आधार: qiskit_machine_learning.algorithms.classifiers.neural_network_classifier.NeuralNetworkClassifier

Quantum neural network classifier.

मापदण्ड
  • num_qubits (Optional[int]) -- The number of qubits for the underlying CircuitQNN. If None, derive from feature_map or ansatz. If neither of those is given, raise exception.

  • feature_map (Optional[QuantumCircuit]) -- The feature map for underlying CircuitQNN. If None, use ZZFeatureMap.

  • ansatz (Optional[QuantumCircuit]) -- The ansatz for the underlying CircuitQNN. If None, use RealAmplitudes.

  • loss (Union[str, Loss]) -- A target loss function to be used in training. Default is cross entropy.

  • optimizer (Optional[Optimizer]) -- An instance of an optimizer to be used in training. When None defaults to SLSQP.

  • warm_start (bool) -- Use weights from previous fit to start next fit.

  • initial_point (Optional[ndarray]) -- Initial point for the optimizer to start from.

  • callback (Optional[Callable[[ndarray, float], None]]) -- a reference to a user's callback function that has two parameters and returns None. The callback can access intermediate data during training. On each iteration an optimizer invokes the callback and passes current weights as an array and a computed value as a float of the objective function being optimized. This allows to track how well optimization / training process is going on.

उभारता है

QiskitMachineLearningError -- Needs at least one out of num_qubits, feature_map or ansatz to be given.

Attributes

ansatz

Returns the used ansatz.

circuit

Returns the underlying quantum circuit.

feature_map

Returns the used feature map.

num_qubits

Returns the number of qubits used by ansatz and feature map.

Methods

fit(X, y)

Fit the model to data matrix X and targets y.