Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CrossmodalGroup/LAPS
/ functions
Functions
123 in github.com/CrossmodalGroup/LAPS
⨍
Functions
123
◇
Types & classes
17
↓ 12 callers
Function
print
(*args, **kwargs)
lib/utils.py:325
↓ 9 callers
Method
max
(self)
lib/utils.py:70
↓ 4 callers
Function
cosine_similarity
(x1, x2, dim=1, eps=1e-8)
lib/xttn.py:61
↓ 4 callers
Function
func_attention
(query, context, smooth=4, eps=1e-8, detach=True)
lib/xttn.py:27
↓ 4 callers
Function
shard_attn_scores
(model, img_embs, cap_embs, cap_lens, opt, gpu=False)
lib/evaluation.py:301
↓ 4 callers
Method
update
(self, val, n=1)
lib/evaluation.py:29
↓ 3 callers
Function
count_params
(model)
train.py:335
↓ 3 callers
Function
get_world_size
()
lib/utils.py:347
↓ 3 callers
Function
i2t
(npts, sims, return_ranks=False, mode='coco')
lib/evaluation.py:231
↓ 3 callers
Function
is_dist_avail_and_initialized
()
lib/utils.py:336
↓ 3 callers
Function
t2i
(npts, sims, return_ranks=False, mode='coco')
lib/evaluation.py:266
↓ 3 callers
Method
update
(self, **kwargs)
lib/utils.py:91
↓ 2 callers
Method
__init__
(self, embed_dim=512, sparse_ratio=0.6)
lib/cross_net.py:15
↓ 2 callers
Function
encode_data
(model, data_loader, log_step=10, logging=logger.info)
lib/evaluation.py:72
↓ 2 callers
Method
forward_sim
(self, img_embs, cap_embs, cap_lens)
lib/vse.py:61
↓ 2 callers
Function
get_loader
(opt, data_path, split, tokenizer, batch_size=128, shuffle=True, num_workers=2
lib/image_caption.py:188
↓ 2 callers
Function
get_rank
()
lib/utils.py:355
↓ 2 callers
Function
get_sim
(images, captions)
lib/loss.py:12
↓ 2 callers
Function
is_main_process
()
lib/utils.py:362
↓ 2 callers
Method
loss_forward
(self, sim_mat, pos_mask, neg_mask)
lib/loss.py:113
↓ 2 callers
Method
median
(self)
lib/utils.py:56
↓ 2 callers
Method
update
(self, value, n=1)
lib/utils.py:37
↓ 1 callers
Method
__init__
(self, opt=None, margin=0.2, )
lib/loss.py:88
↓ 1 callers
Method
__init__
(self, opt)
lib/encoders.py:76
↓ 1 callers
Function
add_path
(path)
lib/_init_paths.py:5
↓ 1 callers
Function
adjust_learning_rate
(opt, optimizer, epoch)
train.py:319
↓ 1 callers
Method
backward
(ctx, *grads)
lib/utils.py:431
↓ 1 callers
Function
build_transforms
(img_size=224, is_train=True)
lib/image_caption.py:16
↓ 1 callers
Function
create_optimizer
(opt, model)
lib/vse.py:109
↓ 1 callers
Method
forward_emb
(self, images, captions, lengths)
lib/vse.py:47
↓ 1 callers
Function
get_image_encoder
(opt)
lib/encoders.py:21
↓ 1 callers
Function
get_text_encoder
(opt)
lib/encoders.py:16
↓ 1 callers
Function
is_sqr
(n)
lib/cross_net.py:9
↓ 1 callers
Function
l2norm
(X, dim, eps=1e-8)
lib/xttn.py:20
↓ 1 callers
Function
loss_select
(opt, loss_type='vse')
lib/loss.py:17
↓ 1 callers
Function
main
()
eval.py:8
↓ 1 callers
Function
main
()
train.py:17
↓ 1 callers
Function
mask_xattn_one_text
(img_embs, cap_i_expand, img_mask=None, i2t=True, scan=True,)
lib/xttn.py:225
↓ 1 callers
Function
matching_max_mean
(img_regions, cap_words, cap_len, i2t=False, scan=False, bi_norm=False)
lib/xttn.py:164
↓ 1 callers
Method
max_violation_off
(self)
lib/loss.py:44
↓ 1 callers
Method
max_violation_on
(self)
lib/loss.py:41
↓ 1 callers
Function
pos_neg_mask
(labels)
lib/loss.py:6
↓ 1 callers
Function
process_caption_bert
(tokenizer, tokens, train=True, mask_rate=0.2, size_augment=True)
lib/image_caption.py:103
↓ 1 callers
Method
reset
(self)
lib/evaluation.py:23
↓ 1 callers
Function
save_checkpoint
(state, is_best, filename='checkpoint.pth', prefix='')
train.py:313
↓ 1 callers
Method
set_max_violation
(self, max_violation=True)
lib/vse.py:40
↓ 1 callers
Function
setup_for_distributed
This function disables printing when not in master process
lib/utils.py:318
↓ 1 callers
Method
tb_log
(self, tb_logger, prefix='', step=None)
lib/evaluation.py:67
↓ 1 callers
Function
train
(opt, train_loader, model, model_without_ddp, optimizer, epoch)
train.py:159
↓ 1 callers
Function
validate
(opt, val_loader, model)
train.py:241
↓ 1 callers
Function
xattn_score_i2t
(images, captions, cap_lens, smooth=4)
lib/xttn.py:102
↓ 1 callers
Function
xattn_score_t2i
(images, captions, cap_lens, smooth=9.0)
lib/xttn.py:72
↓ 1 callers
Function
xattn_score_two
(images, captions, cap_lens, smooth_t2i=9, smooth_i2t=4)
lib/xttn.py:132
Method
__getattr__
(self, attr)
lib/utils.py:98
Method
__getitem__
(self, index)
lib/image_caption.py:80
Method
__init__
(self, opt, margin=0.2, max_violation=False)
lib/loss.py:32
Method
__init__
(self, opt)
lib/encoders.py:28
Method
__init__
(self)
lib/evaluation.py:20
Method
__init__
(self)
lib/evaluation.py:49
Method
__init__
(self, window_size=20, fmt=None)
lib/utils.py:29
Method
__init__
(self, delimiter="\t")
lib/utils.py:87
Method
__init__
(self, *args, **kwargs)
lib/utils.py:177
Method
__init__
(self, dim=512, keeped_patches=64, dim_ratio=0.2)
lib/cross_net.py:62
Method
__init__
(self, opt=None)
lib/cross_net.py:102
Method
__init__
(self, opt)
lib/vse.py:16
Method
__init__
(self, opt, data_path, split, tokenizer, train)
lib/image_caption.py:40
Method
__len__
(self)
lib/image_caption.py:99
Method
__str__
(self)
lib/evaluation.py:39
Method
__str__
(self)
lib/evaluation.py:59
Method
__str__
(self)
lib/utils.py:77
Method
__str__
(self)
lib/utils.py:106
Method
add_meter
(self, name, meter)
lib/utils.py:126
Function
all_gather_with_grad
(tensors)
lib/utils.py:442
Method
avg
(self)
lib/utils.py:61
Method
backward
(ctx, grad_output)
lib/utils.py:471
Method
backward
(ctx, grad_output: torch.Tensor)
lib/utils.py:498
Function
collate_fn_ours
(data)
lib/image_caption.py:162
Function
compute_acc
(logits, label, reduction='mean')
lib/utils.py:182
Function
compute_n_params
(model, return_str=True)
lib/utils.py:190
Function
concat_all_gather
(tensor, keep_grad=True)
lib/utils.py:402
Function
cosine_lr_schedule
Decay the learning rate
lib/utils.py:280
Function
evalrank
(model_path, model=None, data_path=None, split='dev', fold5=False, save_path=None)
lib/evaluation.py:129
Method
forward
(self, im, s, img_ids=None, scores=None)
lib/loss.py:47
Method
forward
(self, im, s, img_ids, sim_mat=None)
lib/loss.py:99
Method
forward
(self, images)
lib/encoders.py:54
Method
forward
(self, x, lengths)
lib/encoders.py:93
Method
forward
(ctx, x)
lib/utils.py:425
Method
forward
(ctx, tensor)
lib/utils.py:460
Method
forward
(ctx, tensor: torch.Tensor, reduce_dtype: torch.dtype = torch.float32)
lib/utils.py:488
Method
forward
(self, tokens, attention_x, attention_y)
lib/cross_net.py:21
Method
forward
(self, x, keep_policy=None)
lib/cross_net.py:76
Method
forward
(self, img_embs, cap_embs, cap_lens)
lib/cross_net.py:128
Method
forward
(self, images, captions, lengths, img_ids=None, warmup_alpha=1.,)
lib/vse.py:68
Method
freeze_backbone
(self)
lib/encoders.py:65
Method
freeze_backbone
(self)
lib/encoders.py:112
Method
freeze_backbone
(self)
lib/vse.py:32
Function
gather_result
(value)
lib/utils.py:509
Function
get_argument_parser
()
arguments.py:5
Function
get_padding_mask
(features, lengths)
lib/xttn.py:7
Function
get_test_loader
(opt, data_path, tokenizer, batch_size, workers, split='test')
lib/image_caption.py:225
next →
1–100 of 123, ranked by callers