pub struct FeedForwardConfig {
pub d_model: usize,
pub d_ff: usize,
pub activation: String,
pub dropout: f64,
}Expand description
Configuration for feed-forward network
Fields§
§d_model: usizeModel dimension (d_model)
d_ff: usizeHidden dimension (typically 4 * d_model)
activation: StringActivation function name
dropout: f64Dropout probability
Implementations§
Source§impl FeedForwardConfig
impl FeedForwardConfig
Sourcepub fn with_activation(self, activation: impl Into<String>) -> Self
pub fn with_activation(self, activation: impl Into<String>) -> Self
Set activation function
Sourcepub fn with_dropout(self, dropout: f64) -> Self
pub fn with_dropout(self, dropout: f64) -> Self
Set dropout probability
Trait Implementations§
Source§impl Clone for FeedForwardConfig
impl Clone for FeedForwardConfig
Source§fn clone(&self) -> FeedForwardConfig
fn clone(&self) -> FeedForwardConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeedForwardConfig
impl Debug for FeedForwardConfig
Source§impl<'de> Deserialize<'de> for FeedForwardConfig
impl<'de> Deserialize<'de> for FeedForwardConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FeedForwardConfig
impl PartialEq for FeedForwardConfig
Source§impl Serialize for FeedForwardConfig
impl Serialize for FeedForwardConfig
impl StructuralPartialEq for FeedForwardConfig
Auto Trait Implementations§
impl Freeze for FeedForwardConfig
impl RefUnwindSafe for FeedForwardConfig
impl Send for FeedForwardConfig
impl Sync for FeedForwardConfig
impl Unpin for FeedForwardConfig
impl UnwindSafe for FeedForwardConfig
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