Skip to content

Commit f933370

Browse files
Plot the training and validation accuracy
1 parent 056ff02 commit f933370

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Audio_Classification_Using_CNNs.ipynb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,19 +455,18 @@
455455
{
456456
"cell_type": "code",
457457
"source": [
458-
"##############################################\n",
459-
"############# YOUR CODES GO HERE #############\n",
460-
"acc = ...\n",
461-
"val_acc = ...\n",
462-
"##############################################\n",
458+
"acc = hist.history['accuracy']\n",
459+
"val_acc = hist.history['val_accuracy']\n",
463460
"epochs = range(1, len(acc) + 1)\n",
464461
"\n",
462+
"plt.figure(figsize=(8, 5))\n",
465463
"plt.plot(epochs, acc, '-', label='Training Accuracy')\n",
466464
"plt.plot(epochs, val_acc, ':', label='Validation Accuracy')\n",
467465
"plt.title('Training and Validation Accuracy')\n",
468466
"plt.xlabel('Epoch')\n",
469467
"plt.ylabel('Accuracy')\n",
470468
"plt.legend(loc='lower right')\n",
469+
"plt.grid(True)\n",
471470
"plt.plot()"
472471
],
473472
"metadata": {

0 commit comments

Comments
 (0)