Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
05f230d1
"docs/git@developer.sourcefind.cn:change/sglang.git" did not exist on "b17c5b0118861b2d5ddef68ef47967e3f5227f11"
Unverified
Commit
05f230d1
authored
Aug 16, 2018
by
Mark Daoust
Committed by
GitHub
Aug 16, 2018
Browse files
Smaller figure grid, remove tics from bar plots.
parent
b2e03585
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
samples/core/tutorials/keras/basic_classification.ipynb
samples/core/tutorials/keras/basic_classification.ipynb
+10
-12
No files found.
samples/core/tutorials/keras/basic_classification.ipynb
View file @
05f230d1
...
@@ -541,9 +541,6 @@
...
@@ -541,9 +541,6 @@
},
},
"cell_type": "code",
"cell_type": "code",
"source": [
"source": [
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
"plt.figure(figsize=(10,10))\n",
"plt.figure(figsize=(10,10))\n",
"for i in range(25):\n",
"for i in range(25):\n",
" plt.subplot(5,5,i+1)\n",
" plt.subplot(5,5,i+1)\n",
...
@@ -882,6 +879,8 @@
...
@@ -882,6 +879,8 @@
"\n",
"\n",
"def plot_value_array(predictions_array, true_label):\n",
"def plot_value_array(predictions_array, true_label):\n",
" plt.grid('off')\n",
" plt.grid('off')\n",
" plt.xticks([])\n",
" plt.yticks([])\n",
" thisplot = plt.bar(range(10), predictions_array, color=\"#777777\")\n",
" thisplot = plt.bar(range(10), predictions_array, color=\"#777777\")\n",
" plt.ylim([0, 1]) \n",
" plt.ylim([0, 1]) \n",
" predicted_label = np.argmax(predictions_array)\n",
" predicted_label = np.argmax(predictions_array)\n",
...
@@ -961,16 +960,15 @@
...
@@ -961,16 +960,15 @@
"source": [
"source": [
"# Plot the first X test images, their predicted label, and the true label\n",
"# Plot the first X test images, their predicted label, and the true label\n",
"# Color correct predictions in blue, incorrect predictions in red\n",
"# Color correct predictions in blue, incorrect predictions in red\n",
"num_images = int(50)\n",
"num_rows = 5\n",
"plt.figure(figsize=(24,20))\n",
"num_cols = 3\n",
"num_images = num_rows*num_cols\n",
"plt.figure(figsize=(2*2*num_cols, 2*num_rows))\n",
"for i in range(num_images):\n",
"for i in range(num_images):\n",
" plt.subplot(10,num_images / 5,2*i+1)\n",
" plt.subplot(num_rows, 2*num_cols, 2*i+1)\n",
" plot_image(predictions[i], test_labels[i], test_images[i])\n",
" plot_image(predictions[i], test_labels[i], test_images[i])\n",
" \n",
" plt.subplot(num_rows, 2*num_cols, 2*i+2)\n",
" plt.subplot(10,num_images / 5,2*i+2)\n",
" plot_value_array(predictions[i], test_labels[i])\n",
" plt.xticks([])\n",
" plt.yticks([])\n",
" plot_value_array(predictions[i], test_labels[i])"
],
],
"execution_count": 0,
"execution_count": 0,
"outputs": []
"outputs": []
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment