I am using NeuralNetworkClassifier
to fit a CircuitQNN
for a classification of output_shape=4
.
output_shape = 4
qnn = CircuitQNN(circuit=circuit,
input_params=list(feature_map.parameters),
weight_params=list(ansatz.parameters),
interpret=parity,
output_shape=output_shape,
gradient=Gradient(),
quantum_instance=q_instance)
classifier = NeuralNetworkClassifier(qnn, optimizer=gd)
gd
is Qiskit's GradientDescent
.
classifier.fit(X_train, y_train)
For several days, I have tried to rerun all the code on the notebook, but it keeps getting stuck at the fitting stage. My GradientDescent
has maxiter=100
, and my training data is 160 in length. Does the fitting usually take this long, or am I doing something wrong?