<jupyter_start><jupyter_text>calculation<jupyter_code>twod_eucl_rnn, twod_eucl_rnn_loss = log_loader('2D_eucl_rnn.txt')
len(np.array(twod_eucl_rnn_loss['curr_loss']))
time_two = np.cumsum(twod_eucl_rnn_loss['sec_per_sent']*sample_size)
time_two
twod_hyp_rnn, twod_hyp_rnn_loss = log_loader('2D_hyp_rnn.txt')
time_two= np.cumsum(twod_hyp_rnn_loss['sec_per_sent']*sample_size)
time_two
29286./60/60
five_eucl_rnn, five_eucl_rnn_loss = log_loader('5D_eucl_rnn.txt')
time_fived = np.cumsum(five_eucl_rnn_loss['sec_per_sent']*sample_size)
time_fived
five_hyp_rnn, five_hyp_rnn_loss = log_loader('5D_hyp_rnn.txt')
time_fived = np.cumsum(five_hyp_rnn_loss['sec_per_sent']*sample_size)
time_fived
ten_eucl_rnn, ten_eucl_rnn_loss = log_loader('10D_eucl_rnn.txt')
time_ten = np.cumsum(ten_eucl_rnn_loss['sec_per_sent']*sample_size)
time_ten
ten_hyp_rnn, ten_hyp_rnn_loss = log_loader('10D_hyp_rnn.txt')
time_ten = np.cumsum(ten_hyp_rnn_loss['sec_per_sent']*sample_size)
time_ten<jupyter_output><empty_output><jupyter_text>Result (Accuracies)<jupyter_code>twod_eucl_rnn.loc[30]
twod_hyp_rnn.loc[30]
five_eucl_rnn.loc[30]
five_hyp_rnn.loc[30]
ten_eucl_rnn.loc[30]
ten_hyp_rnn.loc[30]
fig, ax = plt.subplots()

epoch,acc = epoch_vs_acc(twod_eucl_rnn)
plt.plot(epoch, acc,label='2D euclidean')
    
epoch,acc = epoch_vs_acc(twod_hyp_rnn)
plt.plot(epoch, acc,label='2D hyperboloc')

epoch,acc = epoch_vs_acc(five_eucl_rnn)
plt.plot(epoch, acc,label='5D euclidean')

epoch,acc = epoch_vs_acc(five_hyp_rnn)
plt.plot(epoch, acc,label='5D hyperbolic')

epoch, acc = epoch_vs_acc(ten_eucl_rnn)
plt.plot(epoch, acc,label='10D euclidean')

epoch,acc = epoch_vs_acc(ten_hyp_rnn)
plt.plot(epoch, acc,label='10D hyperbolic')

plt.legend()
plt.ylabel('accuracy')
plt.xlabel('epochs')
plt.title('Accuracy over epochs')
plt.ylim(0.6,0.9)
plt.savefig('epoch_acc.png')
fig, ax = plt.subplots()

epoch,acc = epoch_vs_acc(twod_eucl_rnn)
plt.plot(epoch, acc,label='2D euclidean')
    
epoch,acc = epoch_vs_acc(twod_hyp_rnn)
plt.plot(epoch, acc,label='2D hyperboloc')

epoch,acc = epoch_vs_acc(five_eucl_rnn)
plt.plot(epoch, acc,label='5D euclidean')

epoch,acc = epoch_vs_acc(five_hyp_rnn)
plt.plot(epoch, acc,label='5D hyperbolic')

epoch, acc = epoch_vs_acc(ten_eucl_rnn)
plt.plot(epoch, acc,label='10D euclidean')

epoch,acc = epoch_vs_acc(ten_hyp_rnn)
plt.plot(epoch, acc,label='10D hyperbolic')

plt.legend()
plt.ylabel('accuracy')
plt.xlabel('epochs')
plt.title('Accuracy over epochs')
plt.ylim(0.4,0.9)
plt.savefig('plot0_2.png')
fig, ax = plt.subplots()

epoch,acc = epoch_vs_acc(twod_eucl_rnn)
plt.plot(epoch, acc,label='2D euclidean')
    
epoch,acc = epoch_vs_acc(twod_hyp_rnn)
plt.plot(epoch, acc,label='2D hyperboloc')

epoch,acc = epoch_vs_acc(five_eucl_rnn)
plt.plot(epoch, acc,label='5D euclidean')

epoch,acc = epoch_vs_acc(five_hyp_rnn)
plt.plot(epoch, acc,label='5D hyperbolic')

epoch, acc = epoch_vs_acc(ten_eucl_rnn)
plt.plot(epoch, acc,label='10D euclidean')

epoch,acc = epoch_vs_acc(ten_hyp_rnn)
plt.plot(epoch, acc,label='10D hyperbolic')

plt.legend()
plt.ylabel('accuracy')
plt.xlabel('epochs')
plt.title('Accuracy over epochs')
plt.ylim(0.3,0.9)
plt.xlim(0,2)
plt.savefig('epoch_acc_zoom.png')<jupyter_output><empty_output><jupyter_text>Result (Losses)<jupyter_code>time,loss = datapoints(twod_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='2D euclidean')
time,loss = datapoints(twod_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='2D hyperboloc')
time,loss = datapoints(five_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='5D euclidean')
time,loss = datapoints(five_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='5D hyperbolic')
time, loss = datapoints(ten_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='10D euclidean')
time,loss = datapoints(ten_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='10D hyperbolic')
plt.legend()
plt.ylabel('loss')
plt.xlabel('time (seconds)')
plt.title('Averaged loss over time')
plt.savefig('plot1.png')
time,loss = datapoints(twod_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='2D euclidean')

