Skip to content

Commit

Permalink
modify save directory
Browse files Browse the repository at this point in the history
  • Loading branch information
yu4u committed Apr 14, 2017
1 parent 454e4f3 commit a11c0c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plot_history.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pandas as pd
import matplotlib.pyplot as plt
import argparse
import os


def get_args():
Expand All @@ -16,14 +17,15 @@ def main():
input_path = args.input

df = pd.read_hdf(input_path, "history")
input_dir = os.path.dirname(input_path)
plt.plot(df["dense_1_loss"], label="loss (gender)")
plt.plot(df["dense_2_loss"], label="loss (age)")
plt.plot(df["val_dense_1_loss"], label="val_loss (gender)")
plt.plot(df["val_dense_2_loss"], label="val_loss (age)")
plt.xlabel("number of epochs")
plt.ylabel("loss")
plt.legend()
plt.savefig("loss.png")
plt.savefig(os.path.join(input_dir, "loss.png"))
plt.cla()

plt.plot(df["dense_1_acc"], label="accuracy (gender)")
Expand All @@ -33,7 +35,7 @@ def main():
plt.xlabel("number of epochs")
plt.ylabel("accuracy")
plt.legend()
plt.savefig("accuracy.png")
plt.savefig(os.path.join(input_dir, "accuracy.png"))


if __name__ == '__main__':
Expand Down

0 comments on commit a11c0c0

Please sign in to comment.