diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/MUFIN.ipynb b/MUFIN.ipynb old mode 100644 new mode 100755 diff --git a/MUFIN.pdf b/MUFIN.pdf old mode 100644 new mode 100755 diff --git a/configs/MM-AmazonTitles-300K.json b/configs/MM-AmazonTitles-300K.json old mode 100644 new mode 100755 index 0edd71c..84a498c --- a/configs/MM-AmazonTitles-300K.json +++ b/configs/MM-AmazonTitles-300K.json @@ -3,7 +3,6 @@ "A": 0.6, "B": 2.6, "num_labels": 303296, - "bucket": 1, "accumulate": 1, "at_least": 5, "batch_size": 1023, @@ -31,7 +30,7 @@ "neg_sample": 3, "normalize": true, "ntypes": 2, - "num_epochs": 400, + "num_epochs": 200, "num_vocab": 40000, "num_workers": 7, "optim": "AdamW", @@ -79,27 +78,21 @@ "ignore_img": true }, "MufinXAttnRankerv": { - "n_heads": 2, "lr_mf_enc": 0.005, "batch_size": 400, "lbl_x_img": "module3/label.img.pretrained", "lbl_x_txt": "module3/label.txt.pretrained", - "num_epochs": 1, - "test_batch_size": 200, "trn_x_img": "module3/train.img.pretrained", "trn_x_txt": "module3/train.txt.pretrained", "tst_x_img": "module3/test.img.pretrained", "tst_x_txt": "module3/test.txt.pretrained" }, "MufinXAttnRankervpp": { - "bucket": 1, - "accumulate": 4, - "n_heads": 2, + "n_heads": 12, "lr": 0.05, "lr_mf_enc": 0.001, - "batch_size": 29, - "num_epochs": 20, - "test_batch_size": 29 + "batch_size": 200, + "num_epochs": 20 }, "MufinXAttnRanker": { "lr": 0.05, @@ -115,8 +108,6 @@ }, "MufinXAttnRankerpp": { - "bucket": 1, - "accumulate": 2, "n_heads": 12, "lr": 0.05, "batch_size": 200, diff --git a/img_db_hash.ipynb b/img_db_hash.ipynb old mode 100644 new mode 100755 diff --git a/mufin.py b/mufin.py old mode 100644 new mode 100755 index c26c15e..d9081ea --- a/mufin.py +++ b/mufin.py @@ -8,7 +8,7 @@ import xc.libs.optimizer_utils as optimizer_utils torch.backends.cudnn.enabled = False -torch.multiprocessing.set_sharing_strategy('file_system') +# torch.multiprocessing.set_sharing_strategy('file_system') __author__ = 'AM' @@ -33,15 +33,15 @@ def predict(model, params): data_path = os.path.join( params.result_dir, f"{key}_{params.extract_fname}") if params.save_all: - sp.save_npz(data_path, val) + sp.save_npz(data_path, val, compressed=False) if not params.save_all: data_path = os.path.join(params.result_dir, params.extract_fname) - sp.save_npz(data_path, val) + sp.save_npz(data_path, val, compressed=False) else: val = score_mat print(val.shape) data_path = os.path.join(params.result_dir, params.extract_fname) - sp.save_npz(data_path, val) + sp.save_npz(data_path, val, compressed=False) def predict_shorty(model, params): diff --git a/parameters.py b/parameters.py old mode 100644 new mode 100755 diff --git a/run_MUFIN.sh b/run_MUFIN.sh index 33a6fc0..976f015 100755 --- a/run_MUFIN.sh +++ b/run_MUFIN.sh @@ -18,7 +18,7 @@ result_dir="${work_dir}/results/${dataset}/${model_type}/v_${version}" temp_model_data="img-xml_data" dset_json="${dataset}.json" meta_data_folder="${data_dir}/$dataset/${temp_model_data}/$txt_model" -# validate_args="--validate" +validate_args="--validate" PARAMS="--model_fname ${model_type} \ --img_model ${img_model} --data_dir ${data_dir}/${dataset} \ @@ -172,14 +172,14 @@ MUFIN() { run_eval "test_m4_mufin_${ranker}" "tst_X_Y.txt" "filter_labels_test.txt" "m4" } -module1 -module2 -module3 +# module1 +# module2 +# module3 module4 MufinXAttnRanker -module4pp MufinXAttnRankerpp -fetch_scoremat MufinXAttnRankerpp 1 -fetch_scoremat MufinXAttnRanker 0.5 -MUFIN MufinXAttnRankerpp +# module4pp MufinXAttnRankerpp +# fetch_scoremat MufinXAttnRankerpp 1 +# fetch_scoremat MufinXAttnRanker 0.5 +# MUFIN MufinXAttnRankerpp