<jupyter_start><jupyter_text>Plots, plots, plotsWe can do better than including TensorBoard screenshots, right?<jupyter_code>import os

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

%matplotlib inline
import json
# Andrei's plot dumps (CSV dumps were not working in TB for some reason)

plot_root = os.path.join('..', 'data', 'plots')

CNN = os.path.join(plot_root, 'run-euler-cnn-w2v-300d-1466952510-euler-cnn-pp-hf-20-lf-4-htfb-10-mscl-5-summaries-dev-tag-accuracy.json')
LSTM_SHALLOW = os.path.join(plot_root, 'run-euler-lstm-128-35-words-w2v-300-pretrained-1466514832-summaries-dev-tag-accuracy.json')
LSTM_DEEP = os.path.join(plot_root, 'run-euler-lstm-w2v-300d-1467126384-euler-summaries-dev-tag-accuracy.json')
def load_json_curve(fname):
    with open(fname, 'r') as f:
        return json.loads(f.read())
cnn_curve = load_json_curve(CNN)
lstm_shallow_curve = load_json_curve(LSTM_SHALLOW)
lstm_deep_curve = load_json_curve(LSTM_DEEP)
BATCH_SIZE = 256
EPOCH_STEPS = 2500000 * 0.9 / BATCH_SIZE

print("We have {0} steps in one epoch.".format(EPOCH_STEPS))
curves = {
    'cnn': ['CNN', cnn_curve],
    'lstm_s': ['1 layer LSTM @ 128 units', lstm_shallow_curve],
    'lstm_d': ['2 layer LSTM @ 300+256 units', lstm_deep_curve]
}
font = {'family' : '',
        'weight' : 'regular',
        'size'   : 12}

matplotlib.rc('font', **font)
for curve in curves.values():
    cname, cpoints = curve
    plt.plot([p[1] / EPOCH_STEPS for p in cpoints], [p[2] for p in cpoints],
            label=cname)
    

plt.xlabel("Training epochs", **font)
plt.ylabel("Development Accuracy", **font)
plt.ylim([0.80, 0.90])
plt.legend(loc='lower right')
plt.savefig(os.path.join(plot_root, 'cnn_vs_lstm.eps'))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15085714285714286, 'fraction_numerical': 0.04971428571428571, 'mean_word_length': 4.612179487179487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '25059', 'license': 'Apache-1.1', 'n_tokens_mistral': 797, 'n_tokens_neox': 711, 'n_words': 137, 'path': 'notebooks/Pretty Plots.ipynb', 'repo_name': 'NikosKolitsas/twitter_sentiment_analysis', 'size': '1750'}