pub struct TransformerBasedOptimizerConfig<T: Float + Debug + Send + Sync + 'static> {Show 22 fields
pub model_dimension: usize,
pub num_transformer_layers: usize,
pub num_attention_heads: usize,
pub attention_head_dimension: usize,
pub feedforward_dimension: usize,
pub sequence_length: usize,
pub dropout_rate: f64,
pub learning_rate: T,
pub batch_size: usize,
pub num_epochs: usize,
pub activation_function: ActivationFunction,
pub positional_encoding_type: PositionalEncodingType,
pub memory_config: MemoryConfig,
pub meta_learning_config: MetaLearningConfig<T>,
pub performance_config: PerformanceConfig,
pub enable_gradient_clipping: bool,
pub gradient_clip_value: T,
pub weight_decay: T,
pub warmup_steps: usize,
pub enable_layer_norm: bool,
pub use_pre_norm: bool,
pub enable_residual_connections: bool,
}
Expand description
Configuration for transformer-based optimizer
Fields§
§model_dimension: usize
Model dimension (embedding size)
num_transformer_layers: usize
Number of transformer layers
num_attention_heads: usize
Number of attention heads
attention_head_dimension: usize
Dimension of each attention head
feedforward_dimension: usize
Feed-forward network dimension
sequence_length: usize
Maximum sequence length
dropout_rate: f64
Dropout rate
learning_rate: T
Learning rate
batch_size: usize
Batch size for training
num_epochs: usize
Number of training epochs
activation_function: ActivationFunction
Activation function type
positional_encoding_type: PositionalEncodingType
Positional encoding type
memory_config: MemoryConfig
Memory management configuration
meta_learning_config: MetaLearningConfig<T>
Meta-learning configuration
performance_config: PerformanceConfig
Performance tracking configuration
enable_gradient_clipping: bool
Enable gradient clipping
gradient_clip_value: T
Gradient clipping threshold
weight_decay: T
Weight decay factor
warmup_steps: usize
Warmup steps for learning rate schedule
enable_layer_norm: bool
Enable layer normalization
use_pre_norm: bool
Pre-norm vs post-norm
enable_residual_connections: bool
Enable residual connections
Implementations§
Source§impl<T: Float + Debug + Send + Sync + 'static> TransformerBasedOptimizerConfig<T>
impl<T: Float + Debug + Send + Sync + 'static> TransformerBasedOptimizerConfig<T>
Sourcepub fn for_training() -> Self
pub fn for_training() -> Self
Create configuration optimized for training
Sourcepub fn for_inference() -> Self
pub fn for_inference() -> Self
Create configuration optimized for inference
Sourcepub fn estimate_parameter_count(&self) -> usize
pub fn estimate_parameter_count(&self) -> usize
Calculate total parameters estimate
Sourcepub fn estimate_memory_usage(&self) -> f64
pub fn estimate_memory_usage(&self) -> f64
Calculate memory requirements (in MB)
Trait Implementations§
Source§impl<T: Clone + Float + Debug + Send + Sync + 'static> Clone for TransformerBasedOptimizerConfig<T>
impl<T: Clone + Float + Debug + Send + Sync + 'static> Clone for TransformerBasedOptimizerConfig<T>
Source§fn clone(&self) -> TransformerBasedOptimizerConfig<T>
fn clone(&self) -> TransformerBasedOptimizerConfig<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug + Float + Debug + Send + Sync + 'static> Debug for TransformerBasedOptimizerConfig<T>
impl<T: Debug + Float + Debug + Send + Sync + 'static> Debug for TransformerBasedOptimizerConfig<T>
Source§impl<T: Float + Debug + Send + Sync + 'static> Default for TransformerBasedOptimizerConfig<T>
impl<T: Float + Debug + Send + Sync + 'static> Default for TransformerBasedOptimizerConfig<T>
Source§impl<'de, T> Deserialize<'de> for TransformerBasedOptimizerConfig<T>
impl<'de, T> Deserialize<'de> for TransformerBasedOptimizerConfig<T>
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>,
Auto Trait Implementations§
impl<T> Freeze for TransformerBasedOptimizerConfig<T>where
T: Freeze,
impl<T> RefUnwindSafe for TransformerBasedOptimizerConfig<T>where
T: RefUnwindSafe,
impl<T> Send for TransformerBasedOptimizerConfig<T>
impl<T> Sync for TransformerBasedOptimizerConfig<T>
impl<T> Unpin for TransformerBasedOptimizerConfig<T>where
T: Unpin,
impl<T> UnwindSafe for TransformerBasedOptimizerConfig<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.