Skip to content

Commit

Permalink
karpathy#71 use config n_head instead of hardcoded 4 heads
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeedCoder5 committed Apr 25, 2022
1 parent 3ed14b2 commit 0ac226d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mingpt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def __init__(self, config):
self.ln2 = nn.LayerNorm(config.n_embd)
self.attn = CausalSelfAttention(config)
self.mlp = nn.Sequential(
nn.Linear(config.n_embd, 4 * config.n_embd),
nn.Linear(config.n_embd, config.n_head * config.n_embd),
nn.GELU(),
nn.Linear(4 * config.n_embd, config.n_embd),
nn.Linear(config.n_head * config.n_embd, config.n_embd),
nn.Dropout(config.resid_pdrop),
)

Expand Down

0 comments on commit 0ac226d

Please sign in to comment.