Skip to content

Commit

Permalink
archive this plot macro for now
Browse files Browse the repository at this point in the history
  • Loading branch information
HaiwangYu committed Dec 1, 2020
1 parent 02e2315 commit 896feef
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions make_loss_dist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

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

df_loss = pd.read_csv('checkpoints/loss-batch.csv', sep=',', header=None)
loss = df_loss[1].to_numpy()
print('loss mean = {} median = {}'.format(np.mean(loss), np.median(loss)))

sample_means = []
for i in range(1000) :
sample = np.random.choice(loss, 50, replace=False)
sample_means.append(np.mean(sample))

fontsize = 24
plt.hist(sample_means, bins=100)
plt.xticks(fontsize=fontsize)
plt.yticks(fontsize=fontsize)
plt.xlabel('50 sample mean loss', fontsize=fontsize)
plt.show()

0 comments on commit 896feef

Please sign in to comment.