Skip to content

Commit f7b1c06

Browse files
committed
Completed Course 1
1 parent 9fba2aa commit f7b1c06

File tree

65 files changed

+108926
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+108926
-0
lines changed
Binary file not shown.
Loading
Binary file not shown.

Neural Networks and Deep Learning/Week 2/Logistic Regression as a Neural Network/Logistic+Regression+with+a+Neural+Network+mindset+v3.html

Lines changed: 22504 additions & 0 deletions
Large diffs are not rendered by default.

Neural Networks and Deep Learning/Week 2/Logistic Regression as a Neural Network/Logistic+Regression+with+a+Neural+Network+mindset+v3.ipynb

Lines changed: 1362 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

Neural Networks and Deep Learning/Week 2/Python Basics with Numpy/Python+Basics+With+Numpy+v3.ipynb

Lines changed: 1215 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"metadata": {
7+
"collapsed": true
8+
},
9+
"outputs": [],
10+
"source": [
11+
"import numpy as np"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": 3,
17+
"metadata": {
18+
"collapsed": false
19+
},
20+
"outputs": [
21+
{
22+
"name": "stdout",
23+
"output_type": "stream",
24+
"text": [
25+
"(2, 3)\n"
26+
]
27+
}
28+
],
29+
"source": [
30+
"a = np.random.randn(2, 3) # a.shape = (2, 3)\n",
31+
"b = np.random.randn(2, 1) # b.shape = (2, 1)\n",
32+
"c = a + b\n",
33+
"print(c.shape)"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": 4,
39+
"metadata": {
40+
"collapsed": false
41+
},
42+
"outputs": [
43+
{
44+
"ename": "ValueError",
45+
"evalue": "operands could not be broadcast together with shapes (4,3) (3,2) ",
46+
"output_type": "error",
47+
"traceback": [
48+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
49+
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
50+
"\u001b[0;32m<ipython-input-4-e51bf1949f07>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# a.shape = (4, 3)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mb\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;31m# b.shape = (3, 2)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mb\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
51+
"\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (4,3) (3,2) "
52+
]
53+
}
54+
],
55+
"source": [
56+
"a = np.random.randn(4, 3) # a.shape = (4, 3)\n",
57+
"b = np.random.randn(3, 2) # b.shape = (3, 2)\n",
58+
"c = a*b\n",
59+
"print(c.shape)"
60+
]
61+
},
62+
{
63+
"cell_type": "code",
64+
"execution_count": 5,
65+
"metadata": {
66+
"collapsed": false
67+
},
68+
"outputs": [
69+
{
70+
"name": "stdout",
71+
"output_type": "stream",
72+
"text": [
73+
"(12288, 45)\n"
74+
]
75+
}
76+
],
77+
"source": [
78+
"a = np.random.randn(12288, 150) # a.shape = (12288, 150)\n",
79+
"b = np.random.randn(150, 45) # b.shape = (150, 45)\n",
80+
"c = np.dot(a,b)\n",
81+
"print(c.shape)"
82+
]
83+
},
84+
{
85+
"cell_type": "code",
86+
"execution_count": 3,
87+
"metadata": {
88+
"collapsed": false
89+
},
90+
"outputs": [
91+
{
92+
"name": "stdout",
93+
"output_type": "stream",
94+
"text": [
95+
"(4, 1)\n"
96+
]
97+
}
98+
],
99+
"source": [
100+
"A = np.random.randn(4,3)\n",
101+
"B = np.sum(A, axis = 1, keepdims = True)\n",
102+
"print(B.shape)"
103+
]
104+
},
105+
{
106+
"cell_type": "code",
107+
"execution_count": null,
108+
"metadata": {
109+
"collapsed": true
110+
},
111+
"outputs": [],
112+
"source": []
113+
}
114+
],
115+
"metadata": {
116+
"anaconda-cloud": {},
117+
"kernelspec": {
118+
"display_name": "Python [conda root]",
119+
"language": "python",
120+
"name": "conda-root-py"
121+
},
122+
"language_info": {
123+
"codemirror_mode": {
124+
"name": "ipython",
125+
"version": 3
126+
},
127+
"file_extension": ".py",
128+
"mimetype": "text/x-python",
129+
"name": "python",
130+
"nbconvert_exporter": "python",
131+
"pygments_lexer": "ipython3",
132+
"version": "3.5.2"
133+
}
134+
},
135+
"nbformat": 4,
136+
"nbformat_minor": 2
137+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Week 2 Exercises
2+
3+
Exercises completed during the second week of the course:
4+
* Python Basics with numpy (optional)
5+
* Logistic Regression with a Neural Network mindset

0 commit comments

Comments
 (0)