From 0ac8f2025610204ce8c45100e8604772235d4e80 Mon Sep 17 00:00:00 2001 From: tkornut Date: Fri, 26 Apr 2019 14:59:29 -0700 Subject: [PATCH 1/3] minor config --- .../c2_classification/c2_word_answer_onehot_bow.yml | 4 +++- .../c4_classification/c4_word_answer_onehot_bow.yml | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/vqa_med_2019/c2_classification/c2_word_answer_onehot_bow.yml b/configs/vqa_med_2019/c2_classification/c2_word_answer_onehot_bow.yml index 3733970..73dcce7 100644 --- a/configs/vqa_med_2019/c2_classification/c2_word_answer_onehot_bow.yml +++ b/configs/vqa_med_2019/c2_classification/c2_word_answer_onehot_bow.yml @@ -5,6 +5,8 @@ default_configs: vqa_med_2019/c2_classification/default_c2_classification.yml training: problem: batch_size: 128 + terminal_conditions: + episode_limit: 1000 # Validation parameters: validation: @@ -49,7 +51,7 @@ pipeline: # Model. classifier: type: FeedForwardNetwork - hidden_sizes: [500, 500] + hidden_sizes: [50] dropout_rate: 0.5 priority: 3 streams: diff --git a/configs/vqa_med_2019/c4_classification/c4_word_answer_onehot_bow.yml b/configs/vqa_med_2019/c4_classification/c4_word_answer_onehot_bow.yml index 1db17e6..e19a039 100644 --- a/configs/vqa_med_2019/c4_classification/c4_word_answer_onehot_bow.yml +++ b/configs/vqa_med_2019/c4_classification/c4_word_answer_onehot_bow.yml @@ -4,8 +4,7 @@ default_configs: vqa_med_2019/c4_classification/default_c4_classification.yml # Training parameters: training: problem: - batch_size: 128 - + batch_size: 128 # Validation parameters: validation: problem: From a12babc825208fe5ea1a272e417d363963ac3dac Mon Sep 17 00:00:00 2001 From: tkornut Date: Fri, 26 Apr 2019 15:01:20 -0700 Subject: [PATCH 2/3] yes/no fix --- ptp/components/problems/image_text_to_class/vqa_med_2019.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ptp/components/problems/image_text_to_class/vqa_med_2019.py b/ptp/components/problems/image_text_to_class/vqa_med_2019.py index 704b6c1..f09c2ea 100644 --- a/ptp/components/problems/image_text_to_class/vqa_med_2019.py +++ b/ptp/components/problems/image_text_to_class/vqa_med_2019.py @@ -448,7 +448,7 @@ def __getitem__(self, index): image_transformations_list = [] # Optional. if 'random_affine' in self.image_preprocessing: - rotate = (-45, 135) + rotate = (-45, 80) translate = (0.05, 0.25) scale = (0.5, 2) image_transformations_list.append(transforms.RandomAffine(rotate, translate, scale)) @@ -511,7 +511,8 @@ def predict_yes_no(self, qtext): Determines whether this is binary (yes/no) type of question. """ yes_no_starters = ['is','was','are','does'] - tokens = qtext.split(' ') + if 'tokenize' not in self.question_preprocessing: + tokens = qtext.split(' ') first_token = tokens[0] if first_token in yes_no_starters and ('or' not in tokens): return True From a0056f37b86230e02c3eaa9c87adf65a171cf838 Mon Sep 17 00:00:00 2001 From: Alexis Asseman <33075224+aasseman@users.noreply.github.com> Date: Fri, 26 Apr 2019 15:51:30 -0700 Subject: [PATCH 3/3] Fix the fix! --- ptp/components/problems/image_text_to_class/vqa_med_2019.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptp/components/problems/image_text_to_class/vqa_med_2019.py b/ptp/components/problems/image_text_to_class/vqa_med_2019.py index f09c2ea..a67f8fe 100644 --- a/ptp/components/problems/image_text_to_class/vqa_med_2019.py +++ b/ptp/components/problems/image_text_to_class/vqa_med_2019.py @@ -512,9 +512,9 @@ def predict_yes_no(self, qtext): """ yes_no_starters = ['is','was','are','does'] if 'tokenize' not in self.question_preprocessing: - tokens = qtext.split(' ') - first_token = tokens[0] - if first_token in yes_no_starters and ('or' not in tokens): + qtext = qtext.split(' ') + first_token = qtext[0] + if first_token in yes_no_starters and ('or' not in qtext): return True return False