Struct GatedMlpConfig
pub struct GatedMlpConfig {
pub d_model: usize,
pub d_intermediate: usize,
pub multiple_of: usize,
pub has_proj_bias: bool,
}Expand description
Configuration to create a GatedMlp.
Fields§
§d_model: usizeInput and output width (the residual stream), d_model.
d_intermediate: usizeInner width before rounding — d_intermediate in the reference
configs. Rounded up to a multiple of Self::multiple_of by
Self::hidden.
multiple_of: usizeRound Self::d_intermediate up to a multiple of this.
has_proj_bias: boolWhether fc1/fc2 carry a bias term.
Implementations§
§impl GatedMlpConfig
impl GatedMlpConfig
pub fn new(d_model: usize, d_intermediate: usize) -> GatedMlpConfig
pub fn new(d_model: usize, d_intermediate: usize) -> GatedMlpConfig
Create a new instance of the config.
§Arguments
§Required Arguments
§d_model
Input and output width (the residual stream), d_model.
§d_intermediate
Inner width before rounding — d_intermediate in the reference
configs. Rounded up to a multiple of Self::multiple_of by
Self::hidden.
§Default Arguments
§multiple_of
Round Self::d_intermediate up to a multiple of this.
- Defaults to
128
§has_proj_bias
Whether fc1/fc2 carry a bias term.
- Defaults to
false
§impl GatedMlpConfig
impl GatedMlpConfig
pub fn with_multiple_of(self, multiple_of: usize) -> GatedMlpConfig
pub fn with_multiple_of(self, multiple_of: usize) -> GatedMlpConfig
Sets the value for the field multiple_of.
Round Self::d_intermediate up to a multiple of this.
- Defaults to
128
pub fn with_has_proj_bias(self, has_proj_bias: bool) -> GatedMlpConfig
pub fn with_has_proj_bias(self, has_proj_bias: bool) -> GatedMlpConfig
§impl GatedMlpConfig
impl GatedMlpConfig
The realised inner width: Self::d_intermediate rounded up to a
multiple of Self::multiple_of.
Trait Implementations§
§impl Clone for GatedMlpConfig
impl Clone for GatedMlpConfig
§fn clone(&self) -> GatedMlpConfig
fn clone(&self) -> GatedMlpConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more