Skip to content

Commit eff1c29

Browse files
Add files via upload
1 parent aceecfc commit eff1c29

39 files changed

+166604
-1
lines changed

Chapter-1/lesson-1-workbook.html

+61,007
Large diffs are not rendered by default.

Chapter-1/lesson-1-workbook.ipynb

+2,770
Large diffs are not rendered by default.

Chapter-2/lesson-2-workbook.html

+31,896
Large diffs are not rendered by default.

Chapter-2/lesson-2-workbook.ipynb

+5,372
Large diffs are not rendered by default.

Chapter-3/lesson-3-workbook.html

+22,799
Large diffs are not rendered by default.

Chapter-3/lesson-3-workbook.ipynb

+11,501
Large diffs are not rendered by default.

Chapter-4/activity_1/requirements.txt

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
appnope==0.1.0
2+
beautifulsoup4==4.6.0
3+
bleach==1.5.0
4+
certifi==2017.11.5
5+
chardet==3.0.4
6+
click==6.7
7+
colorama==0.3.9
8+
coverage==4.4.2
9+
cycler==0.10.0
10+
decorator==4.1.2
11+
entrypoints==0.2.3
12+
enum34==1.1.6
13+
Flask==0.12.2
14+
Flask-API==1.0
15+
Flask-Caching==1.3.3
16+
Flask-Cors==3.0.3
17+
Flask-Testing==0.7.1
18+
graphviz==0.8.1
19+
h5py==2.7.1
20+
html5lib==0.9999999
21+
idna==2.6
22+
ipykernel==4.7.0
23+
ipython==6.2.1
24+
ipython-genutils==0.2.0
25+
ipywidgets==7.0.5
26+
itsdangerous==0.24
27+
jedi==0.11.1
28+
Jinja2==2.10
29+
jsonschema==2.6.0
30+
jupyter==1.0.0
31+
jupyter-client==5.1.0
32+
jupyter-console==5.2.0
33+
jupyter-core==4.4.0
34+
Keras==2.1.2
35+
lesscpy==0.12.0
36+
lxml==4.1.1
37+
Markdown==2.6.10
38+
MarkupSafe==1.0
39+
matplotlib==2.1.0
40+
mistune==0.8.3
41+
nbconvert==5.3.1
42+
nbformat==4.4.0
43+
nose==1.3.7
44+
notebook==5.2.2
45+
numpy==1.13.3
46+
pandas==0.21.1
47+
pandocfilters==1.4.2
48+
parso==0.1.1
49+
pexpect==4.3.1
50+
pickleshare==0.7.4
51+
ply==3.10
52+
prompt-toolkit==1.0.15
53+
protobuf==3.5.0.post1
54+
ptyprocess==0.5.2
55+
pydot==1.2.3
56+
Pygments==2.2.0
57+
pyparsing==2.2.0
58+
python-dateutil==2.6.1
59+
pytz==2017.3
60+
PyYAML==3.12
61+
pyzmq==16.0.3
62+
qtconsole==4.3.1
63+
redis==2.10.6
64+
rednose==1.2.3
65+
requests==2.18.4
66+
scipy==1.0.0
67+
seaborn==0.8.1
68+
simplegeneric==0.8.1
69+
six==1.11.0
70+
tensorflow==1.4.0
71+
tensorflow-tensorboard==0.4.0rc3
72+
terminado==0.8.1
73+
termstyle==0.1.11
74+
testpath==0.3.1
75+
tornado==4.5.2
76+
tqdm==4.19.4
77+
traitlets==4.3.2
78+
urllib3==1.22
79+
wcwidth==0.1.7
80+
Werkzeug==0.13
81+
widgetsnbextension==3.0.8

