Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94e779d

Browse files
committed
FC & CNN w/o Normalization or Augmentation
1 parent 18d9a9a commit 94e779d

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

Lectures/lecture7a.ipynb

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"#### Turn Off Keras & TF Messages:\n",
36+
"#### Turn Off Messages & Set GPU Memory Growth:\n",
3737
"TF_CPP_MIN_LOG_LEVEL:\n",
3838
" - 0 = all messages are logged (default behavior)\n",
3939
" - 1 = INFO messages are not printed\n",
@@ -48,7 +48,8 @@
4848
"outputs": [],
4949
"source": [
5050
"import os\n",
51-
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'"
51+
"os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
52+
"os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'"
5253
]
5354
},
5455
{
@@ -114,13 +115,12 @@
114115
"from keras.datasets import cifar10\n",
115116
"from random import randint\n",
116117
"import numpy as np\n",
117-
"import pandas as pd\n",
118118
"import matplotlib.pyplot as plt\n",
119119
"from keras.models import Sequential, load_model, Model\n",
120120
"from keras.layers import Dense, Conv2D, Activation, MaxPooling2D, Flatten, Dropout\n",
121121
"from keras.callbacks import ModelCheckpoint\n",
122122
"from keras.utils.np_utils import to_categorical\n",
123-
"from keras.utils.vis_utils import plot_model, model_to_dot\n",
123+
"from keras.utils.vis_utils import plot_model\n",
124124
"from tensorflow.keras.datasets import fashion_mnist"
125125
]
126126
},
@@ -138,25 +138,6 @@
138138
"metadata": {},
139139
"outputs": [],
140140
"source": [
141-
"# plot training accuracy and loss\n",
142-
"def plotCurve(trainingAccuracy, trainingLoss):\n",
143-
" epochs = np.arange(trainingLoss.shape[0])\n",
144-
" #print(epochs)\n",
145-
" plt.figure(figsize = [12, 6])\n",
146-
" plt.subplot(1, 2, 1)\n",
147-
" plt.plot(epochs, trainingAccuracy)\n",
148-
" #plt.axis([-1, 2, -1, 2])\n",
149-
" plt.xlabel('Epoch')\n",
150-
" plt.ylabel('Accuracy')\n",
151-
" plt.title('Training Accuracy')\n",
152-
"\n",
153-
" plt.subplot(1, 2, 2)\n",
154-
" plt.plot(epochs, trainingLoss)\n",
155-
" plt.xlabel('Epoch')\n",
156-
" plt.ylabel('Binary CrossEntropy Loss')\n",
157-
" plt.title('Training Loss')\n",
158-
" plt.show()\n",
159-
"\n",
160141
"def plotBothCurves(trainingAccuracy, trainingLoss, validAccuracy, validLoss):\n",
161142
" epochs = np.arange(trainingLoss.shape[0])\n",
162143
" epochsSaved = np.arange(validLoss.shape[0])\n",

0 commit comments

Comments
 (0)