Skip to content

Commit

Permalink
Corrected configs
Browse files Browse the repository at this point in the history
  • Loading branch information
anshumitts committed Jun 23, 2022
1 parent a9e52a9 commit 25dd291
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 25 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified MUFIN.ipynb
100644 → 100755
Empty file.
Empty file modified MUFIN.pdf
100644 → 100755
Empty file.
17 changes: 4 additions & 13 deletions configs/MM-AmazonTitles-300K.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"A": 0.6,
"B": 2.6,
"num_labels": 303296,
"bucket": 1,
"accumulate": 1,
"at_least": 5,
"batch_size": 1023,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -115,8 +108,6 @@

},
"MufinXAttnRankerpp": {
"bucket": 1,
"accumulate": 2,
"n_heads": 12,
"lr": 0.05,
"batch_size": 200,
Expand Down
Empty file modified img_db_hash.ipynb
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions mufin.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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):
Expand Down
Empty file modified parameters.py
100644 → 100755
Empty file.
16 changes: 8 additions & 8 deletions run_MUFIN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down Expand Up @@ -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


0 comments on commit 25dd291

Please sign in to comment.