diff options
Diffstat (limited to 'cli/app/search/json.py')
| -rw-r--r-- | cli/app/search/json.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/cli/app/search/json.py b/cli/app/search/json.py index beaed3b..b47512d 100644 --- a/cli/app/search/json.py +++ b/cli/app/search/json.py @@ -1,4 +1,5 @@ from os.path import join +from app.settings import app_cfg from app.utils.file_utils import write_json from app.search.params import ParamsDict @@ -10,7 +11,9 @@ def make_params_latent(fp_out_dir, tag): "clip": 1.0, "stochastic_clipping": False, "clipping": False, - "dataset": "inverses/{}/dataset.hdf5".format(tag), + "path": os.path.join(app_cfg.DIR_INVERSES, tag), + "dataset": os.path.join(app_cfg.DIR_INVERSES, tag, "dataset.hdf5"), + "out_dataset": os.path.join(app_cfg.DIR_INVERSES, tag, "dataset.latent.hdf5"), "inv_layer": "latent", "decay_lr": True, "inv_it": 15000, @@ -41,19 +44,18 @@ def make_params_latent(fp_out_dir, tag): "lambda_reg": 0.1, "dist_loss": False, "sample_size": 4, - "dataset": "inverses/{}/dataset.encodings.hdf5".format(tag), "save_progress": True, } -def params_latent(fp_out_dir, tag): - return ParamsDict(make_params_latent(fp_out_dir, tag)) +def params_latent(tag): + return ParamsDict(make_params_latent(tag)) def save_params_latent(fp_out_dir, tag): - data = make_params_latent(fp_out_dir, tag) + data = make_params_latent(tag) fp_out_fn = join(fp_out_dir, "params_latent.json") write_json(data, fp_out_fn) -def make_params_dense(fp_out_dir, tag, folder_id=None): +def make_params_dense(tag): return { "tag": tag, "folder_id": folder_id, @@ -62,7 +64,8 @@ def make_params_dense(fp_out_dir, tag, folder_id=None): "clip": 1.0, "stochastic_clipping": False, "clipping": False, - "dataset": "inverses/{}/dataset.encodings.hdf5".format(tag), + "path": os.path.join(app_cfg.DIR_INVERSES, tag), + "dataset": os.path.join(app_cfg.DIR_INVERSES, tag, "dataset.latent.hdf5"), "inv_layer": "Generator_2/G_Z/Reshape:0", "decay_lr": False, "inv_it": 6000, @@ -93,15 +96,15 @@ def make_params_dense(fp_out_dir, tag, folder_id=None): "lambda_reg": 0.1, "dist_loss": True, "sample_size": 4, - "out_dataset": "inverses/{}/dataset.encodings.dense.hdf5".format(tag), + "out_dataset": os.path.join(app_cfg.DIR_INVERSES, tag, "dataset.dense.hdf5"), "save_progress": True, "max_batches": 0, } -def params_dense_dict(fp_out_dir, tag, folder_id=None): - return ParamsDict(make_params_dense(fp_out_dir, tag, folder_id)) +def params_dense_dict(tag): + return ParamsDict(make_params_dense(tag)) -def save_params_dense(fp_out_dir, tag, folder_id): - data = make_params_dense(fp_out_dir, tag, folder_id) +def save_params_dense(fp_out_dir, tag): + data = make_params_dense(tag) fp_out_fn = join(fp_out_dir, "params_dense.json") write_json(data, fp_out_fn) |
