Skip to content

Commit

Permalink
update ipython notebook examples (backprop. and CNN)
Browse files Browse the repository at this point in the history
  • Loading branch information
leejaymin committed Feb 2, 2017
1 parent 11c68f0 commit fc50a9b
Show file tree
Hide file tree
Showing 7 changed files with 1,844 additions and 279 deletions.
262 changes: 207 additions & 55 deletions 0.1.Fundamental_Neural_Network/ex1/ex1_jemin.ipynb

Large diffs are not rendered by default.

118 changes: 100 additions & 18 deletions 0.1.Fundamental_Neural_Network/ex2/ex2_jemin.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {
"collapsed": true
},
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 26,
"metadata": {
"collapsed": true
},
Expand All @@ -23,9 +23,23 @@
"args = (2, 3, 7, 8, 9, 10) # parameter values"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$f=au^{2}+buv+cv^{2}+du+ev+f$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$f=2u^{2}+3uv+7v^{2}+8u+9v+10$$"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 32,
"metadata": {
"collapsed": false
},
Expand All @@ -37,9 +51,18 @@
" return a*u**2 + b*u*v + c*v**2 + d*u + e*v + f"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\\frac{\\partial f}{\\partial u}=2au+bv+d$$\n",
"\n",
"$$\\frac{\\partial f}{\\partial v}=bu+2c+e$$"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 16,
"metadata": {
"collapsed": true
},
Expand All @@ -55,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 17,
"metadata": {
"collapsed": false
},
Expand All @@ -66,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {
"collapsed": false
},
Expand All @@ -77,9 +100,9 @@
"text": [
"Optimization terminated successfully.\n",
" Current function value: 1.617021\n",
" Iterations: 2\n",
" Function evaluations: 5\n",
" Gradient evaluations: 5\n"
" Iterations: 4\n",
" Function evaluations: 8\n",
" Gradient evaluations: 8\n"
]
}
],
Expand All @@ -89,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 19,
"metadata": {
"collapsed": false
},
Expand All @@ -100,18 +123,19 @@
"array([-1.80851064, -0.25531915])"
]
},
"execution_count": 15,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 최적화된 값\n",
"res1"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 31,
"metadata": {
"collapsed": false
},
Expand All @@ -122,14 +146,60 @@
"array([0, 0])"
]
},
"execution_count": 18,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 0으로 초기화된 값\n",
"x0"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"10"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(x0,*args)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"data": {
"text/plain": [
"1.6170212765957448"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(res1,*args)"
]
}
],
"metadata": {
Expand All @@ -148,7 +218,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"version": "2.7.12"
}
},
"nbformat": 4,
Expand Down
445 changes: 356 additions & 89 deletions 0.1.Fundamental_Neural_Network/ex4/ex4_jemin.ipynb

Large diffs are not rendered by default.

98 changes: 84 additions & 14 deletions 0.1.Fundamental_Neural_Network/ex4/example_fmin_cg.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {
"collapsed": true
},
Expand All @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 26,
"metadata": {
"collapsed": true
},
Expand All @@ -23,9 +23,23 @@
"args = (2, 3, 7, 8, 9, 10) # parameter values"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$f=au^{2}+buv+cv^{2}+du+ev+f$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$f=2u^{2}+3uv+7v^{2}+8u+9v+10$$"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 32,
"metadata": {
"collapsed": false
},
Expand All @@ -37,9 +51,18 @@
" return a*u**2 + b*u*v + c*v**2 + d*u + e*v + f"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$$\\frac{\\partial f}{\\partial u}=2au+bv+d$$\n",
"\n",
"$$\\frac{\\partial f}{\\partial v}=bu+2c+e$$"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 16,
"metadata": {
"collapsed": true
},
Expand All @@ -55,7 +78,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 17,
"metadata": {
"collapsed": false
},
Expand All @@ -66,7 +89,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {
"collapsed": false
},
Expand All @@ -77,9 +100,9 @@
"text": [
"Optimization terminated successfully.\n",
" Current function value: 1.617021\n",
" Iterations: 2\n",
" Function evaluations: 5\n",
" Gradient evaluations: 5\n"
" Iterations: 4\n",
" Function evaluations: 8\n",
" Gradient evaluations: 8\n"
]
}
],
Expand All @@ -89,7 +112,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 19,
"metadata": {
"collapsed": false
},
Expand All @@ -100,18 +123,19 @@
"array([-1.80851064, -0.25531915])"
]
},
"execution_count": 15,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 최적화된 값\n",
"res1"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 31,
"metadata": {
"collapsed": false
},
Expand All @@ -122,14 +146,60 @@
"array([0, 0])"
]
},
"execution_count": 18,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 0으로 초기화된 값\n",
"x0"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"10"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(x0,*args)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"data": {
"text/plain": [
"1.6170212765957448"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"f(res1,*args)"
]
}
],
"metadata": {
Expand All @@ -148,7 +218,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"version": "2.7.12"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit fc50a9b

Please sign in to comment.