Skip to content

Commit

Permalink
Fix via nbfmt
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 330639253
  • Loading branch information
yashk2810 authored and Copybara-Service committed Sep 9, 2020
1 parent baa4dc7 commit 1880182
Show file tree
Hide file tree
Showing 52 changed files with 1,409 additions and 4,876 deletions.
475 changes: 148 additions & 327 deletions courses/udacity_deep_learning/1_notmnist.ipynb

Large diffs are not rendered by default.

399 changes: 127 additions & 272 deletions courses/udacity_deep_learning/2_fullyconnected.ipynb

Large diffs are not rendered by default.

195 changes: 58 additions & 137 deletions courses/udacity_deep_learning/3_regularization.ipynb
@@ -1,22 +1,9 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"version": "0.3.2",
"views": {},
"default_view": {},
"name": "3_regularization.ipynb",
"provenance": [],
"toc_visible": true
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "kR-4eNdK6lYS",
"colab_type": "text"
"id": "kR-4eNdK6lYS"
},
"source": [
"Deep Learning\n",
Expand All @@ -32,73 +19,48 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "JLpLa8Jt7Vu4",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "both"
"cellView": "both",
"id": "JLpLa8Jt7Vu4"
},
"outputs": [],
"source": [
"# These are all the modules we'll be using later. Make sure you can import them\n",
"# before proceeding further.\n",
"from __future__ import print_function\n",
"import numpy as np\n",
"import tensorflow as tf\n",
"from six.moves import cPickle as pickle"
],
"outputs": [],
"execution_count": 0
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "1HrCK6e17WzV",
"colab_type": "text"
"id": "1HrCK6e17WzV"
},
"source": [
"First reload the data we generated in `1_notmnist.ipynb`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "y3-cj1bpmuxc",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
]
},
"cellView": "both",
"executionInfo": {
"elapsed": 11777,
"status": "ok",
"timestamp": 1449849322348,
"user": {
"color": "",
"displayName": "",
"isAnonymous": false,
"isMe": true,
"permissionId": "",
"photoUrl": "",
"sessionId": "0",
"userId": ""
},
"user_tz": 480
},
"outputId": "e03576f1-ebbe-4838-c388-f1777bcc9873"
"id": "y3-cj1bpmuxc"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Training set (200000, 28, 28) (200000,)\n",
"Validation set (10000, 28, 28) (10000,)\n",
"Test set (18724, 28, 28) (18724,)\n"
]
}
],
"source": [
"pickle_file = 'notMNIST.pickle'\n",
"\n",
Expand All @@ -114,25 +76,12 @@
" print('Training set', train_dataset.shape, train_labels.shape)\n",
" print('Validation set', valid_dataset.shape, valid_labels.shape)\n",
" print('Test set', test_dataset.shape, test_labels.shape)"
],
"outputs": [
{
"output_type": "stream",
"text": [
"Training set (200000, 28, 28) (200000,)\n",
"Validation set (10000, 28, 28) (10000,)\n",
"Test set (18724, 28, 28) (18724,)\n"
],
"name": "stdout"
}
],
"execution_count": 0
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "L7aHrm6nGDMB",
"colab_type": "text"
"id": "L7aHrm6nGDMB"
},
"source": [
"Reformat into a shape that's more adapted to the models we're going to train:\n",
Expand All @@ -142,39 +91,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "IRSyYiIIGIzS",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
]
},
"cellView": "both",
"executionInfo": {
"elapsed": 11728,
"status": "ok",
"timestamp": 1449849322356,
"user": {
"color": "",
"displayName": "",
"isAnonymous": false,
"isMe": true,
"permissionId": "",
"photoUrl": "",
"sessionId": "0",
"userId": ""
},
"user_tz": 480
},
"outputId": "3f8996ee-3574-4f44-c953-5c8a04636582"
"id": "IRSyYiIIGIzS"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Training set (200000, 784) (200000, 10)\n",
"Validation set (10000, 784) (10000, 10)\n",
"Test set (18724, 784) (18724, 10)\n"
]
}
],
"source": [
"image_size = 28\n",
"num_labels = 10\n",
Expand All @@ -190,46 +122,26 @@
"print('Training set', train_dataset.shape, train_labels.shape)\n",
"print('Validation set', valid_dataset.shape, valid_labels.shape)\n",
"print('Test set', test_dataset.shape, test_labels.shape)"
],
"outputs": [
{
"output_type": "stream",
"text": [
"Training set (200000, 784) (200000, 10)\n",
"Validation set (10000, 784) (10000, 10)\n",
"Test set (18724, 784) (18724, 10)\n"
],
"name": "stdout"
}
],
"execution_count": 0
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "RajPLaL_ZW6w",
"colab_type": "code",
"colab": {
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "both"
"cellView": "both",
"id": "RajPLaL_ZW6w"
},
"outputs": [],
"source": [
"def accuracy(predictions, labels):\n",
" return (100.0 * np.sum(np.argmax(predictions, 1) == np.argmax(labels, 1))\n",
" / predictions.shape[0])"
],
"outputs": [],
"execution_count": 0
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "sgLbUAQ1CW-1",
"colab_type": "text"
"id": "sgLbUAQ1CW-1"
},
"source": [
"---\n",
Expand All @@ -244,8 +156,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "na8xX2yHZzNF",
"colab_type": "text"
"id": "na8xX2yHZzNF"
},
"source": [
"---\n",
Expand All @@ -259,8 +170,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "ww3SCBUdlkRc",
"colab_type": "text"
"id": "ww3SCBUdlkRc"
},
"source": [
"---\n",
Expand All @@ -276,8 +186,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "-b1hTz3VWZjw",
"colab_type": "text"
"id": "-b1hTz3VWZjw"
},
"source": [
"---\n",
Expand All @@ -297,5 +206,17 @@
" ---\n"
]
}
]
],
"metadata": {
"colab": {
"name": "3_regularization.ipynb",
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit 1880182

Please sign in to comment.