diff --git a/answer_classifier_cached_features/train.py b/answer_classifier_cached_features/train.py index 3ce1c8e9bba36d05083988718d9592f9e15acc61..73f0f391e1e7ba7c50084ec7d08caf8e470564f2 100644 --- a/answer_classifier_cached_features/train.py +++ b/answer_classifier_cached_features/train.py @@ -418,7 +418,7 @@ class graph_creator(): self.mil_atr_loss += losses.mil_loss( self.attribute_scores_with_answers[j], - self.plh['positive_attributes_vec_enc'][j], + self.plh['positive_adjectives_vec_enc'][j], 'atr') self.mil_obj_loss = self.mil_loss_wt*self.mil_obj_loss / self.batch_size @@ -690,7 +690,8 @@ class attach_optimizer(): self.learning_rate = tf.train.exponential_decay( self.lr, self.global_step, - self.decay_step) + self.decay_step, + self.decay_rate) self.optimizer = multi_rate_train.MultiRateOptimizer( tf.train.AdamOptimizer) diff --git a/constants_vision_gpu_1.py b/constants_vision_gpu_1.py index 76e1bf8dfbc11f50b2211d7e2ba7c2d62d871a7f..f3d87f0116cd7dd3521501a412bd1fdd61608836 100644 --- a/constants_vision_gpu_1.py +++ b/constants_vision_gpu_1.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_pretrain_genome_split' +experiment_name = 'obj_atr_through_ans_mil' #experiment_name = 'object_attribute_classifier_large_images' # Global output directory (all subexperiments will be saved here) global_output_dir = '/data/tanmay/GenVQA_Exp_Results' @@ -100,11 +100,10 @@ pretrained_vocab_word_vectors_npy = os.path.join( # Object Attribute Classifier Training Params region_batch_size = 200 -# region_num_samples = num_train_regions -region_num_epochs = 4 +region_num_epochs = 20 region_offset = 0 region_queue_size = 400 -region_regularization_coeff = 1e-4 +region_regularization_coeff = 1e-5 region_lr = 1e-3 region_log_every_n_iter = 500 region_output_dir = os.path.join( @@ -180,15 +179,18 @@ vqa_answer_vocab_json = os.path.join( # num_test_questions = 0 # Answer classifier training params -answer_batch_size = 50 -answer_num_epochs = 10 +answer_batch_size = 25 +answer_num_epochs = 20 answer_offset = 0 -answer_obj_atr_loss_wt = 0.0 +answer_obj_atr_loss_wt = 1.0 +answer_ans_loss_wt = 0.1 +answer_mil_loss_wt = 0.2 answer_regularization_coeff = 1e-5 answer_queue_size = 500 answer_embedding_dim = 600 answer_lr = 1e-3 answer_log_every_n_iter = 500 +answer_train_from_scratch = True answer_output_dir = os.path.join( global_experiment_dir, 'answer_classifiers')