From a3ddca6797e47dae88d38575dc9cdfc7e064a6e7 Mon Sep 17 00:00:00 2001
From: tgupta6 <tgupta6@illinois.edu>
Date: Fri, 9 Sep 2016 11:57:40 -0500
Subject: [PATCH] change constants in visualize_relevance and constants_crunchy

---
 answer_classifier_cached_features/train.py |  1 +
 constants_crunchy.py                       | 12 ++++++------
 visual_util/visualize_relevance.py         |  6 +++---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/answer_classifier_cached_features/train.py b/answer_classifier_cached_features/train.py
index 1db0b33..e6de431 100644
--- a/answer_classifier_cached_features/train.py
+++ b/answer_classifier_cached_features/train.py
@@ -476,6 +476,7 @@ def create_vqa_batch_generator():
         resnet_feat_dim=constants.resnet_feat_dim)
 
     num_train_subset_questions = len(data_mgr.qids)
+    print num_train_subset_questions
 
     index_generator = tftools.data.random(
         constants.answer_batch_size, 
diff --git a/constants_crunchy.py b/constants_crunchy.py
index 0998551..6d46dad 100644
--- a/constants_crunchy.py
+++ b/constants_crunchy.py
@@ -5,7 +5,7 @@ def mkdir_if_not_exists(dir_name):
     if not os.path.exists(dir_name):
         os.mkdir(dir_name)
         
-experiment_name = 'QA_joint_pretrain_genome_split'
+experiment_name = 'object_attribute_classifier_large_images_vqa_split' #'QA_joint_pretrain_genome_split'
 
 # Global output directory (all subexperiments will be saved here)
 global_output_dir = '/home/tanmay/Code/GenVQA/Exp_Results/VQA'
@@ -128,7 +128,7 @@ region_model_accuracies_txt = os.path.join(
     'model_accuracies.txt')
 
 # Object Attribute Classifier Evaluation Params
-region_eval_on = 'train_subset' # One of {'test','train_held_out','train_subset'}
+region_eval_on = 'train_held_out' # One of {'test','train_held_out','train_subset'}
 region_model_to_eval = region_model + '-' + '80000'
 
 region_attribute_scores_dirname = os.path.join(
@@ -189,13 +189,13 @@ vqa_answer_vocab_json = os.path.join(
 
 # Answer classifier training params
 answer_batch_size = 50
-answer_num_epochs = 4
+answer_num_epochs = 6
 answer_offset = 0
 answer_obj_atr_loss_wt = 0.1
 answer_regularization_coeff = 1e-5
 answer_queue_size = 500
 answer_embedding_dim = 600
-answer_lr = 1e-3
+answer_lr = 1e-4
 answer_log_every_n_iter = 500
 answer_output_dir = os.path.join(
     global_experiment_dir,
@@ -220,7 +220,7 @@ answer_fine_tune_from = answer_model + '-' + str(answer_fine_tune_from_iter)
 
 # Answer eval params
 answer_eval_on = 'val'
-answer_model_to_eval = answer_model + '-18500'
+answer_model_to_eval = answer_model + '-42000'
 
 vqa_results_dir = os.path.join(
     answer_output_dir,
@@ -238,7 +238,7 @@ answer_eval_results_json = os.path.join(
 
 # Select best model
 models_dir = answer_output_dir
-start_model = 1000
+start_model = 40000
 step_size = 2000
 model_accuracies_txt = os.path.join(
     answer_output_dir,
diff --git a/visual_util/visualize_relevance.py b/visual_util/visualize_relevance.py
index 72b07c7..17b947e 100644
--- a/visual_util/visualize_relevance.py
+++ b/visual_util/visualize_relevance.py
@@ -200,13 +200,13 @@ if __name__=='__main__':
         'mscoco_val2014_annotations_with_parsed_questions.json')
 
     exp_dir = '/home/tanmay/Code/GenVQA/Exp_Results/VQA/' + \
-              'QA_explicit_dot_joint_training_pretrained_same_lr/'
+              'QA_joint_pretrain_genome_split/'
 
     eval_data_json = os.path.join(
         exp_dir,
-        'answer_classifiers/eval_val_rest_data.json')
+        'answer_classifiers/Results/eval_val_data.json')
 
-    output_dir = os.path.join(exp_dir, 'qual_results_val_rest_conf')
+    output_dir = os.path.join(exp_dir, 'qual_results_val_conf')
     if not os.path.exists(output_dir):
         os.mkdir(output_dir)
 
-- 
GitLab