pub struct LayersBuilder<C> {
pub n_real_layers: usize,
pub n_virtual_layers: Option<(usize, Schedule)>,
pub mamba_block: C,
pub ignore_first_residual: bool,
pub ignore_last_residual: bool,
pub class_latents: Vec<ClassLatent>,
pub residuals: ResidualsConfig,
}Expand description
Plain (non-serde) factory for Layers. The serializable surface is the
concrete MambaLatentNetConfig enum; this is just the generic builder it
delegates to.
Fields§
§n_real_layers: usizeNumber of real (weight-bearing) layers.
n_virtual_layers: Option<(usize, Schedule)>Optional virtual-layer scheduling.
mamba_block: CShared block config.
ignore_first_residual: boolZero the first virtual layer’s residual.
ignore_last_residual: boolZero the last virtual layer’s residual.
class_latents: Vec<ClassLatent>Stack-level class latents (spliced once before the first virtual layer).
residuals: ResidualsConfigInter-layer residual scheme (defaults to plain additive).
Implementations§
Source§impl<C: MambaBlockConfig> LayersBuilder<C>
impl<C: MambaBlockConfig> LayersBuilder<C>
Sourcepub fn new(n_real_layers: usize, mamba_block: C) -> Self
pub fn new(n_real_layers: usize, mamba_block: C) -> Self
Builder with no virtual scheduling, no class latents, residuals enabled.
Sourcepub fn with_n_virtual_layers(self, n: Option<(usize, Schedule)>) -> Self
pub fn with_n_virtual_layers(self, n: Option<(usize, Schedule)>) -> Self
Set the optional virtual-layer scheduling.
Sourcepub fn with_residuals(self, residuals: ResidualsConfig) -> Self
pub fn with_residuals(self, residuals: ResidualsConfig) -> Self
Set the inter-layer residual scheme (plain additive vs Multi-Gate).
Sourcepub fn with_ignore_first_residual(self, ignore: bool) -> Self
pub fn with_ignore_first_residual(self, ignore: bool) -> Self
Suppress the first virtual layer’s residual (see Layers).
Sourcepub fn with_ignore_last_residual(self, ignore: bool) -> Self
pub fn with_ignore_last_residual(self, ignore: bool) -> Self
Suppress the last virtual layer’s residual (see Layers).