pub struct ConfigV2 {
pub vocab_size: usize,
pub context_length: usize,
pub emb_dim: usize,
pub n_heads: usize,
pub n_layers: usize,
pub drop_rate_attn: f32,
pub drop_rate_emb: f32,
pub drop_rate_shortcut: f32,
pub qkv_bias: bool,
}
Expand description
A second Config
variation for Exercise 4.3 to specify individual drop rates
Fields§
§vocab_size: usize
§context_length: usize
§emb_dim: usize
§n_heads: usize
§n_layers: usize
§drop_rate_attn: f32
§drop_rate_emb: f32
§drop_rate_shortcut: f32
§qkv_bias: bool
Implementations§
Source§impl ConfigV2
impl ConfigV2
pub fn gpt_config_124m() -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigV2
impl RefUnwindSafe for ConfigV2
impl Send for ConfigV2
impl Sync for ConfigV2
impl Unpin for ConfigV2
impl UnwindSafe for ConfigV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
Converts
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> ⓘ
Converts
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 more