Conversation
ninamiolane
requested changes
Jan 19, 2026
| from bispectrum import SO3onS2 | ||
|
|
||
|
|
||
| def power_spectrum(coeffs: torch.Tensor) -> torch.Tensor: |
Contributor
There was a problem hiding this comment.
can we call it spherical_power_spectrum?
"power spectrum" makes it sound like it's the 2D translation fourier power spectrum and its confusing.
| # Power law decay l^-2 with meaningful high-frequency content | ||
| torch.manual_seed(42) # Reproducibility | ||
| truth_coeffs = torch.randn(1, LMAX + 1, LMAX + 1, dtype=torch.complex64, device=device) | ||
| for l in range(LMAX + 1): |
Contributor
There was a problem hiding this comment.
I think with the convention for lmax from SHT, you don't need to do the "+1". Double check?
I think their arrays are of length lmax, that is range(lmax).
| # Pre-compute the "Structural Fingerprint" (rotation-invariant bispectrum) | ||
| # In practice, this could come from physical constraints or a reference signal | ||
| with torch.no_grad(): | ||
| truth_invariants = bsp_module(truth_coeffs) |
| # --- 2. Generate "Input" (Blurry Observation) --- | ||
| # Heavily dampen high frequencies to simulate degraded observation | ||
| input_coeffs = truth_coeffs.clone().detach() | ||
| for l in range(3, LMAX + 1): |
| from bispectrum import SO3onS2 | ||
|
|
||
|
|
||
| def power_spectrum(coeffs: torch.Tensor) -> torch.Tensor: |
Contributor
There was a problem hiding this comment.
This is already define din the other file
| return corr.detach().cpu().numpy() | ||
|
|
||
|
|
||
| def run_deblurring_demo(): |
Contributor
There was a problem hiding this comment.
Not sure I understand the difference btw this demo and the other one. Clarify docstrings or remove one of the two files
| from bispectrum import SO3onS2 | ||
|
|
||
|
|
||
| def power_spectrum(coeffs: torch.Tensor) -> torch.Tensor: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.