Skip to content

Make Q2 customizable #854

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

Merged
merged 8 commits into from
Jun 17, 2022
Merged

Make Q2 customizable #854

merged 8 commits into from
Jun 17, 2022

Conversation

changhongw
Copy link
Collaborator

@changhongw changhongw commented Jun 8, 2022

Fix #853

This PR makes it flexible for users to specify the number of wavelets per octave at the first and second order scattering. Both cases are working:

  • Set Q as an integer: Q = Q1. In this case, we use Q1 wavelets per octave at the first order and that for the second order defaults to one.
  • Set Q as a tuple: Q = (Q1, Q2), where users can specify both Q1 and Q2 according to their needs.

@changhongw changhongw added this to the 0.3.alpha milestone Jun 8, 2022
@changhongw changhongw requested review from lostanlen and janden June 8, 2022 08:24
@changhongw changhongw changed the title Fix 853 Make Q2 customizable Jun 8, 2022
@lostanlen lostanlen changed the base branch from master to dev June 8, 2022 08:39
@lostanlen
Copy link
Collaborator

This is built on top of #850 , which closes #849

Copy link
Collaborator

@lostanlen lostanlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work, have you tested it?

The code looks greatl but the documentation could be improved a bit. See my comments

Thanks!

@lostanlen
Copy link
Collaborator

i have attempted a rebase. fingers crossed

@cyrusvahidi
Copy link
Collaborator

i have attempted a rebase. fingers crossed

yes the merge with your latest changes on dev should be sufficient

Copy link
Collaborator

@MuawizChaudhary MuawizChaudhary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds a feature where users can specify the Q parameter of the 2nd order wavelets.

I approve this change.

@lostanlen
Copy link
Collaborator

we're waiting for @cyrusvahidi to approve the tests

@changhongw changhongw requested a review from cyrusvahidi June 13, 2022 15:21
Copy link
Collaborator

@cyrusvahidi cyrusvahidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still need to check that for a dummy input Scattering1D returns the same thing for Q = (8, ) and Q = (8, 1)

@changhongw
Copy link
Collaborator Author

@changhongw changhongw closed this Jun 14, 2022
@changhongw changhongw deleted the fix-853 branch June 14, 2022 12:51
@changhongw changhongw restored the fix-853 branch June 14, 2022 12:51
@changhongw changhongw reopened this Jun 14, 2022
Copy link
Collaborator

@lostanlen lostanlen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like tests are passing again. It's just that the current error message is not accurate:

Q should be an integer, a 1-tuple, or a 2-tuple.

@lostanlen
Copy link
Collaborator

        if not A.is_cuda or not B.is_cuda:
>           raise TypeError('Input and filter must be CUDA tensors.')
E           TypeError: Input and filter must be CUDA tensors.

@lostanlen
Copy link
Collaborator

Thank you so much @changhongw 🎉

@lostanlen lostanlen merged commit a776d57 into kymatio:dev Jun 17, 2022
lostanlen added a commit to danedane-haider/kymatio that referenced this pull request Jun 19, 2022
in light of kymatio#854 and kymatio#882
enable TeX rendering
lostanlen added a commit that referenced this pull request Jun 20, 2022
by Daniel Haider and Vincent Lostanlen
approved by Muawiz Chaudhary and Joakim Andén

* Update plot_filters.py

* Update plot_filters.py

* Update plot_filters.py

Edits as required:
- original formatting
- line width reduction
- psi <- psi_i

* Update plot_filters.py

* update examples/1d/plot_filters

in light of #854 and #882
enable TeX rendering

Co-authored-by: Vincent Lostanlen <vincent.lostanlen@ls2n.fr>
eickenberg pushed a commit that referenced this pull request Jul 5, 2022
* move Q check to ScatteringBase1D.build

* Tuneable Q2

* test on GPU

* Update base_frontend.py

* Update base_frontend.py

* Update test_torch_scattering1d.py

* skip `_skcuda`

* Update test_torch_scattering1d.py

Co-authored-by: Vincent Lostanlen <vincent.lostanlen@ls2n.fr>
eickenberg pushed a commit that referenced this pull request Jul 5, 2022
by Daniel Haider and Vincent Lostanlen
approved by Muawiz Chaudhary and Joakim Andén

* Update plot_filters.py

* Update plot_filters.py

* Update plot_filters.py

Edits as required:
- original formatting
- line width reduction
- psi <- psi_i

* Update plot_filters.py

* update examples/1d/plot_filters

in light of #854 and #882
enable TeX rendering

Co-authored-by: Vincent Lostanlen <vincent.lostanlen@ls2n.fr>
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.

Q2 is not customizable
4 participants