Skip to main content

LayerArrayConfig

Struct LayerArrayConfig 

Source
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: usize

Input channels into the array (1 for the first array).

§condition_size: usize

Conditioning signal width.

§channels: usize

Hidden channel count between layers.

§bottleneck: usize

Internal 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: usize

Grouped-conv groups for the dilated conv.

§groups_input_mixin: usize

Grouped-conv groups for the input mixer.

§head_size: usize

Head rechannel output width.

§head_kernel_size: usize

Head rechannel kernel size (1 for A1; e.g. 16 for A2 conv heads).

§head_bias: bool

Whether the head rechannel has a bias.

§layer1x1: Layer1x1Config

Residual 1×1 config.

§head1x1: Head1x1Config

Head 1×1 config.

§conv_pre_film: FilmConfig

FiLM: applied to the layer input before the dilated conv.

§conv_post_film: FilmConfig

FiLM: applied to the dilated-conv output.

§input_mixin_pre_film: FilmConfig

FiLM: applied to the conditioning before the input mixer.

§input_mixin_post_film: FilmConfig

FiLM: applied to the input-mixer output.

§activation_pre_film: FilmConfig

FiLM: applied to the conv+mixin sum before activation.

§activation_post_film: FilmConfig

FiLM: applied to the activation output.

§layer1x1_post_film: FilmConfig

FiLM: applied to the layer1x1 output (BLENDED branch only, per NAMCore).

§head1x1_post_film: FilmConfig

FiLM: applied to the head1x1 output.

Implementations§

Source§

impl LayerArrayConfig

Source

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

Source§

fn clone(&self) -> LayerArrayConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LayerArrayConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.