Skip to content
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

Adjusting the parameters for QuantumMDM (class and pipeline) #230

Merged
merged 8 commits into from
Dec 20, 2023

Conversation

toncho11
Copy link
Collaborator

@toncho11 toncho11 commented Dec 19, 2023

This is PR is part of #156

  • Removing un unused parameter "gen_feature_map" for QuantumMDM
  • Adding a new parameter "upper_bound" for QuantumMDM

@gcattan
Copy link
Collaborator

gcattan commented Dec 19, 2023

Thanks @toncho11 ! Feel free to merge when you are ready

@gcattan gcattan self-requested a review December 19, 2023 19:08
@toncho11
Copy link
Collaborator Author

There is some kind of problem. It prevents classify_P300_bi_quantum_mdm.py from completing.

 File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\docplex\mp\mfactory.py", line 362, in _expand_bounds
    fn_bounds = [var_bound(k) for k in keys]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\docplex\mp\mfactory.py", line 362, in <listcomp>
    fn_bounds = [var_bound(k) for k in keys]
                 ^^^^^^^^^^^^
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\pyriemann_qiskit\utils\hyper_params_factory.py", line 132, in <lambda>
    return lambda n_features: ZZFeatureMap(
                              ^^^^^^^^^^^^^
  File "C:\Work\PythonCode\pyRiemann-qiskit\pyq_env\Lib\site-packages\qiskit\circuit\library\data_preparation\zz_feature_map.py", line 99, in __init__
    if feature_dimension < 2:
       ^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'tuple' and 'int'

It a feature map function is always assigned in the base class even if not needed.

@gcattan
Copy link
Collaborator

gcattan commented Dec 19, 2023

Ok, I see. There are some leftovers in the pipelines.py script for QuantumMDM pipelines.
Can you try to replace them with the upper-bound coefficient?

@gcattan
Copy link
Collaborator

gcattan commented Dec 19, 2023

Sorry, it am mistaking. My precedent comment does not apply.

@toncho11
Copy link
Collaborator Author

It seems the problem is in the voting classifier. It still sets "gen_feature_map" for QuantumMDMWithRiemannianPipeline while this is indeed the "upper_bound" parameter now.

@toncho11 toncho11 merged commit 0448cbd into pyRiemann:main Dec 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants