diff --git a/README.md b/README.md index 1041a44..bc482f7 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/building-a-brain/BuildingABrain.ipynb b/building-a-brain/BuildingABrain.ipynb index 2af0b0c..ca58ea2 100644 --- a/building-a-brain/BuildingABrain.ipynb +++ b/building-a-brain/BuildingABrain.ipynb @@ -4,8 +4,7 @@ "metadata": { "colab": { "name": "BuildingABrain.ipynb", - "provenance": [], - "collapsed_sections": [] + "provenance": [] }, "kernelspec": { "name": "python3", @@ -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": [] }, @@ -233,7 +250,7 @@ "\n", "## Defining the architecture\n", "
\n", - "\"Blausen\n", + "\"Blausen\n", "

\n", "Image courtesy of Wikimedia Commons\n", "

\n", @@ -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, @@ -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, @@ -566,4 +584,4 @@ ] } ] -} +} \ No newline at end of file