SYMBOL INDEX (124 symbols across 8 files) FILE: data.py function get_paths (line 16) | def get_paths(path, name="coco", use_restval=False): class CUHKDataset (line 90) | class CUHKDataset(data.Dataset): method __init__ (line 92) | def __init__(self, root, json, split, vocab, transform=None): method __getitem__ (line 103) | def __getitem__(self, index): method __len__ (line 123) | def __len__(self): class CocoDataset (line 126) | class CocoDataset(data.Dataset): method __init__ (line 129) | def __init__(self, root, json, vocab, transform=None, ids=None): method __getitem__ (line 159) | def __getitem__(self, index): method get_raw_item (line 179) | def get_raw_item(self, index): method __len__ (line 194) | def __len__(self): class FlickrDataset (line 198) | class FlickrDataset(data.Dataset): method __init__ (line 216) | def __init__(self, root, json, split, vocab, transform=None): method __getitem__ (line 229) | def __getitem__(self, index): method __len__ (line 254) | def __len__(self): class PrecompDataset (line 258) | class PrecompDataset(data.Dataset): method __init__ (line 264) | def __init__(self, data_path, data_split, vocab): method __getitem__ (line 287) | def __getitem__(self, index): method __len__ (line 306) | def __len__(self): function collate_fn (line 310) | def collate_fn(data): function get_loader_single (line 342) | def get_loader_single(data_name, split, root, json, vocab, transform, function get_precomp_loader (line 387) | def get_precomp_loader(data_path, data_split, vocab, opt, batch_size=100, function get_transform (line 400) | def get_transform(data_name, split_name, opt): function get_loaders (line 423) | def get_loaders(data_name, vocab, crop_size, batch_size, workers, opt): function get_test_loader (line 457) | def get_test_loader(split_name, data_name, vocab, crop_size, batch_size, FILE: evaluation.py class AverageMeter (line 21) | class AverageMeter(object): method __init__ (line 24) | def __init__(self): method reset (line 27) | def reset(self): method update (line 33) | def update(self, val, n=0): method __str__ (line 39) | def __str__(self): class LogCollector (line 49) | class LogCollector(object): method __init__ (line 52) | def __init__(self): method update (line 56) | def update(self, k, v, n=0): method __str__ (line 62) | def __str__(self): method tb_log (line 72) | def tb_log(self, tb_logger, prefix='', step=None): function encode_data (line 79) | def encode_data(model, data_loader, log_step=10, logging=print): function evalrank (line 144) | def evalrank(model_path, data_path=None, split='dev', fold5=False, retur... function i2t (line 237) | def i2t(images, captions, masks, npts=None, measure='cosine', return_ran... function t2i (line 384) | def t2i(images, captions, npts=None, measure='cosine', return_ranks=False, FILE: fusion_module.py function l2norm (line 22) | def l2norm(X, dim=-1, eps=1e-8): function sum_attention (line 30) | def sum_attention(nnet, query, value, mask=None, dropout=None): function qkv_attention (line 40) | def qkv_attention(query, key, value, mask=None, dropout=None): class SummaryAttn (line 51) | class SummaryAttn(nn.Module): method __init__ (line 53) | def __init__(self, dim, num_attn, dropout, is_cat=False): method forward (line 65) | def forward(self, query, value, mask=None): class CrossAttention (line 75) | class CrossAttention(nn.Module): method __init__ (line 78) | def __init__(self, dim, num_attn, dropout, reduce_func="self_attn"): method init_weights (line 98) | def init_weights(self): method forward (line 106) | def forward(self, v1, v2, get_score=True, keep=None, mask=None): class GatedFusion (line 155) | class GatedFusion(nn.Module): method __init__ (line 156) | def __init__(self, dim, num_attn, dropout=0.01, reduce_func="self_attn... method init_weights (line 203) | def init_weights(self): method forward (line 219) | def forward(self, v1, v2, get_score=True, keep=None, mask=None): class CrossAttentionNew (line 282) | class CrossAttentionNew(nn.Module): method __init__ (line 285) | def __init__(self, dim, num_attn, dropout, reduce_func="mean"): method init_weights (line 314) | def init_weights(self): method forward (line 322) | def forward(self, v1, v2, get_score=True, keep=None, mask=None): class GatedFusionNew (line 387) | class GatedFusionNew(nn.Module): method __init__ (line 388) | def __init__(self, dim, num_attn, dropout=0.01, reduce_func="self_attn... method init_weights (line 462) | def init_weights(self): method forward (line 478) | def forward(self, v1, v2, get_score=True, keep=None, mask=None): FILE: model.py function l2norm (line 25) | def l2norm(X, dim=-1, eps=1e-8): function EncoderImage (line 32) | def EncoderImage(data_name, img_dim, embed_size, finetune=False, class ImageSelfAttention (line 50) | class ImageSelfAttention(nn.Module): method __init__ (line 54) | def __init__(self, planes): method forward (line 61) | def forward(self, x): class EncoderImageFull (line 72) | class EncoderImageFull(nn.Module): method __init__ (line 74) | def __init__(self, embed_size, finetune=False, cnn_type='resnet152', method get_cnn (line 105) | def get_cnn(self, arch, pretrained, fusion): method init_weights (line 126) | def init_weights(self): method forward (line 134) | def forward(self, images): class EncoderImagePrecomp (line 163) | class EncoderImagePrecomp(nn.Module): method __init__ (line 165) | def __init__(self, img_dim, embed_size, no_imgnorm=False, method _init_weights (line 178) | def _init_weights(self): method forward (line 186) | def forward(self, images): method load_state_dict (line 200) | def load_state_dict(self, state_dict): class EncoderText (line 214) | class EncoderText(nn.Module): method __init__ (line 216) | def __init__(self, vocab_size, word_dim, embed_size, num_layers, method _init_weights (line 238) | def _init_weights(self, embed_weights=''): method forward (line 247) | def forward(self, x, lengths): function cosine_sim (line 290) | def cosine_sim(im, s): function attention_sim (line 296) | def attention_sim(im, s): class InstanceLoss (line 304) | class InstanceLoss(nn.Module): method __init__ (line 309) | def __init__(self): method forward (line 313) | def forward(self, img_cls, txt_cls, labels): class SimLoss (line 319) | class SimLoss(nn.Module): method __init__ (line 324) | def __init__(self, margin=0, measure=False, max_violation=False, inner... method forward (line 346) | def forward(self, im, s, get_score=False, keep="words", mask=None): class CAMP (line 446) | class CAMP(object): method __init__ (line 451) | def __init__(self, opt): method state_dict (line 539) | def state_dict(self): method load_state_dict (line 545) | def load_state_dict(self, state_dict): method train_start (line 566) | def train_start(self): method val_start (line 574) | def val_start(self): method forward_emb (line 582) | def forward_emb(self, images, captions, lengths, volatile=False): method forward_loss (line 601) | def forward_loss(self, img_emb, cap_emb, instance_ids, mask=None, **kw... method train_emb (line 609) | def train_emb(self, images, captions, lengths, ids=None, FILE: pick_wordvec.py function main (line 9) | def main(opt): FILE: test_modules.py function test_img_self_att (line 43) | def test_img_self_att(): function test_f30k_dataloader (line 50) | def test_f30k_dataloader(): function test_text_encoder (line 74) | def test_text_encoder(): function test_img_encoder (line 101) | def test_img_encoder(): function test_stack_fusion (line 111) | def test_stack_fusion(): function test_stack_fusion_new (line 122) | def test_stack_fusion_new(): function test_gate_fusion (line 133) | def test_gate_fusion(): function test_gate_fusion_new (line 144) | def test_gate_fusion_new(): function test_CAMP_model (line 154) | def test_CAMP_model(config_path): function main (line 210) | def main(): FILE: train.py function main (line 21) | def main(): function train (line 92) | def train(opt, train_loader, model, epoch, val_loader, tb_logger): function validate (line 143) | def validate(opt, val_loader, model, tb_logger): function save_checkpoint (line 180) | def save_checkpoint(state, is_best, filename='checkpoint.pth.tar', prefi... function adjust_learning_rate (line 186) | def adjust_learning_rate(opt, optimizer, epoch): function accuracy (line 194) | def accuracy(output, target, topk=(1,)): FILE: vocab.py class Vocabulary (line 23) | class Vocabulary(object): method __init__ (line 26) | def __init__(self): method add_word (line 31) | def add_word(self, word): method __call__ (line 37) | def __call__(self, word): method __len__ (line 42) | def __len__(self): function from_coco_json (line 46) | def from_coco_json(path): function from_flickr_json (line 56) | def from_flickr_json(path): function from_CUHK_json (line 64) | def from_CUHK_json(path): function from_txt (line 73) | def from_txt(txt): function build_vocab (line 81) | def build_vocab(data_path, data_name, jsons, threshold): function main (line 118) | def main(data_path, data_name):