<jupyter_start><jupyter_text>Error plots<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
#Varying Embedding
#seq=20,batch=20,nhid=256
emb300=np.genfromtxt('LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
emb500=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
emb700=np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
emb1000=np.genfromtxt('LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')

emb300test=np.genfromtxt('LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
emb500test=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
emb700test=np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
emb1000test=np.genfromtxt('LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')

emb300test[-1,1]=np.sum(emb300test[:-1,1])
emb500test[-1,1]=np.sum(emb500test[:-1,1])
emb700test[-1,1]=np.sum(emb700test[:-1,1])
emb1000test[-1,1]=np.sum(emb1000test[:-1,1])

print(emb300[4,:])

f,(ax1,ax2) = plt.subplots(1,2,figsize=(16,12))

ax1.plot(emb300[:,4])
ax1.plot(emb500[:,4])
ax1.plot(emb700[:,4])
ax1.plot(emb1000[:,4])

ax1.legend(["Emb=300","Emb=500","Emb=700","Emb=1000"])
ax1.set_yscale("log")
ax1.set_xscale("log")
ax1.set_title("Training Losses")
ax1.set_xlabel("Processed batches")
ax1.set_ylabel("Loss")

ax2.plot(emb300test[:,2])
ax2.plot(emb500test[:,2])
ax2.plot(emb700test[:,2])
ax2.plot(emb1000test[:,2])

ax2.legend(["Emb=300","Emb=500","Emb=700","Emb=1000"])
ax2.set_yscale("log")
#ax2.set_xscale("log")
ax2.set_title("Test Losses")
ax2.set_xlabel("Epochs")
ax2.set_ylabel("Loss")
print(emb300test[-1,1],emb500test[-1,1],emb700test[-1,1],emb1000test[-1,1])#time spent
#number of layers and seqlength

lay4seq25 = np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_trainErrLog.log', delimiter=',')
lay2seq35 = np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog.log', delimiter=',')
lay2seq20 = emb700 #by coincidence

lay4seq25=lay4seq25[:lay2seq35.shape[0],:] # to equalize epochs

#lay4seq25test = np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog.log', delimiter=',')
#Lost??
lay2seq20test = emb700test #by coincidence
lay2seq35test = np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog.log', delimiter=',')

f,(ax1,ax2) = plt.subplots(1,2,figsize=(16,7))

ax1.plot(lay2seq35[:,4])
ax1.plot(lay2seq20[:,4])
ax1.plot(lay4seq25[:,4])


ax1.legend(["lay=2,Seq=35","lay=2,Seq=20","lay=4,Seq=25"])
ax1.set_yscale("log")
ax1.set_xscale("log")
ax1.set_title("Training Losses")
ax1.set_xlabel("Processed batches")
ax1.set_ylabel("Loss")



ax2.plot(lay2seq35test[:,2])
ax2.plot(lay2seq20test[:,2])


ax2.legend(["lay=2,Seq=35","lay=2,Seq=20"])
ax2.set_yscale("log")
#ax2.set_xscale("log")
ax2.set_title("Test Losses")
ax2.set_xlabel("Epochs")
ax2.set_ylabel("Loss")
#number of layers and seqlength
#Just plot all

LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_trainErrLog.log', delimiter=',')

LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_trainErrLog=np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_trainErrLog.log', delimiter=',')
LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog=np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog.log', delimiter=',')

LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog.log', delimiter=',')
LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog=np.genfromtxt('LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog.log', delimiter=',')

LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog = np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog.log', delimiter=',')


#test
LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')
LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_testErrLog.log', delimiter=',')

#LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog=np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog.log', delimiter=',')
LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog=np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog.log', delimiter=',')

LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog.log', delimiter=',')
LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog=np.genfromtxt('LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog.log', delimiter=',')

LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog = np.genfromtxt("LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog.log",delimiter=",")
f,(ax1,ax2) = plt.subplots(1,2,figsize=(12,8))

ax1.plot(LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_trainErrLog[:,4])
ax1.plot(LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_trainErrLog[:,4])
ax1.plot(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_trainErrLog[:,4])
ax1.plot(LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_trainErrLog[:,4])

ax1.plot(LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_trainErrLog[:,4])
ax1.plot(LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog[:,4])

ax1.plot(LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog[:,4])
ax1.plot(LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_trainErrLog[:,4])

ax1.plot(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_trainErrLog[:,4])



ax1.legend(["LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20",
            "LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20",
            "LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20",
            "LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20",
            "LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25",
            "LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35",
            "LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20",
            "LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20",
            "LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35"],loc='center left', bbox_to_anchor=(-1.4, 0.7)
)
ax1.set_yscale("log")
ax1.set_xscale("log")
ax1.set_title("Training Losses")
ax1.set_xlabel("Processed batches")
ax1.set_ylabel("Loss")



ax2.plot(LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_testErrLog[:,2])
ax2.plot(LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_testErrLog[:,2])
ax2.plot(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_testErrLog[:,2])
ax2.plot(LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_testErrLog[:,2])

#ax2.plot(LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog[:,2])
ax2.plot(LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog[:,2])

ax2.plot(LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog[:,2])
ax2.plot(LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog[:,2])

ax2.plot(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog[:,2])


#ax2.legend(["LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20",
#            "LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20",
#            "LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20",
#            "LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20",
#            "LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35",
#            "LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20",
#            "LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20",
#            "LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35"])
ax2.set_yscale("log")
#ax2.set_xscale("log")
ax2.set_title("Test Losses")
ax2.set_xlabel("Epochs")
ax2.set_ylabel("Loss")
#TRAINING TIMES (sec)
#number of layers and seqlength
#Just plot all

print("LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20 &",np.sum(LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20_testErrLog[:-1,1]),"\\\\")
print("LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20 &",np.sum(LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20_testErrLog[:-1,1]),"\\\\")
print("LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20 &",np.sum(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20_testErrLog[:-1,1]),"\\\\")
print("LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20 &",np.sum(LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20_testErrLog[:-1,1]),"\\\\")
#LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog=np.genfromtxt('LSTM_voc62000_batch15_emsize700_nlay4_nhid256_ep31_bptt25_testErrLog.log', delimiter=',')

print("LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35 &",np.sum(LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog[:-1,1]),"\\\\")

print("LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20 &",np.sum(LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog[:-1,1]),"\\\\")
print("LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20 &",np.sum(LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20_testErrLog[:-1,1]),"\\\\")

print("LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35 &",np.sum(LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35_testErrLog[:-1,1]),"\\\\")<jupyter_output>LSTM_voc62000_batch20_emsize300_nlay2_nhid256_ep6_bptt20 & 6447.88 \\
LSTM_voc62000_batch20_emsize500_nlay2_nhid256_ep6_bptt20 & 7015.170000000001 \\
LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt20 & 7624.290000000001 \\
LSTM_voc62000_batch20_emsize1000_nlay2_nhid256_ep6_bptt20 & 8508.060000000001 \\
LSTM_voc62000_batch15_emsize700_nlay2_nhid256_ep6_bptt35 & 7100.4400000000005 \\
LSTM_voc62000_batch20_emsize500_nlay2_nhid500_ep6_bptt20 & 11405.36 \\
LSTM_voc62000_batch10_emsize500_nlay2_nhid500_ep6_bptt20 & 15458.5 \\
LSTM_voc62000_batch20_emsize700_nlay2_nhid256_ep6_bptt35 & 6064.17 \\
{'fraction_non_alphanumeric': 0.10910342453966615, 'fraction_numerical': 0.1998795388057133, 'mean_word_length': 14.728010825439783, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '639354', 'license': 'MIT', 'n_tokens_mistral': 6858, 'n_tokens_neox': 5661, 'n_words': 257, 'path': 'wordLSTM/errData/Charts.ipynb', 'repo_name': 'XuMuK1/JokeGeneration', 'size': '11622'}