Training: Update plot-loss to new directory structure.

This commit is contained in:
Brandon Amos 2016-06-13 13:49:24 -04:00
parent c6f0962b6d
commit aaab8fe119
1 changed files with 4 additions and 4 deletions

View File

@ -27,15 +27,15 @@ import sys
scriptDir = os.path.dirname(os.path.realpath(__file__))
plotDir = os.path.join(scriptDir, 'plots')
workDir = os.path.join(scriptDir, 'work')
# workDir = os.path.join(scriptDir, 'work')
def plot(workDirs):
trainDfs = []
testDfs = []
for d in workDirs:
trainF = os.path.join(workDir, "{:03d}".format(d), 'train.log')
testF = os.path.join(workDir, "{:03d}".format(d), 'test.log')
trainF = os.path.join(d, 'train.log')
testF = os.path.join(d, 'test.log')
trainDfs.append(pd.read_csv(trainF, sep='\t'))
testDfs.append(pd.read_csv(testF, sep='\t'))
if len(trainDfs[-1]) != len(testDfs[-1]):
@ -84,6 +84,6 @@ def plot(workDirs):
if __name__ == '__main__':
os.makedirs(plotDir, exist_ok=True)
parser = argparse.ArgumentParser()
parser.add_argument('workDirs', type=int, nargs='+')
parser.add_argument('workDirs', type=str, nargs='+')
args = parser.parse_args()
plot(args.workDirs)