BlockDiagonalMultiOmegaSIRENKernelND#
- class BlockDiagonalMultiOmegaSIRENKernelND(
- out_dim,
- data_dim,
- mlp_hidden_dim,
- num_layers,
- embedding_dim,
- L_cache,
- use_bias,
- num_blocks=8,
- omega_0_min=1.0,
- omega_0_max=12.0,
- schedule='linear',
- off_block_scale=0.1,
- omega_0_per_block=None,
- hidden_omega_0=1.0,
- film_cfg=None,
- film_after_pos_embed=False,
Bases:
MultiOmegaSIRENKernelNDPer-block ω₀ + (near-)block-diagonal MLP init for a SIREN kernel.
Extends
MultiOmegaSIRENKernelNDin two ways:The first-layer ω₀ is piecewise-constant across
num_blocksequal groups of embedding rows, with ω₀ for block k drawn from alinearorlogschedule over[omega_0_min, omega_0_max].Every hidden linear and the output linear have their weights multiplied by a block mask: weights on the block diagonal are preserved at 1.0, off-diagonal entries are scaled by
off_block_scale. At init this reduces cross-correlation between output channels of different blocks, so early in training each block behaves like a small independent SIREN tuned to its own frequency band. Training is free to fill in the off-block weights via gradient flow (they start small but are unconstrained).
With
off_block_scale = 0.0the kernel is mathematically equivalent at init to K parallel SIRENs (sharing seeds) packed into a single dense SIREN. Withoff_block_scale = 1.0the block structure is invisible at init and we recover the parentMultiOmegaSIRENKernelND.embedding_dim,mlp_hidden_dim, andout_dimmust all be divisible bynum_blocks.Production defaults (chosen from a spectral-coverage study on the N=29 grid used by the
vit5_hybridconfig):num_blocks=8,omega_0_min=1.0,omega_0_max=12.0,schedule="linear",off_block_scale=0.1.When changing grid resolution by a factor
m, the schedule should be scaled uniformly bym(omega_0_min *= m,omega_0_max *= m) to preserve the Nyquist-normalized spectral coverage. This variant should be paired withBlockAlignedGaussianModulationNDso that the widest Gaussians land on the lowest-ω₀ block.- Parameters:
out_dim (int) – Number of output channels for the generated kernel.
data_dim (int) – Number of spatial/temporal input dimensions.
mlp_hidden_dim (int) – Hidden width of the SIREN MLP.
num_layers (int) – Total number of SIREN layers (>= 2).
embedding_dim (int) – Positional-embedding dimensionality.
use_bias (bool) – Whether to include biases in linear layers.
num_blocks (int) – Number of ω₀ blocks. Must divide all of
embedding_dim,mlp_hidden_dim, andout_dim.omega_0_min (float) – Endpoints of the schedule (ignored if
omega_0_per_blockis supplied).omega_0_max (float) – Endpoints of the schedule (ignored if
omega_0_per_blockis supplied).schedule (str) –
"linear"or"log".off_block_scale (float) – Scale applied to off-block entries in hidden + output linears at init.
0.0→ strict block-diagonal;1.0→ equivalent to the parent.omega_0_per_block (Sequence[float] | Tensor | None) – Optional explicit ω₀ schedule of length
num_blocks. When supplied, overridesomega_0_min/omega_0_max/schedule.hidden_omega_0 (float) – Same as the parent.
film_cfg (LazyConfig | None) – Same as the parent.
film_after_pos_embed (bool) – Same as the parent.
- omega_0_per_block#
Non-persistent float32 buffer of shape
[num_blocks]holding the per-block omega_0 schedule.- Type:
- positional_embedding#
Per-row omega_0 positional encoder (constant within each block).
- hidden_linears, out_linear, omega_0_per_row
Inherited from
MultiOmegaSIRENKernelND; see that class.
- __init__(
- out_dim,
- data_dim,
- mlp_hidden_dim,
- num_layers,
- embedding_dim,
- L_cache,
- use_bias,
- num_blocks=8,
- omega_0_min=1.0,
- omega_0_max=12.0,
- schedule='linear',
- off_block_scale=0.1,
- omega_0_per_block=None,
- hidden_omega_0=1.0,
- film_cfg=None,
- film_after_pos_embed=False,
Initialize the block-diagonal SIREN kernel; see the class docstring for argument semantics.