Created using Colaboratory

This commit is contained in:
udlbook
2023-12-24 12:34:48 -05:00
parent 56b4edb871
commit d6d0afdfd3

View File

@@ -4,7 +4,7 @@
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyObut1y9atNUuowPT6dMY+I",
"authorship_tag": "ABX9TyMXS3SPB4cS/4qxix0lH/Hq",
"include_colab_link": true
},
"kernelspec": {
@@ -144,10 +144,10 @@
" def count_params(self):\n",
" return sum([p.view(-1).shape[0] for p in self.parameters()])\n",
"\n",
"# # TODO -- Add residual connections to this model\n",
"# # The order of operations should similar to figure 11.5b\n",
"# # linear1 first, ReLU+linear2 in first residual block, ReLU+linear3 in second residual block), linear4 at end\n",
"# # Replace this function\n",
"# TODO -- Add residual connections to this model\n",
"# The order of operations within each block should similar to figure 11.5b\n",
"# ie., linear1 first, ReLU+linear2 in first residual block, ReLU+linear3 in second residual block), linear4 at end\n",
"# Replace this function\n",
" def forward(self, x):\n",
" h1 = self.linear1(x).relu()\n",
" h2 = self.linear2(h1).relu()\n",