This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AttnCPCFG(CPCFG): | |
| """ Weighted Compound PCFGs | |
| """ | |
| def __init__(self, V, NT, T, *args, | |
| h_dim = 512, | |
| w_dim = 512, | |
| z_dim = 64, | |
| s_dim = 256, **kwargs): | |
| super(AttnCPCFG, self).__init__( | |
| V, NT, T, *args, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import os, sys | |
| import re, time, json, pickle | |
| import numpy as np | |
| from tqdm import tqdm | |
| from PIL import Image | |
| import torch | |
| import torch.nn as nn | |
| import torch.utils.data as data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('single_and.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/single_and.json') | |
| How many <Z3> <C3> <M3> <S3>s are [both] <R2> the <Z2> <C2> <M2> <S2> and <R> the <Z> <C> <M> <S>? | |
| What number of <Z3> <C3> <M3> <S3>s are [both] <R2> the <Z2> <C2> <M2> <S2> and <R> the <Z> <C> <M> <S>? | |
| There are <ANS> <Z3> <C3> <M3> <S3>s that are [both] <R2> the <Z2> <C2> <M2> <S2> and <R> the <Z> <C> <M> <S>. | |
| The number of <Z3> <C3> <M3> <S3>s that are [both] <R2> the <Z2> <C2> <M2> <S2> and <R> the <Z> <C> <M> <S> is <ANS>. | |
| ('single_and.json', 1, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/single_and.json') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('compare_integer.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/compare_integer.json') | |
| Are there an equal number of <Z> <C> <M> <S>s and <Z2> <C2> <M2> <S2>s? | |
| Are there the same number of <Z> <C> <M> <S>s and <Z2> <C2> <M2> <S2>s? | |
| Is the number of <Z> <C> <M> <S>s the same as the number of <Z2> <C2> <M2> <S2>s? | |
| There are an equal number of <Z> <C> <M> <S>s and <Z2> <C2> <M2> <S2>s. | |
| There are the same number of <Z> <C> <M> <S>s and <Z2> <C2> <M2> <S2>s. | |
| The number of <Z> <C> <M> <S>s is the same as the number of <Z2> <C2> <M2> <S2>s. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('comparison.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/comparison.json') | |
| Do the <Z> <C> <M> <S> and the <Z2> <C2> <M2> <S2> have the same size? | |
| Is the size of the <Z> <C> <M> <S> the same as the <Z2> <C2> <M2> <S2>? | |
| Do the <Z> <C> <M> <S> and the <Z2> <C2> <M2> <S2> have the same size? | |
| Is the <Z> <C> <M> <S> the same size as the <Z2> <C2> <M2> <S2>? | |
| Does the <Z> <C> <M> <S> have the same size as the <Z2> <C2> <M2> <S2>? | |
| The <Z> <C> <M> <S> and the <Z2> <C2> <M2> <S2> have the same size. | |
| The <Z> <C> <M> <S> and the <Z2> <C2> <M2> <S2> are of the same size. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('single_or.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/single_or.json') | |
| How many things are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s? | |
| How many objects are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s? | |
| What number of things are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s? | |
| What number of objects are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s? | |
| There are <ANS> things that are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s. | |
| There are <ANS> objects that are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s. | |
| The number of things that are [either] <Z> <C> <M> <S>s or <Z2> <C2> <M2> <S2>s is <ANS>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('zero_hop.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/zero_hop.json') | |
| How many <Z> <C> <M> <S>s are there? | |
| What number of <Z> <C> <M> <S>s are there? | |
| There are <ANS> <Z> <C> <M> <S>s. | |
| The number of <Z> <C> <M> <S>s is <ANS>. | |
| ('zero_hop.json', 1, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/zero_hop.json') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('same_relate.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/same_relate.json') | |
| Are there any other things that have the same size as the <Z> <C> <M> <S>? | |
| Is there anything else that has the same size as the <Z> <C> <M> <S>? | |
| Is there any other thing that has the same size as the <Z> <C> <M> <S>? | |
| Are there any other things that are the same size as the <Z> <C> <M> <S>? | |
| Is there anything else that is the same size as the <Z> <C> <M> <S>? | |
| Is there any other thing that is the same size as the <Z> <C> <M> <S>? | |
| There are some other things that have the same size as the <Z> <C> <M> <S>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('two_hop.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/two_hop.json') | |
| How many <Z3> <C3> <M3> <S3>s are <R2> the <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>? | |
| What number of <Z3> <C3> <M3> <S3>s are <R2> the <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>? | |
| There is a <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>; how many <Z3> <C3> <M3> <S3>s are <R2> it? | |
| There is a <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>; what number of <Z3> <C3> <M3> <S3>s are <R2> it? | |
| There are <ANS> <Z3> <C3> <M3> <S3>s [that are] <R2> the <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>. | |
| The number of <Z3> <C3> <M3> <S3>s [that are] <R2> the <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S> is <ANS>. | |
| There is a <Z2> <C2> <M2> <S2> [that is] <R> the <Z> <C> <M> <S>; there are <ANS> <Z3> <C3> <M3> <S3>s [that are] <R2> it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ('one_hop.json', 0, '/mnt/yann/code/clevr-caption/question_generation_2.0/CAPTION_templates/one_hop.json') | |
| What number of <Z2> <C2> <M2> <S2>s are <R> the <Z> <C> <M> <S>? | |
| How many <Z2> <C2> <M2> <S2>s are <R> the <Z> <C> <M> <S>? | |
| There is a <Z> <C> <M> <S>; how many <Z2> <C2> <M2> <S2>s are <R> it? | |
| There is a <Z> <C> <M> <S>; what number of <Z2> <C2> <M2> <S2>s are <R> it? | |
| The number of <Z2> <C2> <M2> <S2>s [that are] <R> the <Z> <C> <M> <S> is <ANS>. | |
| There are <ANS> <Z2> <C2> <M2> <S2>s [that are] <R> the <Z> <C> <M> <S>. | |
| There is a <Z> <C> <M> <S>; there are <ANS> <Z2> <C2> <M2> <S2>s [that are] <R> it. |
OlderNewer