11 command =
"cp "+path+
" ."
13 os.system(
'source cleanFile.sh')
16 for line
in file(
'chron.txt'):
19 trainingError =
float(line[1])
20 testError =
float(line[2])
21 if testError < minimum:
23 epochWithMinimum = epoch
25 return epochWithMinimum , minimum
29 path=
"/afs/cern.ch/user/g/giacinto/scratch0/Athena/rel_2/InnerDetector/InDetCalibAlgs/PixelCalibAlgs/NnClusteringCalibration/"
35 print (
"-----------------------------------------------------------------------------------------------------------")
37 print (
"Now looking for the best current minimum of the training in directory: ")
39 print (
"-----------------------------------------------------------------------------------------------------------")
42 test_table.append([
"Network Type",
"Parameters",
"Epoch",
"Minimum"])
44 for dir
in [
"number",
"positions" ,
"errors" ]:
46 listed = [ name
for name
in os.listdir(wh)
if os.path.isdir(os.path.join(wh, name)) ]
48 resDir =
filter(
lambda dirname: dirname[0]!=
"L" and dirname[0]!=
"." , listed)
50 for weightsDir
in resDir:
51 weightPath = wh+
"/"+weightsDir
52 listedWeights = [ name
for name
in os.listdir(weightPath)
if os.path.isdir(os.path.join(weightPath , name)) ]
53 filteredListW=
filter(
lambda dirname: dirname[0]!=
"L" and dirname[0]!=
"." , listedWeights)
54 for w
in filteredListW:
55 chronFile = weightPath+
"/"+w+
"/trainingCronology.txt"
58 if os.path.exists(chronFile):
59 epochAtMin , min =
findMin(chronFile)
60 test_table.append([dir,weightsDir ,
str(epochAtMin) ,
str(min) ])
62 test_table.append([
"------------",
"---------------------" ,
"------" ,
"----------"])