Skip to content

Instantly share code, notes, and snippets.

@chaonan99
Last active July 29, 2016 18:38
Show Gist options
  • Save chaonan99/cf93fe8193ac4d4ce344abd6f6a50f80 to your computer and use it in GitHub Desktop.
Save chaonan99/cf93fe8193ac4d4ce344abd6f6a50f80 to your computer and use it in GitHub Desktop.
plot loss curve from caffe log file.
import re
import matplotlib
import pylab as plt
import numpy as np
s = open('default.log','r').read()
pattern = re.compile(r'iter (\d+): (\d+.\d+)')
grou = np.asarray(pattern.findall(s)).astype(np.float32)
plt.plot(grou[:,0],grou[:,1])
plt.title('title')
plt.ylabel('batchloss')
plt.xlabel('iteration')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment