LearnableOmegaSIRENKernelND#

class LearnableOmegaSIRENKernelND(
out_dim,
data_dim,
mlp_hidden_dim,
num_layers,
embedding_dim,
omega_0,
L_cache,
use_bias,
omega_0_scale_init=1.0,
omega_0_scale_min=1e-2,
omega_0_scale_max=2.0,
hidden_omega_0=1.0,
apply_lr_scale=False,
film_cfg=None,
film_after_pos_embed=False,
)#

Bases: SIRENKernelND

SIRENKernelND whose first-layer ω₀ is multiplied by a learnable per-row scale.

Identical to SIRENKernelND except the positional embedding is a LearnableOmegaSIRENPositionalEmbeddingND. The hidden and output layers retain the usual SIREN init at hidden_omega_0.

With omega_0_scale_init = 1.0 (the default) the kernel produced at init is bit-for-bit identical to a SIRENKernelND built with the same scalar omega_0 and seed (modulo the float32-mid-cast in the new positional embedding’s forward, which is numerically more accurate than the parent’s path under autocast). During training the model can learn an effective per-row ω₀ in [omega_0 · omega_0_scale_min, omega_0 · omega_0_scale_max].

Parameters:
  • omega_0 (float) – Constant scalar absorbed into the per-iteration 2π·ω₀ factor inside the first-layer sine.

  • omega_0_scale_init (float | Sequence[float] | Tensor) – Initial value of the learnable per-row scale — either a single float (default 1.0) or a 1-D sequence/tensor of length embedding_dim. See LearnableOmegaSIRENPositionalEmbeddingND for details.

  • omega_0_scale_min (float) – Lower clamp on the per-row scale.

  • omega_0_scale_max (float) – Upper clamp on the per-row scale.

  • apply_lr_scale (bool) – Forwarded to the positional embedding. Default False.

  • out_dim (int)

  • data_dim (int)

  • mlp_hidden_dim (int)

  • num_layers (int)

  • embedding_dim (int)

  • L_cache (int | Sequence[int])

  • use_bias (bool)

  • hidden_omega_0 (float)

  • film_cfg (LazyConfig | None)

  • film_after_pos_embed (bool)

All other constructor arguments (out_dim, data_dim, mlp_hidden_dim, num_layers, embedding_dim, L_cache, use_bias, hidden_omega_0, film_cfg, film_after_pos_embed) have the same meaning as in SIRENKernelND.

positional_embedding#

First layer with learnable per-row omega_0 scale; replaces the parent’s SIRENPositionalEmbeddingND.

Type:

LearnableOmegaSIRENPositionalEmbeddingND

The attributes hidden_linears, sine, out_linear and film_generator are inherited unchanged from SIRENKernelND.

__init__(
out_dim,
data_dim,
mlp_hidden_dim,
num_layers,
embedding_dim,
omega_0,
L_cache,
use_bias,
omega_0_scale_init=1.0,
omega_0_scale_min=1e-2,
omega_0_scale_max=2.0,
hidden_omega_0=1.0,
apply_lr_scale=False,
film_cfg=None,
film_after_pos_embed=False,
)#

Initialize the learnable-omega SIREN kernel; see the class docstring for argument semantics.

Parameters: