3 from __future__
import print_function
12 command =
"cp "+path+
" ."
14 os.system(
'source cleanFile.sh')
17 for line
in file(
'chron.txt'):
20 trainingError =
float(line[1])
21 testError =
float(line[2])
22 if testError < minimum:
24 epochWithMinimum = epoch
26 return epochWithMinimum , minimum
30 path=
"/afs/cern.ch/user/g/giacinto/scratch0/Athena/rel_2/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/NnClusteringCalibration/"
36 print (
"-----------------------------------------------------------------------------------------------------------")
38 print (
"Now looking for the best current minimum of the training in directory: ")
40 print (
"-----------------------------------------------------------------------------------------------------------")
43 test_table.append([
"Network Type",
"Parameters",
"Epoch",
"Minimum"])
45 for dir
in [
"number",
"positions" ,
"errors" ]:
47 listed = [ name
for name
in os.listdir(wh)
if os.path.isdir(os.path.join(wh, name)) ]
49 resDir =
filter(
lambda dirname: dirname[0]!=
"L" and dirname[0]!=
"." , listed)
51 for weightsDir
in resDir:
52 weightPath = wh+
"/"+weightsDir
53 listedWeights = [ name
for name
in os.listdir(weightPath)
if os.path.isdir(os.path.join(weightPath , name)) ]
54 filteredListW=
filter(
lambda dirname: dirname[0]!=
"L" and dirname[0]!=
"." , listedWeights)
55 for w
in filteredListW:
56 chronFile = weightPath+
"/"+w+
"/trainingCronology.txt"
59 if os.path.exists(chronFile):
60 epochAtMin , min =
findMin(chronFile)
61 test_table.append([dir,weightsDir ,
str(epochAtMin) ,
str(min) ])
63 test_table.append([
"------------",
"---------------------" ,
"------" ,
"----------"])