Training: Update plot-loss to new directory structure.
This commit is contained in:
parent
c6f0962b6d
commit
aaab8fe119
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue