From 4f68132cc9c62860bd3368e559e430961c872636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Simon?= Date: Mon, 18 May 2015 18:57:08 -0400 Subject: Use os.path.join and close files --- config/dest_simple_mlp_tgtcls_0_cs.py | 3 ++- config/dest_simple_mlp_tgtcls_1_cs.py | 3 ++- config/dest_simple_mlp_tgtcls_1_cswdt.py | 3 ++- config/dest_simple_mlp_tgtcls_1_cswdtx.py | 3 ++- config/dest_simple_mlp_tgtcls_1_cswdtx_alexandre.py | 3 ++- config/joint_simple_mlp_tgtcls_111_cswdtx.py | 3 ++- config/joint_simple_mlp_tgtcls_111_cswdtx_noise_dout.py | 3 ++- config/joint_simple_mlp_tgtcls_1_cswdtx.py | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/dest_simple_mlp_tgtcls_0_cs.py b/config/dest_simple_mlp_tgtcls_0_cs.py index f5b9a1e..cd62926 100644 --- a/config/dest_simple_mlp_tgtcls_0_cs.py +++ b/config/dest_simple_mlp_tgtcls_0_cs.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: tgtcls = cPickle.load(f) +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) dim_embeddings = [ ('origin_call', data.origin_call_train_size, 10), diff --git a/config/dest_simple_mlp_tgtcls_1_cs.py b/config/dest_simple_mlp_tgtcls_1_cs.py index 54457e7..31a226e 100644 --- a/config/dest_simple_mlp_tgtcls_1_cs.py +++ b/config/dest_simple_mlp_tgtcls_1_cs.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: tgtcls = cPickle.load(f) +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) dim_embeddings = [ ('origin_call', data.origin_call_train_size, 10), diff --git a/config/dest_simple_mlp_tgtcls_1_cswdt.py b/config/dest_simple_mlp_tgtcls_1_cswdt.py index 486b7a6..5f5b2ff 100644 --- a/config/dest_simple_mlp_tgtcls_1_cswdt.py +++ b/config/dest_simple_mlp_tgtcls_1_cswdt.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: tgtcls = cPickle.load(f) +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) dim_embeddings = [ ('origin_call', data.origin_call_train_size, 10), diff --git a/config/dest_simple_mlp_tgtcls_1_cswdtx.py b/config/dest_simple_mlp_tgtcls_1_cswdtx.py index 713581d..0806dd7 100644 --- a/config/dest_simple_mlp_tgtcls_1_cswdtx.py +++ b/config/dest_simple_mlp_tgtcls_1_cswdtx.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: tgtcls = cPickle.load(f) +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) dim_embeddings = [ ('origin_call', data.origin_call_train_size, 10), diff --git a/config/dest_simple_mlp_tgtcls_1_cswdtx_alexandre.py b/config/dest_simple_mlp_tgtcls_1_cswdtx_alexandre.py index c0ba36c..1dc26a5 100644 --- a/config/dest_simple_mlp_tgtcls_1_cswdtx_alexandre.py +++ b/config/dest_simple_mlp_tgtcls_1_cswdtx_alexandre.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: tgtcls = cPickle.load(f) +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: tgtcls = cPickle.load(f) dim_embeddings = [ ('origin_call', data.origin_call_train_size, 10), diff --git a/config/joint_simple_mlp_tgtcls_111_cswdtx.py b/config/joint_simple_mlp_tgtcls_111_cswdtx.py index a7e0415..2029010 100644 --- a/config/joint_simple_mlp_tgtcls_111_cswdtx.py +++ b/config/joint_simple_mlp_tgtcls_111_cswdtx.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: dest_tgtcls = cPickle.load(f) # generate target classes for time prediction as a Fibonacci sequence diff --git a/config/joint_simple_mlp_tgtcls_111_cswdtx_noise_dout.py b/config/joint_simple_mlp_tgtcls_111_cswdtx_noise_dout.py index 1faea15..356c3a5 100644 --- a/config/joint_simple_mlp_tgtcls_111_cswdtx_noise_dout.py +++ b/config/joint_simple_mlp_tgtcls_111_cswdtx_noise_dout.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks import roles @@ -14,7 +15,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: dest_tgtcls = cPickle.load(f) # generate target classes for time prediction as a Fibonacci sequence diff --git a/config/joint_simple_mlp_tgtcls_1_cswdtx.py b/config/joint_simple_mlp_tgtcls_1_cswdtx.py index c4bc2fb..5da4130 100644 --- a/config/joint_simple_mlp_tgtcls_1_cswdtx.py +++ b/config/joint_simple_mlp_tgtcls_1_cswdtx.py @@ -1,3 +1,4 @@ +import os import cPickle from blocks.initialization import IsotropicGaussian, Constant @@ -11,7 +12,7 @@ n_end_pts = 5 n_valid = 1000 -with open("%s/arrival-clusters.pkl" % data.path) as f: +with open(os.path.join(data.path, 'arrival-clusters.pkl')) as f: dest_tgtcls = cPickle.load(f) # generate target classes for time prediction as a Fibonacci sequence -- cgit v1.2.3