mtgencode/mtg_sweep1.ipynb

334 lines
32 KiB
Text
Raw Normal View History

2015-12-06 22:26:02 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Opening encoded card file: /home/mtgencode/data/output.txt\n",
"15065 valid, 0 skipped, 0 invalid, 0 failed to parse.\n",
"generating 3-gram model\n",
"found 25046 sentences\n",
"<NgramModel with 34500 3-grams>\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_128_1_epoch50.00_0.3941.output.1.0.txt\n",
"5549 valid, 0 skipped, 88 invalid, 29 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_128_2_epoch50.00_0.3862.output.1.0.txt\n",
"5360 valid, 0 skipped, 121 invalid, 35 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_256_1_epoch50.00_0.2736.output.1.0.txt\n",
"5732 valid, 0 skipped, 71 invalid, 17 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_256_2_epoch50.00_0.2645.output.1.0.txt\n",
"5348 valid, 0 skipped, 50 invalid, 29 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_384_1_epoch50.00_0.2117.output.1.0.txt\n",
"5889 valid, 0 skipped, 56 invalid, 15 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_384_2_epoch50.00_0.2102.output.1.0.txt\n",
"5887 valid, 0 skipped, 57 invalid, 35 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_512_1_epoch50.00_0.1952.output.1.0.txt\n",
"5701 valid, 0 skipped, 44 invalid, 32 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_512_2_epoch50.00_0.1807.output.1.0.txt\n",
"5711 valid, 0 skipped, 49 invalid, 24 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_640_1_epoch50.00_0.1798.output.1.0.txt\n",
"5726 valid, 0 skipped, 41 invalid, 33 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_768_1_epoch46.51_0.1834.output.1.0.txt\n",
"5949 valid, 0 skipped, 69 invalid, 18 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_768_2_epoch46.51_0.1906.output.1.0.txt\n",
"5808 valid, 0 skipped, 64 invalid, 23 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_128_1_epoch50.00_0.4641.output.1.0.txt\n",
"5660 valid, 0 skipped, 24 invalid, 19 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/baseline_640_2_epoch50.00_0.1870.output.1.0.txt\n",
"5859 valid, 0 skipped, 51 invalid, 16 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_128_1_epoch50.00_0.5686.output.1.0.txt\n",
"5983 valid, 0 skipped, 33 invalid, 17 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_256_2_epoch50.00_0.4287.output.1.0.txt\n",
"5895 valid, 0 skipped, 19 invalid, 2 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_384_1_epoch50.00_0.3018.output.1.0.txt\n",
"6081 valid, 0 skipped, 10 invalid, 6 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_384_2_epoch50.00_0.2956.output.1.0.txt\n",
"6081 valid, 0 skipped, 22 invalid, 9 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_512_1_epoch50.00_0.2663.output.1.0.txt\n",
"5999 valid, 0 skipped, 25 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_512_2_epoch50.00_0.2597.output.1.0.txt\n",
"6263 valid, 0 skipped, 26 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_640_1_epoch50.00_0.2385.output.1.0.txt\n",
"5863 valid, 0 skipped, 20 invalid, 5 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_640_2_epoch50.00_0.2361.output.1.0.txt\n",
"5941 valid, 0 skipped, 7 invalid, 11 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_768_1_epoch49.83_0.2268.output.1.0.txt\n",
"6065 valid, 0 skipped, 9 invalid, 5 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_768_2_epoch50.00_0.2412.output.1.0.txt\n",
"5919 valid, 0 skipped, 15 invalid, 10 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_384_1_epoch50.00_0.3633.output.1.0.txt\n",
"5997 valid, 0 skipped, 9 invalid, 2 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_384_2_epoch50.00_0.3636.output.1.0.txt\n",
"6047 valid, 0 skipped, 17 invalid, 4 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_512_1_epoch50.00_0.3269.output.1.0.txt\n",
"5894 valid, 0 skipped, 10 invalid, 9 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_512_2_epoch50.00_0.3231.output.1.0.txt\n",
"5942 valid, 0 skipped, 7 invalid, 2 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_640_1_epoch50.00_0.3062.output.1.0.txt\n",
"6002 valid, 0 skipped, 14 invalid, 1 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_640_2_epoch50.00_0.3100.output.1.0.txt\n",
"6057 valid, 0 skipped, 12 invalid, 3 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_768_1_epoch49.83_0.2923.output.1.0.txt\n",
"5896 valid, 0 skipped, 11 invalid, 5 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_768_2_epoch49.83_0.2919.output.1.0.txt\n",
"6047 valid, 0 skipped, 7 invalid, 3 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_128_2_epoch50.00_0.4641.output.1.0.txt\n",
"6226 valid, 0 skipped, 36 invalid, 13 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_256_1_epoch50.00_0.3579.output.1.0.txt\n",
"5910 valid, 0 skipped, 23 invalid, 6 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-25_256_2_epoch50.00_0.3554.output.1.0.txt\n",
"5801 valid, 0 skipped, 22 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_128_2_epoch50.00_0.5690.output.1.0.txt\n",
"6339 valid, 0 skipped, 51 invalid, 22 failed to parse.\n",
"Opening encoded card file: /data/collected/mtg-rnn-sweep1/dropout-50_256_1_epoch50.00_0.4198.output.1.0.txt\n",
"5995 valid, 0 skipped, 12 invalid, 10 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_128_1_epoch37.50_0.4733.output.1.0.txt\n",
"5871 valid, 0 skipped, 130 invalid, 42 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_128_2_epoch45.83_0.4774.output.1.0.txt\n",
"5429 valid, 0 skipped, 129 invalid, 45 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_256_1_epoch16.67_0.4530.output.1.0.txt\n",
"5808 valid, 0 skipped, 124 invalid, 38 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_256_2_epoch16.67_0.4552.output.1.0.txt\n",
"5796 valid, 0 skipped, 103 invalid, 44 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_384_1_epoch12.50_0.4431.output.1.0.txt\n",
"5890 valid, 0 skipped, 111 invalid, 48 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_384_2_epoch12.50_0.4469.output.1.0.txt\n",
"5699 valid, 0 skipped, 98 invalid, 41 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_512_1_epoch12.50_0.4374.output.1.0.txt\n",
"5698 valid, 0 skipped, 138 invalid, 49 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_512_2_epoch12.50_0.4458.output.1.0.txt\n",
"5809 valid, 0 skipped, 111 invalid, 53 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_640_1_epoch12.50_0.4365.output.1.0.txt\n",
"5720 valid, 0 skipped, 123 invalid, 47 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_128_1_epoch50.00_0.4780.output.1.0.txt\n",
"5889 valid, 0 skipped, 54 invalid, 14 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_128_2_epoch50.00_0.4823.output.1.0.txt\n",
"5935 valid, 0 skipped, 45 invalid, 10 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_256_1_epoch50.00_0.4000.output.1.0.txt\n",
"6035 valid, 0 skipped, 25 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_256_2_epoch41.67_0.4244.output.1.0.txt\n",
"6184 valid, 0 skipped, 41 invalid, 7 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/baseline_640_2_epoch12.50_0.4406.output.1.0.txt\n",
"5762 valid, 0 skipped, 119 invalid, 30 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_256_2_epoch50.00_0.4460.output.1.0.txt\n",
"6046 valid, 0 skipped, 18 invalid, 11 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_384_1_epoch41.67_0.3870.output.1.0.txt\n",
"6052 valid, 0 skipped, 29 invalid, 10 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_384_2_epoch33.33_0.3991.output.1.0.txt\n",
"6151 valid, 0 skipped, 17 invalid, 11 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_512_1_epoch25.00_0.3859.output.1.0.txt\n",
"5896 valid, 0 skipped, 23 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_512_2_epoch25.00_0.3894.output.1.0.txt\n",
"6057 valid, 0 skipped, 44 invalid, 10 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_640_1_epoch20.83_0.3864.output.1.0.txt\n",
"5951 valid, 0 skipped, 31 invalid, 24 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-25_640_2_epoch25.00_0.3864.output.1.0.txt\n",
"5776 valid, 0 skipped, 34 invalid, 7 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_128_1_epoch50.00_0.5749.output.1.0.txt\n",
"6097 valid, 0 skipped, 109 invalid, 22 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_128_2_epoch50.00_0.5740.output.1.0.txt\n",
"6026 valid, 0 skipped, 50 invalid, 19 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_256_1_epoch50.00_0.4398.output.1.0.txt\n",
"5932 valid, 0 skipped, 13 invalid, 2 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_384_1_epoch50.00_0.3946.output.1.0.txt\n",
"5958 valid, 0 skipped, 12 invalid, 5 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_384_2_epoch50.00_0.3981.output.1.0.txt\n",
"6042 valid, 0 skipped, 16 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_512_1_epoch50.00_0.3835.output.1.0.txt\n",
"6016 valid, 0 skipped, 21 invalid, 8 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_512_2_epoch50.00_0.3825.output.1.0.txt\n",
"5918 valid, 0 skipped, 11 invalid, 1 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_640_1_epoch20.83_0.4714.output.1.0.txt\n",
"6048 valid, 0 skipped, 18 invalid, 13 failed to parse.\n",
"Opening encoded card file: /data/collected/char-rnn-sweep1/dropout-50_640_2_epoch50.00_0.3805.output.1.0.txt\n",
"5958 valid, 0 skipped, 9 invalid, 2 failed to parse.\n",
"Done gathering data.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/bill/anaconda/lib/python2.7/site-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.\n",
" warnings.warn(\"Mean of empty slice.\", RuntimeWarning)\n",
"/home/bill/anaconda/lib/python2.7/site-packages/numpy/core/_methods.py:70: RuntimeWarning: invalid value encountered in double_scalars\n",
" ret = ret.dtype.type(ret / rcount)\n"
]
}
],
"source": [
"# ipython hack, as we don't seem to know what __file__ is\n",
"mtgencodedir = '/home/mtgencode' # might want to make a symlink\n",
"\n",
"import sys\n",
"import os\n",
"from collections import OrderedDict\n",
"libdir = os.path.join(mtgencodedir, 'lib')\n",
"sys.path.append(libdir)\n",
"scriptdir = os.path.join(mtgencodedir, 'scripts')\n",
"sys.path.append(scriptdir)\n",
"datadir = os.path.join(mtgencodedir, 'data')\n",
"import jdecode\n",
"import ngrams\n",
"import analysis\n",
"\n",
"realcards = jdecode.mtg_open_file(str(os.path.join(datadir, 'output.txt')), verbose=True)\n",
"separate_lines = True\n",
"lm = ngrams.build_ngram_model(realcards, n=3, separate_lines=separate_lines, verbose=True)\n",
"\n",
"mtg_sweep1_dir = '/data/collected/mtg-rnn-sweep1'\n",
"char_sweep1_dir = '/data/collected/char-rnn-sweep1'\n",
"\n",
"def sweep_outputs(sweepdir):\n",
" if not os.path.isdir(sweepdir):\n",
" print('not a directory: ' + sweepdir)\n",
" return []\n",
" else:\n",
" return [fname for fname in os.listdir(sweepdir) if os.path.isfile(os.path.join(sweepdir, fname))\n",
" and fname[-4:] == '.txt']\n",
"\n",
"def setup_statistics(sweepdir):\n",
" cps = sweep_outputs(sweepdir)\n",
" all_stats = OrderedDict()\n",
" for cp in cps:\n",
" cp_stats = analysis.get_statistics(os.path.join(sweepdir, cp), lm=lm, sep=separate_lines, verbose=True)\n",
" if 'cp' in cp_stats and 'name' in cp_stats['cp']:\n",
" cp_name = cp_stats['cp']['name']\n",
" else:\n",
" cp_name = cp\n",
" all_stats[cp_name] = cp_stats\n",
" return all_stats\n",
"\n",
"mtg_sweep1 = setup_statistics(mtg_sweep1_dir)\n",
"char_sweep1 = setup_statistics(char_sweep1_dir)\n",
"\n",
"print 'Done gathering data.'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"\n",
"t0 = 1\n",
"t1 = 3\n",
"xs = [2,2,2,1,1,2,3]\n",
"bins = 3\n",
"\n",
"fig, ax = plt.subplots(figsize=(20,5))\n",
"fig2, ax2 = plt.subplots(figsize=(10,10))\n",
"ax.hist(xs, bins=bins, range=(t0,t1), histtype='barstacked', stacked=True, align='left')\n",
"ax.autoscale_view()\n",
"ax.set_ylabel('worktime [h]')\n",
"ax.legend([\"a\"], loc=\"best\")\n",
"fig.autofmt_xdate()\n",
"\n",
"ax2.hist(xs, bins=bins, range=(t0,t1), histtype='barstacked', stacked=True, align='left')\n",
"ax2.autoscale_view()\n",
"ax2.set_ylabel('tim [h]')\n",
"ax2.legend([\"a\"], loc=\"best\")\n",
"fig2.autofmt_xdate()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
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6F\nlCTNFsNdklrIcJekFjLcJamFDHdJaiHDXZJayHCXpBYy3CWphQx3SWohw12SWshwl6QWMtwlqYUM\nd0lqIcNdklrIcJekFjLcJamFDHdJaiHDXZJayHCXpBZaN9yTnJXkYJJHkiwk+ddN+54k30ryYPN4\n2+TLlST1Y90bZCeZA+aq6nCS04AvA5cCvw78oKpuXGd5b5AtSQMa9QbZW9eboaoWgcVm+odJHgN+\nZuX9h31jSdLkDDTmnuQcYCdwqGm6OsnhJDcn2T7m2iRJQ1q3576iGZL5DHBt04O/CfjtqqokHwJu\nBN631rLz8/NHpzudDp1OZ5SaJal1ut0u3W53bOtbd8wdIMlW4E7gc1X10TVePxvYX1VvWOM1x9wl\naUCjjrn3OyzzMeDR1cHe7Ghd8WvAV4YtQpI0Xv0cLXMR8OfAAlDN4wbg3fTG35eBJ4EPVNXSGsvb\nc5ekAY3ac+9rWGYUhrskDW6jhmUkSTPEcJekFjLcJamFDHdJaiHDXZJayHCXpBYy3CWphQx3SWoh\nw12SWshwl6QWMtwlqYUMd0lqIcNdklrIcJekFjLcJamFDHdJaiHDXZJayHCXpBYy3CWphdYN9yRn\nJTmY5JEkC0muadp3JLkryRNJPp9k++TLlST1Y90bZCeZA+aq6nCS04AvA5cC7wX+qqo+nOQ6YEdV\n7V5jeW+QLUkDmvgNsqtqsaoON9M/BB4DzqIX8Hub2fYClw1bhCRpvAYac09yDrAT+CJwZlUtQe8H\nADhj3MVJkoaztd8ZmyGZzwDXVtUPkxw71nLcsZf5+fmj051Oh06nM1iVktRy3W6Xbrc7tvWtO+YO\nkGQrcCfwuar6aNP2GNC
"text/plain": [
"<matplotlib.figure.Figure at 0x7f232632ed50>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEACAYAAABVtcpZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFX9JREFUeJzt3X2QZXV95/H3Z0JmYYA1u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jauraleSi7uLaxvwtiS/Bfw98DPg7c3mzwOuT1LNa32qqnYciQORJC3fkt1Bq8XuIEla\nntXqDpIkrVGGgCS1mCEgSS1mCEhSixkCktRihoAktZghIEktZghIUosZApLUYoaAJLWYISBJLWYI\nSFKLGQKS1GKGgCS1mCEgSS1mCEhSixkCktRihoAktZghIEktZghIUosZApLUYoaAJLWYISBJLTZQ\nCCSZTrI7yXySS/ssPzfJ15LckeS2JGcNuq0kaXRSVYdfIVkHzANnAw8Bc8CWqtrds86GqvppM/1S\n4NNV9cuDbNuzj1qqFknSAUmoqqxkH4OcCWwG7q2qPVW1F7gGOK93hYUAaBwHPDXotpKk0RkkBDYC\nD/TMP9i0PU2StyTZBdwIXLCcbSVJo3HUsHZUVTcANyR5LfCHwBuXu4+ZmZn9051Oh06nM6zyJGni\nzc7OMjs7O9R9DjImcCYwU1XTzfxWoKrqysNs8y3gDGBq0G0dE5Ck5VmtMYE54JQkm5KsB7YA2xcV\n8ks9068E1lfVDwfZVpI0Okt2B1XVviSXADvohsbVVbUrycXdxbUNeFuS3wL+HvgZ8PbDbXuEjkWS\ntExLdgetFruDJGl5Vqs7SJK0RhkCktRihoAktZghIEktZghIUosZApLUYoaAJLWYISBJLWYISFKL\nDe0uojpyLrroCubnnzi
"text/plain": [
"<matplotlib.figure.Figure at 0x7f232248e690>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#analysis.print_statistics(mtg_sweep1['baseline_128_1'])\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"def size_from_name(cp_name):\n",
" return int(cp_name.split('_')[-2])\n",
"\n",
"mtg_sizes = [size_from_name(cp) for cp in mtg_sweep1 if 'baseline' in cp]\n",
"char_sizes = [size_from_name(cp) for cp in char_sweep1 if 'baseline' in cp]\n",
"\n",
"mtg_epochs = [mtg_sweep1[cp]['cp']['epoch'] for cp in mtg_sweep1 if 'baseline' in cp]\n",
"char_epochs = [char_sweep1[cp]['cp']['epoch'] for cp in char_sweep1 if 'baseline' in cp]\n",
"\n",
"mtg_vlosses = [mtg_sweep1[cp]['cp']['vloss'] for cp in mtg_sweep1 if 'baseline' in cp]\n",
"char_vlosses = [char_sweep1[cp]['cp']['vloss'] for cp in char_sweep1 if 'baseline' in cp]\n",
"\n",
"#fig, ax = plt.subplots(figsize=(20,10))\n",
"#ax.plot(mtg_sizes, mtg_epochs, 'bs', char_sizes, char_epochs, 'g^')\n",
"#fig.show()\n",
"\n",
"plt.plot(mtg_sizes, mtg_epochs, 'bs', char_sizes, char_epochs, 'g^')\n",
"plt.show()\n",
"\n",
"plt.plot(mtg_sizes, mtg_vlosses, 'bs', char_sizes, char_vlosses, 'g^')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 0
}