pub struct DdlConfig {Show 16 fields
pub d_model: usize,
pub num_layers: usize,
pub num_heads: usize,
pub vocab_size: usize,
pub d_value: usize,
pub head_dim: usize,
pub mlp_hidden: usize,
pub mapping: DdlMapping,
pub beta_init: f64,
pub beta_single_linear: bool,
pub k_eps: f64,
pub compression: CompressionVariant,
pub shortconv_kernel_size: usize,
pub embed_conv: bool,
pub max_seq_len: usize,
pub rope_theta: f32,
}Fields§
§d_model: usize§num_layers: usize§num_heads: usize§vocab_size: usize§d_value: usize§head_dim: usize§mapping: DdlMapping§beta_init: f64§beta_single_linear: bool§k_eps: f64§compression: CompressionVariant§shortconv_kernel_size: usize§embed_conv: bool§max_seq_len: usize§rope_theta: f32Implementations§
Source§impl DdlConfig
impl DdlConfig
Sourcepub fn with_d_value(self, d_value: usize) -> Self
pub fn with_d_value(self, d_value: usize) -> Self
Set the default value for the field.
Sourcepub fn with_head_dim(self, head_dim: usize) -> Self
pub fn with_head_dim(self, head_dim: usize) -> Self
Set the default value for the field.
Set the default value for the field.
Sourcepub fn with_mapping(self, mapping: DdlMapping) -> Self
pub fn with_mapping(self, mapping: DdlMapping) -> Self
Set the default value for the field.
Sourcepub fn with_beta_init(self, beta_init: f64) -> Self
pub fn with_beta_init(self, beta_init: f64) -> Self
Set the default value for the field.
Sourcepub fn with_beta_single_linear(self, beta_single_linear: bool) -> Self
pub fn with_beta_single_linear(self, beta_single_linear: bool) -> Self
Set the default value for the field.
Sourcepub fn with_k_eps(self, k_eps: f64) -> Self
pub fn with_k_eps(self, k_eps: f64) -> Self
Set the default value for the field.
Sourcepub fn with_compression(self, compression: CompressionVariant) -> Self
pub fn with_compression(self, compression: CompressionVariant) -> Self
Set the default value for the field.
Sourcepub fn with_shortconv_kernel_size(self, shortconv_kernel_size: usize) -> Self
pub fn with_shortconv_kernel_size(self, shortconv_kernel_size: usize) -> Self
Set the default value for the field.
Sourcepub fn with_embed_conv(self, embed_conv: bool) -> Self
pub fn with_embed_conv(self, embed_conv: bool) -> Self
Set the default value for the field.
Sourcepub fn with_max_seq_len(self, max_seq_len: usize) -> Self
pub fn with_max_seq_len(self, max_seq_len: usize) -> Self
Set the default value for the field.
Sourcepub fn with_rope_theta(self, rope_theta: f32) -> Self
pub fn with_rope_theta(self, rope_theta: f32) -> Self
Set the default value for the field.
Source§impl DdlConfig
impl DdlConfig
pub fn validate(&self) -> Result<(), ConfigValidationError>
pub fn effective_head_dim(&self) -> usize
pub fn uses_matrix_state(&self) -> bool
pub fn try_init<B: Backend>( &self, device: &B::Device, ) -> Result<DdlTransformer<B>, ConfigValidationError>
pub fn init<B: Backend>(&self, device: &B::Device) -> DdlTransformer<B>
Trait Implementations§
Source§impl Config for DdlConfig
impl Config for DdlConfig
Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl<'de> Deserialize<'de> for DdlConfig
impl<'de> Deserialize<'de> for DdlConfig
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
impl StructuralPartialEq for DdlConfig
Auto Trait Implementations§
impl Freeze for DdlConfig
impl RefUnwindSafe for DdlConfig
impl Send for DdlConfig
impl Sync for DdlConfig
impl Unpin for DdlConfig
impl UnsafeUnpin for DdlConfig
impl UnwindSafe for DdlConfig
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