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:
SIRENKernelNDSIRENKernelND whose first-layer ω₀ is multiplied by a learnable per-row scale.
Identical to
SIRENKernelNDexcept the positional embedding is aLearnableOmegaSIRENPositionalEmbeddingND. The hidden and output layers retain the usual SIREN init athidden_omega_0.With
omega_0_scale_init = 1.0(the default) the kernel produced at init is bit-for-bit identical to aSIRENKernelNDbuilt with the same scalaromega_0and 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 lengthembedding_dim. SeeLearnableOmegaSIRENPositionalEmbeddingNDfor 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)
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 inSIRENKernelND.- positional_embedding#
First layer with learnable per-row omega_0 scale; replaces the parent’s
SIRENPositionalEmbeddingND.
The attributes
hidden_linears,sine,out_linearandfilm_generatorare inherited unchanged fromSIRENKernelND.- __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.