DIGITS-CNN/cars/lr-investigations/lr.ipynb

151 lines
59 KiB
Plaintext
Raw Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "a6961e73",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib as mpl\n",
"from matplotlib import pyplot as plt"
]
},
{
"cell_type": "markdown",
"id": "5d93832a",
"metadata": {},
"source": [
"# Fixed Learning Rate\n",
"80/10/10 Split, 200 epochs\n",
"\n",
"## Index\n",
"0. learning rate\n",
"1. top-1 accuracy\n",
"2. top-5 accuracy\n",
"3. last val loss\n",
"4. last val accuracy"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "95b71471",
"metadata": {},
"outputs": [],
"source": [
"fixed_results = np.array([\n",
" [1e-6, 0.31, 2.84, 5.28, 0.67],\n",
" [1e-5, 0.8, 2.59, 5.28, 0.55],\n",
" [1e-4, 6.98, 17.23, 4.6, 7.41],\n",
" [1e-3, 21.56, 44.72, 4.97, 26.9],\n",
" [5e-3, 39.35, 66.83, 3.34, 43.5],\n",
" [1e-2, 13.65, 30.02, 4.15, 17.46],\n",
" [5e-2, 1.79, 6.73, 5.13, 1.78],\n",
" [1e-1, 0.8, 2.78, 5.29, 0.55]\n",
"])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4d1d5559",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEaCAYAAAAWvzywAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAABnBklEQVR4nO2dd3hUxdeA35MCCSQhgYQaSEIXAgmE3rsURRSRpgL6iaICilix8LOiAiKIYKOKFLsgqLTQpYTea0IvCYEkQNrufH/cTQyQsimbTZn3efbZvXOnnLl799zZM2fOiFIKjUaj0RQfHOwtgEaj0WjyF634NRqNppihFb9Go9EUM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0wzlVJ+WWbW5Ag94tcUKizmj8ak+ZegKdxYzFs9LebFKhhmpl/tLVdRRit+TaFBROZi/O1+wWJe0RQNBMOcFY1h6jmEsaZBYyNsZuoRkTrcPiqrjvFlzrOk+2O40T2ilIq2iRAajUajuYt8sfFbXPzOYbgOPgdcVUpNEJHXAC+lVHZn8TUajUaTQ/LL1NMZY7FLBPAA/wW1mouxlF+j0Wg0+UR+rdwdgOFHDcYClwuWzxcxQhDchYgMx1iajqura0jVqlav6bgNs9mMg0PxmsrQfS4e6D4XfXLb36NHj0Yqpe5cUGn7WD0Y/uaRGAof4Nod56OzqiMkJETllLVr1+a4bGFF97l4oPtc9Mltf4EdKh2dmh+Pzh4Yi20uWY4viUglAMv75XyQQaPRaDQW8kPxD+Q/Mw8YKxqHWD4PwQi8pdFoNJp8wqaK3xIIqyu3hxyYgBFX4xhG+NVCH+lOo9FoChM2ndxVRnC
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.plot(fixed_results[:, 0], fixed_results[:, 1], 'x-', label=\"Top-1 Accuracy\")\n",
"plt.plot(fixed_results[:, 0], fixed_results[:, 2], 'x-', label=\"Top-5 Accuracy\")\n",
"plt.plot(fixed_results[:, 0], fixed_results[:, 4], 'x-', label=\"Final Val. Accuracy\")\n",
"\n",
"plt.ylim(0)\n",
"\n",
"plt.title('Model Accuracy for Varied Learning Rates')\n",
"plt.ylabel('% Accuracy')\n",
"plt.xlabel('Learning Rate')\n",
"\n",
"plt.legend()\n",
"plt.xscale('log')\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "21a098c5",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEaCAYAAAAL7cBuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bG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PUTnLO3f+I0jn8dp+tzZaMbftF7OGdj21V1ScD864A7ReQgcBvNP7OpcznOl9tanHI/i1MXDs5r8TqwEliO8+OgKa9y9Gt+B/B3nLOcN9w4FwInues/hvNaF7gxLGxh/K2mqq8B/8BpfP8s4NgVzdy+Eqdsv1LVg8ANOK9/EU6inhew7nqcHyeb3CqlPjT+uvTCeS8O4FQ9vYvzvxE1xG04McaYmCdO9+PVQFIbzlo7DDuDMMbENBG5QESS3Cq0PwAvWXJoHksQxphYdw2wB9iI04PoB5ENp/2wKiZjjDFB2RmEMcaYoCxBGGOMCard3/kxUGZmpg4cOLBV2x46dIguXbqENqAoZ2WOfR2tvGBlbqlly5YVqmqPYMtiKkEMHDiQpUtbfPt8AHJzc5k8eXJoA4pyVubY19HKC1bmlhKRBm+vYlVMxhhjgrIEYYwxJihLEMYYY4KyBGGMMSYoSxDGGNMO3ffuRhZsLDxq3oKNhdz37saQHaNDJ4hwvMDRpiOW2ZhYNCI7jRlP5h35f16wsZAZT+YxIjutiS2br0MniHC8wNGmI5bZmFiU489k5sWjuW7Ocv69spwZT+Yx8+LR5PibO7hj02LqOoiWqnuBr3lsGcMylDXzl/GDyYMpr6rhnfWhHOAsunzvSwO55vFlnNYHFrwf+g+VMSY
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.plot(fixed_results[:, 0], fixed_results[:, 3], 'x-', label=\"Final Validation Loss\")\n",
"\n",
"# plt.ylim(0)\n",
"\n",
"plt.title('Final Validation Loss for Varied Learning Rates')\n",
"plt.ylabel('Loss')\n",
"plt.xlabel('Learning Rate')\n",
"\n",
"# plt.legend()\n",
"plt.xscale('log')\n",
"plt.grid()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "32fb71f0",
"metadata": {},
"outputs": [],
"source": []
}
],
"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.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}