mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-07-21 06:52:26 -05:00
Improves clarity in CNN notebook
Enhances the notebook by replacing some unicode characters with more standard and universally compatible symbols, improving the overall readability and user experience.
This commit is contained in:
+11
-11
@@ -118,7 +118,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"\"\"\"\n",
|
||||
"### \ud83e\uddea Test Your Conv2D Implementation\n",
|
||||
"### 🧪 Test Your Conv2D Implementation\n",
|
||||
"\n",
|
||||
"Try your function on this simple example:\n",
|
||||
"\"\"\""
|
||||
@@ -150,10 +150,10 @@
|
||||
" output = conv2d_naive(input, kernel)\n",
|
||||
" print(\"Output:\\n\", output)\n",
|
||||
" print(\"Expected:\\n\", expected)\n",
|
||||
" assert np.allclose(output, expected), \"\u274c Output does not match expected!\"\n",
|
||||
" print(\"\u2705 conv2d_naive works!\")\n",
|
||||
" assert np.allclose(output, expected), \"❌ Output does not match expected!\"\n",
|
||||
" print(\"✅ conv2d_naive works!\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"\u274c Error: {e}\")\n",
|
||||
" print(f\"❌ Error: {e}\")\n",
|
||||
" print(\"Make sure to implement conv2d_naive above!\")"
|
||||
]
|
||||
},
|
||||
@@ -245,7 +245,7 @@
|
||||
"## Step 4: Compose a Simple ConvNet\n",
|
||||
"\n",
|
||||
"Now you can build a simple ConvNet:\n",
|
||||
"- Conv2D \u2192 ReLU \u2192 Flatten \u2192 Dense\n",
|
||||
"- Conv2D → ReLU → Flatten → Dense\n",
|
||||
"\"\"\""
|
||||
]
|
||||
},
|
||||
@@ -263,9 +263,9 @@
|
||||
" x = Tensor(np.random.randn(3, 3).astype(np.float32))\n",
|
||||
" out = dense(flatten(relu(conv(x))))\n",
|
||||
" print(\"ConvNet output:\", out.data)\n",
|
||||
" print(\"\u2705 Simple ConvNet works!\")\n",
|
||||
" print(\"✅ Simple ConvNet works!\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"\u274c Error: {e}\")\n",
|
||||
" print(f\"❌ Error: {e}\")\n",
|
||||
" print(\"Check your Conv2D and flatten implementations!\")"
|
||||
]
|
||||
},
|
||||
@@ -333,10 +333,10 @@
|
||||
" conv = Conv2D((3, 3))\n",
|
||||
" out = conv(x)\n",
|
||||
" print(\"Conv2D output shape:\", out.shape)\n",
|
||||
" assert out.shape == (3, 3), \"\u274c Output shape incorrect!\"\n",
|
||||
" print(\"\u2705 Conv2D layer passes shape test!\")\n",
|
||||
" assert out.shape == (3, 3), \"❌ Output shape incorrect!\"\n",
|
||||
" print(\"✅ Conv2D layer passes shape test!\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"\u274c Error: {e}\")\n",
|
||||
" print(f\"❌ Error: {e}\")\n",
|
||||
" print(\"Check your Conv2D implementation!\")"
|
||||
]
|
||||
}
|
||||
@@ -354,4 +354,4 @@
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user