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