Skip to content

Commit

Permalink
Created using Colab
Browse files Browse the repository at this point in the history
  • Loading branch information
udlbook committed Sep 16, 2024
1 parent f887835 commit e1df215
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions Notebooks/Chap06/6_3_Stochastic_Gradient_Descent.ipynb
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/udlbook/udlbook/blob/main/Notebooks/Chap06/6_3_Stochastic_Gradient_Descent.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "el8l05WQEO46"
Expand Down Expand Up @@ -122,7 +120,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "QU5mdGvpTtEG"
Expand Down Expand Up @@ -150,7 +147,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "eB5DQvU5hYNx"
Expand All @@ -172,7 +168,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "F3trnavPiHpH"
Expand Down Expand Up @@ -228,7 +223,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "s9Duf05WqqSC"
Expand Down Expand Up @@ -279,7 +273,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "RS1nEcYVuEAM"
Expand Down Expand Up @@ -316,7 +309,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"id": "5EIjMM9Fw2eT"
Expand Down Expand Up @@ -359,11 +351,11 @@
" print('Iter %d, a=%3.3f, b=%3.3f, c=%3.3f, d=%3.3f'%(n_iter, a,b,c,d))\n",
" print('a %f, b%f, c%f, d%f'%(lossa,lossb,lossc,lossd))\n",
"\n",
" # Rule #1 If point A is less than points B, C, and D then halve points B,C, and D\n",
" # Rule #1 If point A is less than points B, C, and D then change B,C,D so they are half their current distance from A\n",
" if np.argmin((lossa,lossb,lossc,lossd))==0:\n",
" b = b/2\n",
" c = c/2\n",
" d = d/2\n",
" b = a+ (b-a)/2\n",
" c = a+ (c-a)/2\n",
" d = a+ (d-a)/2\n",
" continue;\n",
"\n",
" # Rule #2 If point b is less than point c then\n",
Expand Down Expand Up @@ -577,9 +569,8 @@
],
"metadata": {
"colab": {
"authorship_tag": "ABX9TyNk5FN4qlw3pk8BwDVWw1jN",
"include_colab_link": true,
"provenance": []
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"display_name": "Python 3",
Expand All @@ -591,4 +582,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit e1df215

Please sign in to comment.