Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified notebook examples #319

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 0 additions & 13 deletions .gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/TensorFlow-Examples.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

454 changes: 454 additions & 0 deletions .idea/dbnavigator.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions notebooks/0_Prerequisite/ml_introduction.ipynb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
],
"metadata": {
"kernelspec": {
"display_name": "IPython (Python 2.7)",
"display_name": "PyCharm (jupyterconverter)",
"language": "python",
"name": "python2"
"name": "pycharm-3058efaf"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 4
}
46 changes: 33 additions & 13 deletions notebooks/0_Prerequisite/mnist_dataset_intro.ipynb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,27 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"!pip install tensorflow --user"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Import MNIST\n",
"from tensorflow.examples.tutorials.mnist import input_data\n",
"mnist = input_data.read_data_sets(\"/tmp/data/\", one_hot=True)\n",
"import os\n",
"data_path = \"./dataset/mnist_dataset_intro/\"\n",
"try:\n",
" os.makedirs(data_path)\n",
"except FileExistsError:\n",
" pass\n",
"mnist = input_data.read_data_sets(data_path, one_hot=True)\n",
"\n",
"# Load data\n",
"X_train = mnist.train.images\n",
Expand All @@ -53,9 +66,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# Get the next 64 images array and labels\n",
Expand All @@ -72,23 +83,32 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "PyCharm (jupyterconverter)",
"language": "python",
"name": "python2"
"name": "pycharm-3058efaf"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
"pygments_lexer": "ipython3",
"version": "3.6.8"
},
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
}
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 4
}
88 changes: 88 additions & 0 deletions notebooks/0_Prerequisite/tensorflow_gpu_validator.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install tensorflow --user"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install wurlitzer --user\n",
"\n",
"import tensorflow as tf\n",
"# Creates a graph.\n",
"a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n",
"b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')\n",
"c = tf.matmul(a, b)\n",
"\n",
"tf.logging.set_verbosity(tf.logging.INFO)\n",
"# Creates a session with log_device_placement set to True.\n",
"sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))\n",
"\n",
"# Runs the op.\n",
"from wurlitzer import pipes\n",
"\n",
"with pipes() as (out, err):\n",
" print(sess.run(c))\n",
"\n",
"print (out.read())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Creates a graph.\n",
"a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')\n",
"b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')\n",
"c = tf.matmul(a, b)\n",
"# Creates a session with log_device_placement set to True.\n",
"sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))\n",
"# Runs the op.\n",
"print(sess.run(c))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with tf.Session() as sess:\n",
" devices = sess.list_devices()\n",
" print(devices)"
]
}
],
"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.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}