Chapter-4/activity_1/test_stack.py

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
"""
2+
Simple tests for verifying software requirements.
3+
These tests will check if the following conditions
4+
are met:
5+
6+
* Python is 3.0 or higher.
7+
* TensorFlow is 1.4 or higher.
8+
* Keras is 2.0 or higher.
9+
10+
The program returns helpful error messages if
11+
the conditions above are not met.abs
12+
13+
Proceed to Lesson 2 when all tests pass.
14+
15+
--
16+
Author: Luis Capelo
17+
Date: October 17, 2017
18+
"""
19+
import sys
20+
21+
22+
def __separator(c):
23+
"""
24+
Prints a pretty separator.
25+
26+
Parameters
27+
----------
28+
c: str
29+
Character to use.
30+
"""
31+
print(c * 65)
32+
33+
def test_python():
34+
"""
35+
Tests if Python 3 is installed.
36+
"""
37+
message = None
38+
if sys.version_info[0] == 3:
39+
success = True
40+
log = """
41+
PASS: Python 3.0 (or higher) is installed.
42+
"""
43+
44+
else:
45+
success = False
46+
log = """
47+
FAIL: Python 3.0 (or higher) not detected.
48+
"""
49+
message = """
50+
Please install it before proceeding.
51+
Follow instructions in the official Python
52+
website in order to install it in your platform:
53+
54+
https://www.python.org/downloads/
55+
"""
56+
57+
print(log)
58+
if message:
59+
print(message)
60+
61+
__separator('~')
62+
return success
63+
64+
def test_tensorflow():
65+
"""
66+
Tests if TensorFlow is installed.
67+
"""
68+
message = None
69+
try:
70+
import tensorflow
71+
72+
if tensorflow.__version__ >= '1.4.0':
73+
success = True
74+
log = """
75+
PASS: TensorFlow 1.4.0 (or higher) is installed.
76+
"""
77+
78+
else:
79+
success = False
80+
log = """
81+
FAIL: TensorFlow 1.4.0 (or higher) not detected.
82+
"""
83+
message = """
84+
Please install it before proceeding.
85+
Follow instructions in the official TensorFlow
86+
website in order to install it in your platform:
87+
88+
https://www.tensorflow.org/install/
89+
"""
90+
91+
except ModuleNotFoundError:
92+
success = False
93+
log = """
94+
FAIL: TensorFlow 1.4.0 (or higher) not detected.
95+
"""
96+
message = """
97+
Please install it before proceeding.
98+
Follow instructions in the official TensorFlow
99+
website in order to install it in your platform:
100+
101+
https://www.tensorflow.org/install/
102+
"""
103+
104+
print(log)
105+
if message:
106+
print(message)
107+
108+
__separator('~')
109+
return success
110+
111+
def test_keras():
112+
"""
113+
Tests if Keras is installed.
114+
"""
115+
message = None
116+
try:
117+
import keras
118+
119+
if sys.version_info[0] == 3:
120+
success = True
121+
log = """
122+
PASS: Keras 2.0 (or higher) is installed.
123+
"""
124+
125+
else:
126+
success = False
127+
log = """
128+
FAIL: Keras 2.0 (or higher) not detected.
129+
"""
130+
message = """
131+
Please install it before proceeding.
132+
Follow instructions in the official Keras
133+
website in order to install it in your platform:
134+
135+
https://keras.io/#installation
136+
"""
137+
138+
except ModuleNotFoundError:
139+
success = False
140+
log = """
141+
FAIL: Keras 2.0 (or higher) not detected.
142+
"""
143+
message = """
144+
Please install it before proceeding.
145+
Follow instructions in the official Keras
146+
website in order to install it in your platform:
147+
148+
https://keras.io/#installation
149+
"""
150+
151+
print(log)
152+
if message:
153+
print(message)
154+
155+
__separator('~')
156+
return success
157+
158+
159+
if __name__ == '__main__':
160+
__separator('=')
161+
test_results = [
162+
test_python(),
163+
test_tensorflow(),
164+
test_keras()]
165+
166+
if False in test_results:
167+
print(
168+
"""
169+
** Please review software requirements before
170+
** proceeding to Lesson 2.
171+
"""
172+
)
173+
else:
174+
print(
175+
"""
176+
** Python, TensorFlow, and Keras are available.
177+
"""
178+
)
179+
__separator('=')

0 commit comments

Comments
 (0)