mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-06-26 23:50:03 +00:00
use less ambiguous var name
This commit is contained in:
parent
320f63829f
commit
231a854ae7
@ -301,10 +301,10 @@
|
|||||||
"torch.manual_seed(123)\n",
|
"torch.manual_seed(123)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# create 2 training examples with 5 dimensions (features) each\n",
|
"# create 2 training examples with 5 dimensions (features) each\n",
|
||||||
"batch_input = torch.randn(2, 5) \n",
|
"batch_example = torch.randn(2, 5) \n",
|
||||||
"\n",
|
"\n",
|
||||||
"layer = nn.Sequential(nn.Linear(5, 6), nn.ReLU())\n",
|
"layer = nn.Sequential(nn.Linear(5, 6), nn.ReLU())\n",
|
||||||
"out = layer(batch_input)\n",
|
"out = layer(batch_example)\n",
|
||||||
"print(out)"
|
"print(out)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -492,7 +492,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"ln = LayerNorm(emb_dim=5)\n",
|
"ln = LayerNorm(emb_dim=5)\n",
|
||||||
"out_ln = ln(batch_input)"
|
"out_ln = ln(batch_example)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user