Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
random-forests committed Feb 8, 2019
1 parent a2c4347 commit 1c4ce82
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions examples/3.1-backprop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@
"metadata": {
"id": "iZs4NzdTRr_s",
"colab_type": "code",
"outputId": "01f19d07-1a59-4001-f8bb-e4779de4cfdd",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 354
},
"outputId": "01f19d07-1a59-4001-f8bb-e4779de4cfdd"
}
},
"cell_type": "code",
"source": [
"!pip install tf-nightly-2.0-preview"
],
"execution_count": 21,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -93,11 +93,11 @@
"metadata": {
"id": "42ehAJbDRy-L",
"colab_type": "code",
"outputId": "b6ee60b6-0c87-4ede-8fb9-80f6b6634e39",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "b6ee60b6-0c87-4ede-8fb9-80f6b6634e39"
}
},
"cell_type": "code",
"source": [
Expand All @@ -107,7 +107,7 @@
"print(\"You have version\", tf.__version__)\n",
"assert tf.__version__ >= \"2.0\" # TensorFlow ≥ 2.0 required"
],
"execution_count": 22,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -170,17 +170,17 @@
"metadata": {
"id": "AnFrL5YrXCmo",
"colab_type": "code",
"outputId": "9519f998-bb28-463e-d522-4e28166b8148",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "9519f998-bb28-463e-d522-4e28166b8148"
}
},
"cell_type": "code",
"source": [
"forward(2,1)"
],
"execution_count": 24,
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
Expand Down Expand Up @@ -249,18 +249,18 @@
"metadata": {
"id": "6PWzE2UWI4if",
"colab_type": "code",
"outputId": "3c3e5e57-b21b-4ff6-e9b4-8ffe1c26a546",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "3c3e5e57-b21b-4ff6-e9b4-8ffe1c26a546"
}
},
"cell_type": "code",
"source": [
"da, db = numeric_gradient(my_function=forward, params=[2, 1])\n",
"print (\"Numeric gradient. da %0.2f, db %0.2f\" % (da, db))"
],
"execution_count": 26,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -286,11 +286,11 @@
"metadata": {
"id": "SVPs3gwCLOw5",
"colab_type": "code",
"outputId": "7b369281-9074-4a23-aff8-a3771c366b76",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "7b369281-9074-4a23-aff8-a3771c366b76"
}
},
"cell_type": "code",
"source": [
Expand Down Expand Up @@ -321,7 +321,7 @@
"da, db = backprop_by_hand(a=2, b=1)\n",
"print (\"Gradient by backprop. da %0.2f, db %0.2f\" % (da, db))"
],
"execution_count": 27,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -349,11 +349,11 @@
"metadata": {
"id": "vj18HaqQJAbk",
"colab_type": "code",
"outputId": "618d13da-f849-4dd2-8498-7622ff22b1e9",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "618d13da-f849-4dd2-8498-7622ff22b1e9"
}
},
"cell_type": "code",
"source": [
Expand All @@ -366,7 +366,7 @@
"print(\"Analytic gradient (by autodiff). da %0.2f, db %0.2f\" % \n",
" (grads[0].numpy(), grads[1].numpy()))"
],
"execution_count": 28,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -386,7 +386,7 @@
"source": [
"## Second example\n",
"\n",
"Here's `f(a, b) = (a + b) * (b + 1)` in the same three ways."
"Here's `f(x, y, z) = (x + y) * z` in the same three ways."
]
},
{
Expand All @@ -407,17 +407,17 @@
"metadata": {
"id": "-jaobiCEYX8n",
"colab_type": "code",
"outputId": "64f63071-7b4a-4720-f315-49aa865e2caf",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "64f63071-7b4a-4720-f315-49aa865e2caf"
}
},
"cell_type": "code",
"source": [
"forward(x=1, y=2, z=-4)"
],
"execution_count": 30,
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
Expand Down Expand Up @@ -448,18 +448,18 @@
"metadata": {
"id": "_LX3YK8mR8fr",
"colab_type": "code",
"outputId": "60a8f5df-2a2a-44c2-af21-c8ac06b7bb20",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "60a8f5df-2a2a-44c2-af21-c8ac06b7bb20"
}
},
"cell_type": "code",
"source": [
"dx, dy, dz = numeric_gradient(my_function=forward, params=[1, 2, -4])\n",
"print (\"Numeric gradient. dx %0.2f, dy %0.2f, dz %0.2f\" % (dx, dy, dz))"
],
"execution_count": 31,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -526,18 +526,18 @@
"metadata": {
"id": "F6c8yzX8Rmbn",
"colab_type": "code",
"outputId": "7152550b-34d5-4f91-967c-3206f6e1a575",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "7152550b-34d5-4f91-967c-3206f6e1a575"
}
},
"cell_type": "code",
"source": [
"dx, dy, dz = backprop_by_hand(1., 2., -4.)\n",
"print (\"Gradient by backprop. dx %0.2f, dy %0.2f, dz %0.2f\" % (dx, dy, dz))"
],
"execution_count": 33,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -563,11 +563,11 @@
"metadata": {
"id": "t0gsYnKEScTs",
"colab_type": "code",
"outputId": "bac0100e-c065-461a-d337-af0b6cb5b901",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "bac0100e-c065-461a-d337-af0b6cb5b901"
}
},
"cell_type": "code",
"source": [
Expand All @@ -580,7 +580,7 @@
"print(\"Analytic gradient (by autodiff). dx %0.2f, dy %0.2f dz %0.2f\" % \n",
" (grads[0].numpy(), grads[1].numpy(), grads[2].numpy()))"
],
"execution_count": 34,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -623,11 +623,11 @@
"metadata": {
"id": "jg9c25M-XYhr",
"colab_type": "code",
"outputId": "8475d7d8-61c4-4233-fc7b-65f02281412e",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 70
},
"outputId": "8475d7d8-61c4-4233-fc7b-65f02281412e"
}
},
"cell_type": "code",
"source": [
Expand All @@ -637,7 +637,7 @@
"x = np.expand_dims(x,1) \n",
"forward(W,x)"
],
"execution_count": 36,
"execution_count": 0,
"outputs": [
{
"output_type": "execute_result",
Expand Down Expand Up @@ -705,18 +705,18 @@
"metadata": {
"id": "x88WSpuk0Nci",
"colab_type": "code",
"outputId": "6a4be3dc-efa6-46bc-d4cf-dafdb22146cf",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 52
},
"outputId": "6a4be3dc-efa6-46bc-d4cf-dafdb22146cf"
}
},
"cell_type": "code",
"source": [
"dw = numeric_gradient_v2(forward, weights=W, inputs=x)\n",
"print (\"Numeric gradient. dw\\n\" % dw)"
],
"execution_count": 38,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -743,11 +743,11 @@
"metadata": {
"id": "vWyyOJef0Sol",
"colab_type": "code",
"outputId": "cbe58a54-ee00-4e21-c80a-01addb936b1f",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 70
},
"outputId": "cbe58a54-ee00-4e21-c80a-01addb936b1f"
}
},
"cell_type": "code",
"source": [
Expand All @@ -762,7 +762,7 @@
"dw = backward(W,x)\n",
"print (\"Gradient by hand\\n\", dw)"
],
"execution_count": 39,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -790,11 +790,11 @@
"metadata": {
"id": "6-m03wlhztHT",
"colab_type": "code",
"outputId": "47dc6164-d2b6-49c6-d3e4-fecfcd0f41d8",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 70
},
"outputId": "47dc6164-d2b6-49c6-d3e4-fecfcd0f41d8"
}
},
"cell_type": "code",
"source": [
Expand All @@ -810,7 +810,7 @@
"\n",
"print(\"Analytic gradient (by autodiff). dw\", grads)"
],
"execution_count": 40,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down

0 comments on commit 1c4ce82

Please sign in to comment.