Add modern complex-valued architectures (2.1.0) - #13
Merged
Conversation
josiahwsmith10
force-pushed
the
feat/modern-cvnn-architectures
branch
2 times, most recently
from
June 21, 2026 13:33
4905ead to
d377f1a
Compare
A large modern-architecture expansion of complextorch.nn / .models / .signal: - Positional encodings: RotaryEmbedding (RoPE), SinusoidalPositionalEncoding, CoPE; wired into MultiheadAttention (rotary=) and ViT (pos_encoding=). - Holographic (interference-aware) attention + HolographicReconstructionLoss and phase_smoothness anti-phase-collapse safeguards. - Diagonal-complex state-space models: S4D, DSS, S4DBlock, and a selective MambaBlock (FFT long-conv == exact recurrence, verified). - Unitary complex RNN (UnitaryRNN/Cell) via the Cayley transform. - Learnable time-frequency front-ends: STFT/InverseSTFT (tie windows for exact inversion) and ComplexGaborConv1d/MorletConv1d filterbanks. - Complex-valued KAN (CVKANLayer + CVKAN model). - Steinmetz & Analytic networks + AnalyticSignalLoss; analytic_signal/hilbert signal utilities. Also fixes wFMConvStrict2d to compute the phase mean as the circular (Fréchet) mean on SO(2) instead of an arithmetic mean of raw angles — correct across the ±π branch cut and exactly U(1)-equivariant. Lands with full tests (100% coverage maintained), rST/LaTeX docstrings, concept pages, getting-started examples, and a CHANGELOG entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
josiahwsmith10
force-pushed
the
feat/modern-cvnn-architectures
branch
from
June 21, 2026 13:37
d377f1a to
e9e5273
Compare
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.
A large modern-architecture expansion of
complextorch.nn/.models/.signal, landing as 2.1.0. Single commit, 100% coverage maintained,sphinx -Wdocs build clean.What's added
RotaryEmbedding(RoPE),SinusoidalPositionalEncoding,CoPE; wired intoMultiheadAttention(rotary=)andViT(pos_encoding=). (The native transformer had no positional encoding — this fills a real gap.)MultiheadAttention(attention="holographic"). PlusHolographicReconstructionLossandphase_smoothness.S4D/DSS(HiPPO-Lin diagonal-complex, FFT long-conv) +S4DBlock+ selectiveMambaBlock. Invariant test: FFT kernel == exact recurrence.UnitaryRNN/UnitaryRNNCell(Cayley-transform norm-preserving recurrence).STFT/InverseSTFT(learnable window; tie windows for exact inverse) andComplexGaborConv1d/MorletConv1d.CVKANLayer+CVKANmodel.SteinmetzNetwork,AnalyticNeuralNetwork,AnalyticSignalLoss, andsignal.analytic_signal/signal.hilbert.Each feature ships with mirrored tests, rST/LaTeX docstrings, a concept page, getting-started examples, and a CHANGELOG entry.
Review notes
A high-effort multi-agent code review was run; fixes folded into this commit:
istft.window = stft.window, added a tied-window test).The review also flagged a phase branch-cut in the pre-existing
wFMConvStrict2d. Investigated against the original author's source (RotLieNet/ SurReal): the reference computes the same weighted arithmetic mean of raw angles, so our port is faithful — documented the known limitation rather than diverging from the reference.Deferred (filed as issues)
#10 Mamba parallel-scan kernel · #11 complex GNNs (MagNet) · #12 complex generative models.
🤖 Generated with Claude Code