pub struct GaVadLayer<'a> {Show 16 fields
pub norm_ff1: (&'a [f32], &'a [f32]),
pub ff1: (GaLin<'a>, GaLin<'a>),
pub norm_att: (&'a [f32], &'a [f32]),
pub q: GaLin<'a>,
pub k: GaLin<'a>,
pub v: GaLin<'a>,
pub o: GaLin<'a>,
pub norm_conv: (&'a [f32], &'a [f32]),
pub pw1: GaLin<'a>,
pub taps: &'a [f32],
pub dw_b: &'a [f32],
pub conv_norm: (&'a [f32], &'a [f32]),
pub pw2: GaLin<'a>,
pub norm_ff2: (&'a [f32], &'a [f32]),
pub ff2: (GaLin<'a>, GaLin<'a>),
pub norm_out: (&'a [f32], &'a [f32]),
}Expand description
One layer of GigaAM’s voice-activity Conformer for gigaam_vad, over
rows r ([n, dim]); a norm is LayerNorm (weight, bias, eps 1e-5):
r += ½·ff1(norm_ff1(r)) (linear, SiLU, linear);
xn = norm_att(r), queries and keys from q / k of xn rotated by the
step’s angles (lane j of a head with lane j + head_dim/2), values from v
of xn itself, attention inside a window, r += o(context);
u = pw1(norm_conv(r)) ([n, 2·dim]), g = u[..dim]·σ(u[dim..]), a
depthwise convolution over time inside the window (taps [kernel][dim],
zeros outside), r += pw2(silu(conv_norm(conv)));
r += ½·ff2(norm_ff2(r)); r = norm_out(r).
Fields§
§norm_ff1: (&'a [f32], &'a [f32])§ff1: (GaLin<'a>, GaLin<'a>)§norm_att: (&'a [f32], &'a [f32])§q: GaLin<'a>§k: GaLin<'a>§v: GaLin<'a>§o: GaLin<'a>§norm_conv: (&'a [f32], &'a [f32])§pw1: GaLin<'a>§taps: &'a [f32]§dw_b: &'a [f32]§conv_norm: (&'a [f32], &'a [f32])§pw2: GaLin<'a>§norm_ff2: (&'a [f32], &'a [f32])§ff2: (GaLin<'a>, GaLin<'a>)§norm_out: (&'a [f32], &'a [f32])Auto Trait Implementations§
impl<'a> !RefUnwindSafe for GaVadLayer<'a>
impl<'a> !UnwindSafe for GaVadLayer<'a>
impl<'a> Forget for GaVadLayer<'a>
impl<'a> Freeze for GaVadLayer<'a>
impl<'a> Move for GaVadLayer<'a>
impl<'a> Send for GaVadLayer<'a>
impl<'a> Sync for GaVadLayer<'a>
impl<'a> Unpin for GaVadLayer<'a>
impl<'a> UnsafeUnpin for GaVadLayer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more