-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff30fa8
commit a9b867a
Showing
7 changed files
with
452 additions
and
17 deletions.
There are no files selected for viewing
122 changes: 122 additions & 0 deletions
122
... Networks and Deep Learning /Basics/.ipynb_checkpoints/Broadcasting demo-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[[ 0.13173302 7.80728589 6.26190867 7.2219721 ]\n", | ||
" [ 4.34703125 7.83297 9.41237969 7.4847714 ]\n", | ||
" [ 1.91750257 9.10735505 1.12573619 7.93226677]]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import numpy as np\n", | ||
"\n", | ||
"A = 10*np.random.rand(3,4)\n", | ||
"print(A)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[ 18.75768804 13.9073695 21.41652281 15.24013189]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"cal = A.sum(axis=0)\n", | ||
"print(cal)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 22, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[[ 29.81471408 50.34378724 36.86021364 64.43175012]\n", | ||
" [ 26.96686398 38.48118926 33.10381054 11.96405678]\n", | ||
" [ 43.21842194 11.1750235 30.03597582 23.6041931 ]]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"percentage = 100*A/(cal.reshape(1,4))\n", | ||
"print(percentage)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"(3, 3)\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"a = np.random.randn(3, 3)\n", | ||
"b = np.random.randn(3, 1)\n", | ||
"c = a*b\n", | ||
"print (c.shape)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
151 changes: 151 additions & 0 deletions
151
...tworks and Deep Learning /Basics/.ipynb_checkpoints/Python-Numpy Vectors-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[[ 0.60389225]\n", | ||
" [ 0.6429397 ]\n", | ||
" [ 0.35553732]\n", | ||
" [ 0.11588369]\n", | ||
" [ 0.44658051]]\n", | ||
"(5, 1)\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import numpy as np\n", | ||
"\n", | ||
"a = np.random.rand(5,1)\n", | ||
"print (a)\n", | ||
"print (a.shape)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[[ 0.60389225 0.6429397 0.35553732 0.11588369 0.44658051]]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print (a.T)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 13, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[[ 0.36468585 0.3882663 0.21470623 0.06998126 0.26968651]\n", | ||
" [ 0.3882663 0.41337146 0.22858906 0.07450623 0.28712434]\n", | ||
" [ 0.21470623 0.22858906 0.12640679 0.04120098 0.15877604]\n", | ||
" [ 0.06998126 0.07450623 0.04120098 0.01342903 0.0517514 ]\n", | ||
" [ 0.26968651 0.28712434 0.15877604 0.0517514 0.19943415]]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"print(np.dot(a,a.T))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import math\n", | ||
"def basic_sigmoid(x):\n", | ||
" \"\"\"\n", | ||
" Compute sigmoid of x.\n", | ||
"\n", | ||
" Arguments:\n", | ||
" x -- A scalar\n", | ||
"\n", | ||
" Return:\n", | ||
" s -- sigmoid(x)\n", | ||
" \"\"\"\n", | ||
" s = 1/(1+math.exp(-x))\n", | ||
"\n", | ||
" \n", | ||
" return s" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"0.9933071490757153" | ||
] | ||
}, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"basic_sigmoid(5)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
6 changes: 0 additions & 6 deletions
6
1. Neural Networks and Deep Learning /Basics/.ipynb_checkpoints/Untitled-checkpoint.ipynb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.