pub struct PointwiseFeedForwardConfig { /* private fields */ }Expand description
Configuration for pointwise feed-forward layers.
Implementations§
Source§impl PointwiseFeedForwardConfig
impl PointwiseFeedForwardConfig
Sourcepub fn activation(self, activation: Box<dyn BuildModule>) -> Self
pub fn activation(self, activation: Box<dyn BuildModule>) -> Self
Activation function.
Default: GELU
Sourcepub fn dropout(self, dropout: Box<dyn BuildModule>) -> Self
pub fn dropout(self, dropout: Box<dyn BuildModule>) -> Self
Dropout to apply after the feed-forward layer.
Default: Identity
Hidden width of the transformer.
Default: 768
Sourcepub fn intermediate_width(self, intermediate_width: usize) -> Self
pub fn intermediate_width(self, intermediate_width: usize) -> Self
Intermediate width in the feed-forward layer.
Default: 3072
Sourcepub fn layer_norm(self, layer_norm: Box<dyn BuildModule>) -> Self
pub fn layer_norm(self, layer_norm: Box<dyn BuildModule>) -> Self
Layer normalization module.
Default: Identity
Trait Implementations§
Source§impl BuildModule for PointwiseFeedForwardConfig
impl BuildModule for PointwiseFeedForwardConfig
Source§fn build(&self, vb: VarBuilder<'_>) -> Result<Box<dyn ModuleT>, BoxedError>
fn build(&self, vb: VarBuilder<'_>) -> Result<Box<dyn ModuleT>, BoxedError>
Build a module.
Source§impl Debug for PointwiseFeedForwardConfig
impl Debug for PointwiseFeedForwardConfig
Auto Trait Implementations§
impl Freeze for PointwiseFeedForwardConfig
impl !RefUnwindSafe for PointwiseFeedForwardConfig
impl !Send for PointwiseFeedForwardConfig
impl !Sync for PointwiseFeedForwardConfig
impl Unpin for PointwiseFeedForwardConfig
impl !UnwindSafe for PointwiseFeedForwardConfig
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more