igl.nn
Bare PyTorch entry point for custom training loops.
igl.nn.module.IGLModule
Bases: Module
End-to-end IGL model: x → z → Φ → Φ w + b.
The readout weights source_weights are not learned by gradient
descent — they are refreshed in closed form by
:func:igl.direct_solve_weights (called by :class:MatryoshkaTrainer).
The bias is a learnable parameter; the encoder and Green-kernel
parameters are too — only the readout is closed-form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_dim
|
int
|
Ambient input dimension |
required |
max_dim
|
int
|
Latent dimension |
required |
output_dim
|
int
|
Output dimension ( |
required |
n_anchors
|
int | None
|
Number of anchors |
None
|
n_scales
|
int | None
|
Number of kernel scales |
None
|
operator
|
OperatorNameLike | None
|
Single operator name. |
None
|
encoder
|
EncoderProtocol | None
|
Optional pre-built encoder satisfying
:class: |
None
|
encoder_config
|
EncoderConfig | None
|
Optional :class: |
None
|
normalize
|
NormalizeModeLike | None
|
Φ-normalization mode. |
None
|
normalize_input
|
bool
|
If |
False
|
config
|
IGLConfig | None
|
Optional top-level :class: |
None
|
Raises:
| Type | Description |
|---|---|
IGLConfigError
|
For dimension mismatches, conflicting parameters,
non-positive dimensions, or an explicit |
design_matrix(x, *, gate_mask=None)
Compute the normalised design matrix Φ from raw input x.
forward(x, *, gate_mask=None)
Forward pass returning Φ w + b of shape [N, output_dim].
latent(x)
Return the latent encoding z = Encoder(x).
set_source_weights(weights)
Replace the closed-form readout weights with weights [R, C].