Skip to content

Commit

Permalink
♻️ (build_makemore_yay.ipynb): refactor code to improve readability a…
Browse files Browse the repository at this point in the history
…nd maintainability
  • Loading branch information
zeulewan committed Nov 6, 2024
1 parent 495ed6e commit 2830f80
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions build_makemore_yay.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1033,33 +1033,33 @@
},
{
"cell_type": "code",
"execution_count": 115,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cexze.\n",
"momasurailezitynn.\n",
"konimittain.\n",
"llayn.\n",
"ka.\n",
"da.\n",
"staiyaubrtthrigotai.\n",
"moliellavo.\n",
"ke.\n",
"teda.\n",
"ka.\n",
"emimmsade.\n",
"enkaviyny.\n",
"ftlspihinivenvorhlasu.\n",
"dsor.\n",
"br.\n",
"jol.\n",
"pen.\n",
"aisan.\n",
"ja.\n"
"cexzm.\n",
"zoglkurkicqzktyhwmvmzimjttainrlkfukzkktda.\n",
"sfcxvpubjtbhrmgotzx.\n",
"iczixqctvujkwptedogkkjemkmmsidguenkbvgynywftbspmhwcivgbvtahlvsu.\n",
"dsdxxblnwglhpyiw.\n",
"igwnjwrpfdwipkwzkm.\n",
"desu.\n",
"firmt.\n",
"gbiksjbquabsvoth.\n",
"kuysxqevhcmrbxmcwyhrrjenvxmvpfkmwmghfvjzxobomysox.\n",
"gbptjapxweegpfwhccfyzfvksiiqmvwbhmiwqmdgzqsamjhgamcxwmmk.\n",
"iswcxfmbalcslhy.\n",
"fpycvasvz.\n",
"bqzazeunschck.\n",
"wnkojuoxyvtvfiwksddugnkul.\n",
"fuwfcgjz.\n",
"abl.\n",
"j.\n",
"nuuutstofgqzubbo.\n",
"rdubpknhmd.\n"
]
}
],
Expand All @@ -1072,6 +1072,7 @@
" while True:\n",
" p = N[ix].float()\n",
" p = p / p.sum()\n",
" # p = torch.ones(27) / 27.0 # completely untrained\n",
" ix = torch.multinomial(p, num_samples=1, replacement=True, generator=g).item()\n",
" out.append(itos[ix])\n",
" \n",
Expand Down

0 comments on commit 2830f80

Please sign in to comment.