-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update qiskit dependencies #51
Update qiskit dependencies #51
Conversation
…datasets/utils.py
# Conflicts: # pyriemann_qiskit/datasets/utils.py
- Change QSVM by SVC+quantum_kernel
|
||
class1, class0 = self._split_classes(X, y) | ||
y = self._map_classes_to_0_1(y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a mistake. The _map_classes_to_0_1
is now taking place after the _split_classes
.
if self.quantum: | ||
self._classifier.train(X, y, self._quantum_instance) | ||
else: | ||
self._classifier.train(X, y) | ||
self._classifier.fit(X, y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QSVC now inherint from SVC, so they have the same fit
, score
and predict
methods.
|
||
def _predict(self, X): | ||
self._log("Prediction: ", X.shape) | ||
print(self._training_input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably a left over from a previous refactoring.
else: | ||
classifier = SklearnSVM(self._training_input, gamma=self.gamma) | ||
classifier = SVC(gamma=self.gamma) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we use directly SVC, we can probably pass more than just gamma
as an hyperparameter
training_size=30, | ||
test_size=0, | ||
n=feature_dim, | ||
gap=0.3, | ||
plot_data=False | ||
) | ||
|
||
X = np.concatenate((inputs['A'], inputs['B'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure {inputs:{A:..., B:..}
seems to have disappeared from qiskit.
@@ -166,7 +166,7 @@ def get_params(self): | |||
# To achieve testing in a reasonnable amount of time, | |||
# we will lower the size of the feature and the number of trials | |||
return { | |||
"n_samples": 4, | |||
"n_samples": 6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error with vector dimension=4
did not give a clue on whether the problem is with the samples or the features.
One always needs to do that on Windows: How to fix “no lapack/blas resources found” on Windows |
Weird, I do not have this error on my local neither on the pipeline. Which test or example are you running ? |
It works!!! Using Bravo! But for the instillation it is better to first execute:
before Also it seems there is something wrong with scipy on Windows. It is a common problem. You may also need to install manually pyriemman from github to obtain pyriemman 0.2.8.dev0. |
Both tests and ERP moabb example work. |
Thanks for digging into this. I am so sorry, but I just remembered that the test requirements are listed as optional in the setup.py. |
I think these are missing from setup.py: |
The PR fixes #48, @toncho11 FYI
In addition to the refactoring of the QSVC into the
SVC+quantum
kernel, there was also a substantial amount of refactoring on the SPSA algorithm.