pub struct Config {
pub vocab_size: usize,
pub context_length: usize,
pub emb_dim: usize,
pub n_heads: usize,
pub n_layers: usize,
pub drop_rate: f32,
pub qkv_bias: bool,
}
Expand description
Config for specifying parameters of a GPT-2 model
Fields§
§vocab_size: usize
§context_length: usize
§emb_dim: usize
§n_heads: usize
§n_layers: usize
§drop_rate: f32
§qkv_bias: bool
Implementations§
Source§impl Config
impl Config
Sourcepub fn gpt2_medium() -> Self
pub fn gpt2_medium() -> Self
Returns configuration for GPT-2 medium
Sourcepub fn gpt2_large() -> Self
pub fn gpt2_large() -> Self
Returns configuration for GPT-2 large
Sourcepub fn gpt2_xlarge() -> Self
pub fn gpt2_xlarge() -> Self
Returns configuration for GPT-2 x-large
Sourcepub fn gpt_sm_test() -> Self
pub fn gpt_sm_test() -> Self
Returns a custom configuration for GPT-2 to be used in unit tests
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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