Functions | Variables
training_plots Namespace Reference

Functions

def extractTrainLoss (logPath)
 
def extractTestLoss (logPath)
 

Variables

 parser = argparse.ArgumentParser()
 
 type
 
 str
 
 required
 
 args = parser.parse_args()
 
 log1 = args.input
 
 df = extractTrainLoss(log1)
 
 tdf = extractTestLoss(log1)
 
 ax = df.plot("iteration", "loss", label="Train Loss")
 
 label
 
 loss
 
 window
 
 win_type
 
 accuracy
 

Function Documentation

def training_plots.extractTestLoss (   logPath)

Definition at line 32 of file training_plots.py.

References check_time_usage.float, makeTrainCVSamples.int, and open().

32 def extractTestLoss(logPath):
33  iterationPattern = r"Iteration (?P<iter_num>\d+), Testing net"
34  iterations = [int(r) for r
35  in re.findall(iterationPattern,
36  open(logPath, 'r').read())]
37 
38  testPattern = r"Test net output #0: loss3/loss3 = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
39  tests = [float(r[0]) for r
40  in re.findall(testPattern, open(logPath, 'r').read())]
41 
42  accPattern = r" Test net output #1: loss3/top-1 = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
43  accs = [float(r[0]) for r
44  in re.findall(accPattern, open(logPath, 'r').read())]
45  print len(iterations), len(tests), len(accs)
46 
47  return pd.DataFrame({"iteration":iterations, "loss":tests, "accuracy":accs})
48 
def extractTestLoss(logPath)
procfile open("FD_BRL_v0.txt")
def training_plots.extractTrainLoss (   logPath)

Definition at line 14 of file training_plots.py.

References check_time_usage.float, makeTrainCVSamples.int, and open().

14 def extractTrainLoss(logPath):
15  lossPattern = r"Iteration (?P<iter_num>\d+) .*, loss = (?P<loss_val>[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?)"
16 
17  iterations = []
18  losses = []
19 
20  for pair in re.findall(lossPattern, open(logPath, 'r').read()):
21  iterations.append(int(pair[0]))
22  losses.append(float(pair[1]))
23 
24  return pd.DataFrame({"iteration":iterations, "loss":losses})
25 
def extractTrainLoss(logPath)
procfile open("FD_BRL_v0.txt")

Variable Documentation

training_plots.accuracy

Definition at line 61 of file training_plots.py.

training_plots.args = parser.parse_args()

Definition at line 11 of file training_plots.py.

training_plots.ax = df.plot("iteration", "loss", label="Train Loss")

Definition at line 51 of file training_plots.py.

training_plots.df = extractTrainLoss(log1)

Definition at line 26 of file training_plots.py.

training_plots.label

Definition at line 52 of file training_plots.py.

training_plots.log1 = args.input

Definition at line 12 of file training_plots.py.

training_plots.loss

Definition at line 54 of file training_plots.py.

training_plots.parser = argparse.ArgumentParser()

Definition at line 8 of file training_plots.py.

training_plots.required

Definition at line 9 of file training_plots.py.

training_plots.str

Definition at line 9 of file training_plots.py.

training_plots.tdf = extractTestLoss(log1)

Definition at line 49 of file training_plots.py.

training_plots.type

Definition at line 9 of file training_plots.py.

training_plots.win_type

Definition at line 54 of file training_plots.py.

training_plots.window

Definition at line 54 of file training_plots.py.