pub struct LayerArrayConfig {Show 24 fields
pub input_size: usize,
pub condition_size: usize,
pub channels: usize,
pub bottleneck: usize,
pub dilations: Vec<usize>,
pub kernel_sizes: Vec<usize>,
pub activations: Vec<ActivationSpec>,
pub gating_modes: Vec<GatingMode>,
pub secondary_activations: Vec<ActivationSpec>,
pub groups_input: usize,
pub groups_input_mixin: usize,
pub head_size: usize,
pub head_kernel_size: usize,
pub head_bias: bool,
pub layer1x1: Layer1x1Config,
pub head1x1: Head1x1Config,
pub conv_pre_film: FilmConfig,
pub conv_post_film: FilmConfig,
pub input_mixin_pre_film: FilmConfig,
pub input_mixin_post_film: FilmConfig,
pub activation_pre_film: FilmConfig,
pub activation_post_film: FilmConfig,
pub layer1x1_post_film: FilmConfig,
pub head1x1_post_film: FilmConfig,
}Expand description
Configuration for one WaveNet layer-array, normalized so every per-layer
quantity is a Vec of length dilations.len(). Built from the on-disk JSON by
the internal RawLayerArrayConfig::normalize; A1 files fill the A2 fields with
defaults.
Fields§
§input_size: usizeInput channels into the array (1 for the first array).
condition_size: usizeConditioning signal width.
channels: usizeHidden channel count between layers.
bottleneck: usizeInternal per-layer width (defaults to channels).
dilations: Vec<usize>Per-layer dilation factors; its length defines the number of layers.
kernel_sizes: Vec<usize>Per-layer dilated-conv kernel sizes (length == dilations.len()).
activations: Vec<ActivationSpec>Per-layer primary activations (length == dilations.len()).
gating_modes: Vec<GatingMode>Per-layer gating modes (length == dilations.len()).
secondary_activations: Vec<ActivationSpec>Per-layer secondary activations (for gating); element may be the default
(a Named{"Sigmoid"}) where unspecified. Length == dilations.len().
groups_input: usizeGrouped-conv groups for the dilated conv.
groups_input_mixin: usizeGrouped-conv groups for the input mixer.
head_size: usizeHead rechannel output width.
head_kernel_size: usizeHead rechannel kernel size (1 for A1; e.g. 16 for A2 conv heads).
head_bias: boolWhether the head rechannel has a bias.
layer1x1: Layer1x1ConfigResidual 1×1 config.
head1x1: Head1x1ConfigHead 1×1 config.
conv_pre_film: FilmConfigFiLM: applied to the layer input before the dilated conv.
conv_post_film: FilmConfigFiLM: applied to the dilated-conv output.
input_mixin_pre_film: FilmConfigFiLM: applied to the conditioning before the input mixer.
input_mixin_post_film: FilmConfigFiLM: applied to the input-mixer output.
activation_pre_film: FilmConfigFiLM: applied to the conv+mixin sum before activation.
activation_post_film: FilmConfigFiLM: applied to the activation output.
layer1x1_post_film: FilmConfigFiLM: applied to the layer1x1 output (BLENDED branch only, per NAMCore).
head1x1_post_film: FilmConfigFiLM: applied to the head1x1 output.
Implementations§
Source§impl LayerArrayConfig
impl LayerArrayConfig
Sourcepub fn gating_mode(&self) -> GatingMode
pub fn gating_mode(&self) -> GatingMode
The array’s uniform gating mode.
normalize() produces one gating_modes entry per layer, and the runtime
guards that they are all equal before building (mixed modes are an
UnsupportedFeature). This accessor encapsulates that post-guard invariant
— the single uniform mode — instead of indexing gating_modes[0] at each use
site (which would panic on a directly-constructed empty-vec config, since the
struct is pub). Returns GatingMode::None for an empty list.
Trait Implementations§
Source§impl Clone for LayerArrayConfig
impl Clone for LayerArrayConfig
Source§fn clone(&self) -> LayerArrayConfig
fn clone(&self) -> LayerArrayConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more