{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2018-09-30T16:27:30.263598Z", "start_time": "2018-09-30T16:27:29.930319Z" } }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# The data\n", "resnet = np.asarray([0.8375262254326821, 0.8678992675159352, 0.8527975528611832, 0.8523278104598541, 0.884647507843369, 0.9665709773157553, \n", " 0.941322385257967, 0.9607122054596926, 1.0446496050070293, 1.5978083756003671])\n", "fully = np.asarray([0.2938374312588796, 0.3047676507445782, 0.29713952786808656, 0.3112794673912947, 0.335618492063216, 0.3853395053207258, \n", " 0.40619997414669395, 0.43130068820046324, 0.5361458921673319, 0.6306651849357078])\n", "\n", "resnet = np.flip(resnet)\n", "fully = np.flip(fully)\n", "indices = range(len(resnet))\n", "names = ['1x','1x','2x','3x','4x', '5x', '6x', '7x', '8x', '9x', '10x']\n", "# Calculate optimal width\n", "width = np.min(np.diff(indices))/3.\n", "\n", "fig = plt.figure(figsize=(5,2.5))\n", "ax = fig.add_subplot(111)\n", "ax.bar(indices-width/2.,resnet,width,color='b',label='resnet (D)')\n", "ax.bar(indices+width/2.,fully,width,color='r',label='densenet (A)')\n", "#tiks = ax.get_xticks().tolist()\n", "#ax.axes.set_xticklabels(names)\n", "plt.xticks(np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), \n", " ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))\n", "ax.set_xlabel('Training Data Size (multiples of 9K)')\n", "ax.set_ylabel('Test MRE (%)')\n", "ax.spines['top'].set_visible(False)\n", "ax.spines['right'].set_visible(False)\n", "ax.legend(loc=\"best\")\n", "fig.savefig(\"datasize.pdf\", bbox_inches='tight')\n", "#ax.spines['bottom'].set_visible(False)\n", "#ax.spines['left'].set_visible(False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "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.5.6" } }, "nbformat": 4, "nbformat_minor": 2 }