pub struct TransformerOptimizerConfig {Show 22 fields
pub base_config: LearnedOptimizerConfig,
pub modeldim: usize,
pub numheads: usize,
pub ff_dim: usize,
pub num_layers: usize,
pub max_sequence_length: usize,
pub attention_dropout: f64,
pub ff_dropout: f64,
pub layer_norm_eps: f64,
pub pre_layer_norm: bool,
pub pos_encoding_type: PositionalEncodingType,
pub relative_position_bias: bool,
pub use_rope: bool,
pub causal_attention: bool,
pub activation: ActivationFunction,
pub dropout_seed: u64,
pub update_modulation: f64,
pub gradient_checkpointing: bool,
pub attention_optimization: AttentionOptimization,
pub multi_scale_attention: bool,
pub cross_attention: bool,
pub memory_efficient: bool,
}Expand description
Configuration specific to Transformer optimizer
Fields§
§base_config: LearnedOptimizerConfigBase learned optimizer config
modeldim: usizeModel dimension (d_model)
numheads: usizeNumber of attention heads
ff_dim: usizeFeed-forward network dimension
num_layers: usizeNumber of transformer layers
max_sequence_length: usizeMaximum sequence length, which is also the optimization-history window fed to the network on every step
attention_dropout: f64Attention dropout rate
ff_dropout: f64Feed-forward dropout rate
layer_norm_eps: f64Layer normalization epsilon
pre_layer_norm: boolUse pre-layer normalization
pos_encoding_type: PositionalEncodingTypePositional encoding type
relative_position_bias: boolEnable relative position bias
use_rope: boolUse rotary position embedding
causal_attention: boolMask out future positions in self-attention
activation: ActivationFunctionFeed-forward activation function
dropout_seed: u64Seed used by the dropout layers so training runs are reproducible
update_modulation: f64Amplitude of the transformer’s modulation of the gradient step.
The applied per-coordinate scale is 1 + modulation * tanh(network output), so values in (0, 1) keep the scale strictly positive and the
update in the descent half-space.
gradient_checkpointing: boolEnable gradient checkpointing
attention_optimization: AttentionOptimizationAttention pattern optimization
multi_scale_attention: boolMulti-scale attention
cross_attention: boolCross-attention for multi-task learning
memory_efficient: boolMemory efficiency mode
Implementations§
Trait Implementations§
Source§impl Clone for TransformerOptimizerConfig
impl Clone for TransformerOptimizerConfig
Source§impl Debug for TransformerOptimizerConfig
impl Debug for TransformerOptimizerConfig
Auto Trait Implementations§
impl Freeze for TransformerOptimizerConfig
impl RefUnwindSafe for TransformerOptimizerConfig
impl Send for TransformerOptimizerConfig
impl Sync for TransformerOptimizerConfig
impl Unpin for TransformerOptimizerConfig
impl UnsafeUnpin for TransformerOptimizerConfig
impl UnwindSafe for TransformerOptimizerConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.