Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ This repository contains notebooks authored by the [NVIDIA DLI](https://nvidia.c
## NVIDIA DLI Catalog

If you enjoy these notebooks, we recommend you check out the [DLI's full catalog of courses](nvidia.com/dli) which cover a much broader range of topics, in much greater depth, with dedicated GPU resources and a more sophisticated programming environment.

## Notes

This fork includes fixes for:
- Colab YouTube embed issues (Error 153)
- Image rendering inconsistencies
- GitHub notebook preview compatibility
- Keras model initialization errors

See pull request for full details.
42 changes: 30 additions & 12 deletions building-a-brain/BuildingABrain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"metadata": {
"colab": {
"name": "BuildingABrain.ipynb",
"provenance": [],
"collapsed_sections": []
"provenance": []
},
"kernelspec": {
"name": "python3",
Expand Down Expand Up @@ -41,13 +40,31 @@
},
{
"cell_type": "code",
"metadata": {
"id": "Jj9625DV7oKS"
},
"source": [
"from IPython.display import YouTubeVideo\n",
"YouTubeVideo('cNxadbrN_aI')"
"from IPython.display import HTML\n",
"\n",
"video_id = \"cNxadbrN_aI\"\n",
"src = \"https://www.youtube.com/embed/\" + video_id\n",
"\n",
"tag_open = \"<\" + \"iframe\"\n",
"tag_close = \"<\" + \"/\" + \"iframe\" + \">\"\n",
"\n",
"html = (\n",
" tag_open\n",
" + ' width=\"560\" height=\"315\"'\n",
" + ' src=\"' + src + '\"'\n",
" + ' frameborder=\"0\"'\n",
" + ' allowfullscreen'\n",
" + ' referrerpolicy=\"strict-origin-when-cross-origin\"'\n",
" + \">\"\n",
" + tag_close\n",
")\n",
"\n",
"HTML(html)"
],
"metadata": {
"id": "viMxZGykqyK6"
},
"execution_count": null,
"outputs": []
},
Expand Down Expand Up @@ -233,7 +250,7 @@
"\n",
"## Defining the architecture\n",
"<center>\n",
"<a title=\"BruceBlaus, CC BY 3.0 &lt;https://creativecommons.org/licenses/by/3.0&gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Blausen_0657_MultipolarNeuron.png\"><img width=\"512\" alt=\"Blausen 0657 MultipolarNeuron\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Blausen_0657_MultipolarNeuron.png/512px-Blausen_0657_MultipolarNeuron.png\"></a>\n",
"<a title=\"BruceBlaus, CC BY 3.0 &lt;https://creativecommons.org/licenses/by/3.0&gt;, via Wikimedia Commons\" href=\"https://commons.wikimedia.org/wiki/File:Blausen_0657_MultipolarNeuron.png\"><img width=\"512\" alt=\"Blausen 0657 MultipolarNeuron\" src=\"https://upload.wikimedia.org/wikipedia/commons/1/10/Blausen_0657_MultipolarNeuron.png?utm_source=commons.wikimedia.org&utm_campaign=index&utm_content=original\"></a>\n",
"<p><small>\n",
"Image courtesy of <a href=\"https://commons.wikimedia.org/wiki/File:Blausen_0657_MultipolarNeuron.png\">Wikimedia Commons</a>\n",
"</small></p>\n",
Expand Down Expand Up @@ -303,8 +320,9 @@
},
"source": [
"model = tf.keras.Sequential([\n",
" tf.keras.layers.Flatten(input_shape=(28, 28)),\n",
" tf.keras.layers.Dense(number_of_classes)\n",
" tf.keras.Input(shape=(28, 28)), # Use Input layer to define shape\n",
" tf.keras.layers.Flatten(),\n",
" tf.keras.layers.Dense(int(number_of_classes))\n",
"])"
],
"execution_count": null,
Expand Down Expand Up @@ -350,7 +368,7 @@
"image_height = 28\n",
"image_width = 28\n",
"\n",
"number_of_weights = image_height * image_width * number_of_classes\n",
"number_of_weights = image_height * image_width * int(number_of_classes)\n",
"number_of_weights"
],
"execution_count": null,
Expand Down Expand Up @@ -566,4 +584,4 @@
]
}
]
}
}