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: MultiOmegaSIRENKernelND

Per-block ω₀ + (near-)block-diagonal MLP init for a SIREN kernel.

Extends MultiOmegaSIRENKernelND in two ways:

  1. The first-layer ω₀ is piecewise-constant across num_blocks equal groups of embedding rows, with ω₀ for block k drawn from a linear or log schedule over [omega_0_min, omega_0_max].

  2. 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.0 the kernel is mathematically equivalent at init to K parallel SIRENs (sharing seeds) packed into a single dense SIREN. With off_block_scale = 1.0 the block structure is invisible at init and we recover the parent MultiOmegaSIRENKernelND.

embedding_dim, mlp_hidden_dim, and out_dim must all be divisible by num_blocks.

Production defaults (chosen from a spectral-coverage study on the N=29 grid used by the vit5_hybrid config): 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 by m (omega_0_min *= m, omega_0_max *= m) to preserve the Nyquist-normalized spectral coverage. This variant should be paired with BlockAlignedGaussianModulationND so 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.

  • L_cache (int | Sequence[int]) – Cache extent.

  • 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, and out_dim.

  • omega_0_min (float) – Endpoints of the schedule (ignored if omega_0_per_block is supplied).

  • omega_0_max (float) – Endpoints of the schedule (ignored if omega_0_per_block is 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, overrides omega_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.

num_blocks#

Number of frequency blocks.

Type:

int

off_block_scale#

Off-diagonal weight scale applied at init.

Type:

float

omega_0_per_block#

Non-persistent float32 buffer of shape [num_blocks] holding the per-block omega_0 schedule.

Type:

torch.Tensor

positional_embedding#

Per-row omega_0 positional encoder (constant within each block).

Type:

MultiOmegaSIRENPositionalEmbeddingND

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.

Parameters: