pub struct GPTConfig {
pub vocab_size: usize,
pub context_length: usize,
pub embed_dim: usize,
pub num_layers: usize,
pub num_heads: usize,
pub ff_dim: usize,
pub dropout: f32,
pub bias: bool,
}Expand description
GPT configuration
Fields§
§vocab_size: usizeVocabulary size
context_length: usizeContext length (maximum sequence length)
embed_dim: usizeEmbedding dimension
num_layers: usizeNumber of transformer layers
num_heads: usizeNumber of attention heads
ff_dim: usizeFeed-forward hidden dimension
dropout: f32Dropout probability
bias: boolUse bias in linear layers
Implementations§
Source§impl GPTConfig
impl GPTConfig
Sourcepub fn gpt2_small() -> Self
pub fn gpt2_small() -> Self
GPT-2 Small (117M parameters)
Sourcepub fn gpt2_medium() -> Self
pub fn gpt2_medium() -> Self
GPT-2 Medium (345M parameters)
Sourcepub fn gpt2_large() -> Self
pub fn gpt2_large() -> Self
GPT-2 Large (774M parameters)
Sourcepub fn gpt3_small() -> Self
pub fn gpt3_small() -> Self
GPT-3 Small (125M parameters)
Sourcepub fn gpt3_medium() -> Self
pub fn gpt3_medium() -> Self
GPT-3 Medium (350M parameters)
Sourcepub fn gpt3_large() -> Self
pub fn gpt3_large() -> Self
GPT-3 Large (760M parameters)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GPTConfig
impl RefUnwindSafe for GPTConfig
impl Send for GPTConfig
impl Sync for GPTConfig
impl Unpin for GPTConfig
impl UnwindSafe for GPTConfig
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> 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