time,loss = datapoints(five_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='5D euclidean')

time, loss = datapoints(ten_eucl_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='10D euclidean')

plt.legend()
plt.ylabel('loss')
plt.xlabel('time (seconds)')
plt.title('Averaged loss over time for Euclidean RNN')
plt.savefig('plot2.png')

time,loss = datapoints(twod_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='2D hyperboloc')

time,loss = datapoints(five_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='5D hyperbolic')

time,loss = datapoints(ten_hyp_rnn_loss)
plt.scatter(time, loss)
plt.plot(time, loss,label='10D hyperbolic')
plt.legend()
plt.ylabel('loss')
plt.xlabel('time (seconds)')
plt.title('Averaged loss over time for Hyperbolic RNN')
plt.savefig('plot3.png')
fig, ax = plt.subplots()
time,loss = datapoints(twod_eucl_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='2D euclidean')
time,loss = datapoints(twod_hyp_rnn_loss)
epoch = np.linspace(0,30,num=len(loss))
# # plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='2D hyperboloc')
time,loss = datapoints(five_eucl_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='5D euclidean')
time,loss = datapoints(five_hyp_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='5D hyperbolic')
time, loss = datapoints(ten_eucl_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='10D euclidean')
time,loss = datapoints(ten_hyp_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='10D hyperbolic')
plt.legend()
plt.ylabel('loss')
plt.xlabel('epochs')
plt.title('Averaged loss over time')
ax.set_aspect(100)
plt.savefig('epoch_loss_smoothed.png')
epoch,loss = datapoints(twod_eucl_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='2D euclidean')
epoch,loss = datapoints(twod_hyp_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='2D hyperboloc')
epoch,loss = datapoints(five_eucl_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='5D euclidean')
epoch,loss = datapoints(five_hyp_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='5D hyperbolic')
epoch, loss = datapoints(ten_eucl_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='10D euclidean')
epoch,loss = datapoints(ten_hyp_rnn_loss,ave=True)
# plt.scatter(epoch, loss)
plt.plot(epoch, loss,label='10D hyperbolic')
plt.legend()
plt.ylabel('loss')
plt.xlabel('epoch')
# plt.title('Averaged loss over time')
plt.savefig('plot5.png')<jupyter_output><empty_output><jupyter_text>Dirty vs not Dirty<jupyter_code>five_eucl_rnn_dirty, five_eucl_rnn_loss_dirty = log_loader('5D_eucl_rnn_dirty.txt')
five_hyp_rnn_dirty, five_hyp_rnn_loss_dirty = log_loader('5D_hyp_rnn_dirty.txt')
five_eucl_rnn_dirty.loc[30]
five_hyp_rnn_dirty.loc[30]
fig, ax = plt.subplots()

epoch,acc = epoch_vs_acc(five_eucl_rnn_dirty)
plt.plot(epoch, acc,label='5D euclidean_dirty')

epoch,acc = epoch_vs_acc(five_hyp_rnn_dirty)
plt.plot(epoch, acc,label='5D hyperbolic_dirty')

epoch,acc = epoch_vs_acc(five_eucl_rnn)
plt.plot(epoch, acc,label='5D euclidean_clean')

epoch,acc = epoch_vs_acc(five_hyp_rnn)
plt.plot(epoch, acc,label='5D hyperbolic_clean')

plt.legend()
plt.ylabel('accuracy')
plt.xlabel('epochs')
plt.title('Accuracy over epochs')
plt.ylim(0.75,0.84)
plt.savefig('epoch_acc_dirty.png')
fig, ax = plt.subplots()
time,loss = datapoints(twod_eucl_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))

time,loss = datapoints(five_eucl_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
plt.plot(epoch, loss,label='5D euclidean_clean')

time,loss = datapoints(five_hyp_rnn_loss,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
plt.plot(epoch, loss,label='5D hyperbolic_clean')

time, loss = datapoints(five_eucl_rnn_loss_dirty,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
plt.plot(epoch, loss,label='5D euclidean_dirty')

time,loss = datapoints(five_hyp_rnn_loss_dirty,ave_num=40)
epoch = np.linspace(0,30,num=len(loss))
plt.plot(epoch, loss,label='5D hyperbolic_dirty')


plt.legend()
plt.ylabel('loss')
plt.xlabel('epochs')
plt.title('Averaged loss over time')
# ax.set_aspect(200)
plt.savefig('epoch_loss_smoothed_dirty.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15370497820601056, 'fraction_numerical': 0.021105758201422343, 'mean_word_length': 9.479567307692308, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '525656', 'license': 'Apache-2.0', 'n_tokens_mistral': 4101, 'n_tokens_neox': 3890, 'n_words': 494, 'path': 'experiments_logs/Extract_logs.ipynb', 'repo_name': 'KengoA/hyperbolic_nn', 'size': '8718'}