aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-07-23 10:15:54 -0400
committerAlex Auvolat <alex.auvolat@ens.fr>2015-07-23 10:15:54 -0400
commit028402e4a2fafc39cc8fc0e036e79017b9f9c26a (patch)
treeb9c5c3470d9596225fd751cad19d32cf5acf7cd3
parent9313c8bb7f62b14f8c15d2119ae678641f751dbd (diff)
downloadtaxi-028402e4a2fafc39cc8fc0e036e79017b9f9c26a.tar.gz
taxi-028402e4a2fafc39cc8fc0e036e79017b9f9c26a.zip
Zero padding for test output files
-rw-r--r--ext_test.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext_test.py b/ext_test.py
index 9e64223..d121b61 100644
--- a/ext_test.py
+++ b/ext_test.py
@@ -26,7 +26,7 @@ class RunOnTest(SimpleExtension):
self.function = cg.get_theano_function()
def do(self, which_callback, *args):
- iter_no = repr(self.main_loop.log.status['iterations_done'])
+ iter_no = self.main_loop.log.status['iterations_done']
if 'valid_destination_cost' in self.main_loop.log.current_row:
dvc = self.main_loop.log.current_row['valid_destination_cost']
elif 'valid_model_cost_cost' in self.main_loop.log.current_row:
@@ -46,13 +46,13 @@ class RunOnTest(SimpleExtension):
raise RuntimeError("Unknown model type")
if 'destination' in self.outputs:
- dest_outname = 'test-dest-%s-it%s-cost%.3f.csv' % (self.model_name, iter_no, dvc)
+ dest_outname = 'test-dest-%s-it%09d-cost%.3f.csv' % (self.model_name, iter_no, dvc)
dest_outfile = open(os.path.join('output', dest_outname), 'w')
dest_outcsv = csv.writer(dest_outfile)
dest_outcsv.writerow(["TRIP_ID", "LATITUDE", "LONGITUDE"])
logger.info("Generating output for test set: %s" % dest_outname)
if 'duration' in self.outputs:
- time_outname = 'test-time-%s-it%s-cost%.3f.csv' % (self.model_name, iter_no, tvc)
+ time_outname = 'test-time-%s-it%09d-cost%.3f.csv' % (self.model_name, iter_no, tvc)
time_outfile = open(os.path.join('output', time_outname), 'w')
time_outcsv = csv.writer(time_outfile)
time_outcsv.writerow(["TRIP_ID", "TRAVEL_TIME"])