Gaussian-ring power spectrum (default), minor bugfixes, and two new user notebooks - #50
Merged
Conversation
…t, added a user notebook comparing synthesis with full or small representation
Replace hard square crop masks with smooth cosine apodization in the FFT and Kernel implementations. Preserve per-bin border scales and all-ones behavior for zero-width borders to avoid square artifacts in PS gradients.
Add logarithmic Gaussian radial bands with configurable Jmin and bin count, expose the estimator choice through ST_Operator, and align periodic and non-periodic PS evaluation with the reference implementation.
…as default - Port gaussian_rings power_spectrum_method (Jmin, log-Gaussian bins, hard/smooth crop dispatch, einsum) from STL_2D_FFT_Torch to STL_2D_Kernel_Torch - Set power_spectrum_method='gaussian_rings' as the default in both CS_operator __init__ (was 'legacy')
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.
Summary
This PR bundles three pieces of work on the
fix_minor_bugsbranch:Minor bugfixes
operator's working precision, causing a dtype mismatch in the convolution depending on
device (reproducible on CPU when MPS is available). (
c21aab6)to_flatten(ST_Statistics.py):mean/var(real-valued) weren'tpromoted to complex before concatenation with the other statistics (S1-S4, PS), breaking
to_flattenin some configurations. (6af098c)crop with a smooth cosine apodization, avoiding square artifacts in the PS gradient in the
non-PBC case. (
807531e)scale_ft. (98df25f)Two new user notebooks
docs/user_notebook/synthesis_reduced_representation.ipynb: synthesis from acompressed/reduced statistical representation, compared against the full representation.
(
98df25f)docs/user_notebook/component_separation_notebook.ipynb: component separation. (2364622)Power spectrum / cross-spectrum with Gaussian bins, set as default
power_spectrum_method="gaussian_rings"):logarithmic Gaussian bands, with configurable bounds via
Jmin, first inSTL_2D_FFT_Torch(b09d7a5), then ported toSTL_2D_Kernel_Torchto cover bothDataClasses symmetrically (
5a1ffd7).power_spectrum_methodandJminare exposed generically throughST_Operator, sothey're available to any DataClass that implements its own bin-mask logic (not just
FFT/Kernel).
gaussian_ringsis now the default method (power_spectrum_method="gaussian_rings"in both
CS_operator_2D_FFT_torch.__init__andCS_operator_2D_Kernel_Torch.__init__),replacing
"legacy". The old method remains available viapower_spectrum_method="legacy".CS_operatoras the cross-spectrum (by only filling thediagonal of
compute_cross_spectrum_matrix), so this default change applies consistentlyacross all entry points (
get_ST_op, directget_CS_op).