Skip to content

Commit

Permalink
plotted all components of loss function
Browse files Browse the repository at this point in the history
  • Loading branch information
kylajones committed Jun 6, 2024
1 parent 5881260 commit 2297c71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion linfa/plot_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ def plot_log(log_file,out_dir,fig_format='png', use_dark_mode=False):
log_data = np.loadtxt(log_file)
# loss profile
plt.figure()
plt.plot(log_data[:, 1],log_data[:, 2],'b-')
plt.plot(log_data[:, 1],log_data[:, 2],'b-', label = 'Log Loss')
plt.plot(log_data[:, 1],log_data[:, 3],'g-', label = 'Log Jac')
plt.plot(log_data[:, 1],log_data[:, 4],'m-', label = 'Log Density')
plt.plot(log_data[:, 1],log_data[:, 5],'k-', label = 'Log Prior')
plt.xlabel('Iterations')
plt.ylabel('Log Loss')
plt.legend()
plt.savefig(os.path.join(out_dir,'log_plot.'+fig_format))
plt.close()

Expand Down

0 comments on commit 2297c71

Please sign in to comment.