Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ExplorerFreda/VGNSL
/ functions
Functions
81 in github.com/ExplorerFreda/VGNSL
⨍
Functions
81
◇
Types & classes
12
↓ 9 callers
Function
index_one_hot_ellipsis
(tensor, dim, index)
src/utils.py:139
↓ 9 callers
Method
update
(self, val, n=0)
src/evaluation.py:28
↓ 8 callers
Function
l2norm
(x, dim=-1)
src/utils.py:109
↓ 5 callers
Function
sequence_mask
(sequence_length, max_length=None)
src/utils.py:126
↓ 4 callers
Method
__init__
(self, opt)
src/model.py:247
↓ 4 callers
Method
fromstring
(cls, st)
analysis/constituent_recall.py:9
↓ 4 callers
Method
update_with_mask
(lv, rv, cv, lm, rm, cm)
src/model.py:171
↓ 3 callers
Function
concat_shape
(*shapes)
src/utils.py:82
↓ 3 callers
Method
forward_emb
Compute the image and caption embeddings
src/model.py:294
↓ 3 callers
Function
get_precomp_loader
(data_path, data_split, vocab, batch_size=128, shuffle=True, num_workers=2, load_img=Tr
src/data.py:66
↓ 2 callers
Function
add_dim
(tensor, dim, size)
src/utils.py:100
↓ 2 callers
Function
add_dim_as_except
(tensor, target, *excepts)
src/utils.py:192
↓ 2 callers
Function
extract_spans
(tree)
src/test.py:7
↓ 2 callers
Function
generate_tree
(captions, tree_indices, pos, vocab, pad_word='<pad>')
src/utils.py:113
↓ 2 callers
Method
load_state_dict
(self, state_dict)
src/model.py:278
↓ 2 callers
Function
prod
(values, default=1)
src/utils.py:210
↓ 2 callers
Function
spans
(node, left=0)
analysis/constituent_recall.py:34
↓ 2 callers
Method
state_dict
(self)
src/model.py:274
↓ 2 callers
Method
train_start
switch to train mode
src/model.py:284
↓ 2 callers
Function
validate
(opt, val_loader, model, vocab)
src/train.py:59
↓ 1 callers
Function
adjust_learning_rate
Sets the learning rate to the initial LR decayed by 10 every 30 epochs
src/train.py:85
↓ 1 callers
Function
broadcast
(tensor, dim, size)
src/utils.py:92
↓ 1 callers
Function
clean_tree
(sentence, remove_tag_set={'<start>', '<end>', '<pad>'})
src/utils.py:216
↓ 1 callers
Function
constituent_recall
(gold_captions, pred_trees, gold_trees=None)
analysis/constituent_recall.py:47
↓ 1 callers
Function
encode_data
Encode all images and captions loadable by `data_loader`
src/evaluation.py:68
↓ 1 callers
Function
extract_statistics
(gold_tree_spans, produced_tree_spans)
src/test.py:32
↓ 1 callers
Function
f1_score
(produced_trees, gold_trees)
src/test.py:42
↓ 1 callers
Method
forward_reward
Compute the loss given pairs of image and caption embeddings
src/model.py:306
↓ 1 callers
Function
get_eval_loader
(data_path, split_name, vocab, batch_size, workers, load_img=False, img_dim=2048)
src/data.py:88
↓ 1 callers
Function
get_simplified_tree
Simplify a tree by removing all non-terminal labels and punctuation marks. Args: tree: An NLTK tree. Returns: A string
preprocess/parse_simplifier.py:6
↓ 1 callers
Function
i2t
Images->Text (Image Annotation) Images: (5N, K) matrix of images Captions: (5N, K) matrix of captions
src/evaluation.py:129
↓ 1 callers
Function
index_mask
(indices, max_length)
src/utils.py:149
↓ 1 callers
Method
init_weights
Xavier initialization for the fully connected layer
src/model.py:32
↓ 1 callers
Function
length2mask
(lengths, max_length)
src/utils.py:202
↓ 1 callers
Function
make_embeddings
(opt, vocab_size, dim)
src/utils.py:52
↓ 1 callers
Function
remove_label
(tree)
data/add_c_parse.py:23
↓ 1 callers
Method
reset
(self)
src/evaluation.py:22
↓ 1 callers
Function
save_checkpoint
(state, is_best, curr_epoch, filename='checkpoint.pth.tar', prefix='')
src/train.py:78
↓ 1 callers
Function
t2i
Text->Images (Image Search) Images: (5N, K) matrix of images Captions: (5N, K) matrix of captions
src/evaluation.py:173
↓ 1 callers
Function
test_trees
use the trained model to generate parse trees for text
src/evaluation.py:211
↓ 1 callers
Function
train
(opt, train_loader, model, epoch, val_loader, vocab)
src/train.py:16
↓ 1 callers
Method
train_emb
one training step given images and captions
src/model.py:352
↓ 1 callers
Method
update
(self, pred)
analysis/constituent_recall.py:19
↓ 1 callers
Method
val_start
switch to evaluate mode
src/model.py:289
Method
__call__
(self, word)
src/vocab.py:20
Method
__getitem__
(self, index)
src/data.py:37
Method
__init__
(self)
analysis/constituent_recall.py:15
Method
__init__
(self)
src/evaluation.py:19
Method
__init__
(self)
src/evaluation.py:47
Method
__init__
(self, *embeddings)
src/utils.py:9
Method
__init__
(self)
src/vocab.py:9
Method
__init__
(self, data_path, data_split, vocab, load_img=True, img_dim=2048)
src/data.py:12
Method
__init__
(self, img_dim, embed_size, no_imgnorm=False)
src/model.py:23
Method
__init__
(self, opt, vocab_size, semantics_dim)
src/model.py:64
Method
__init__
(self, margin=0)
src/model.py:183
Method
__init__
(self, margin=0)
src/model.py:219
Method
__len__
(self)
src/vocab.py:25
Method
__len__
(self)
src/data.py:47
Method
__repr__
(self)
analysis/constituent_recall.py:30
Method
__str__
(self)
analysis/constituent_recall.py:27
Method
__str__
String representation for logging
src/evaluation.py:34
Method
__str__
Concatenate the meters in one log line
src/evaluation.py:57
Function
accuracy
Computes the precision@k for the specified values of k
src/train.py:93
Method
add_word
(self, word)
src/vocab.py:14
Function
collate_fn
build mini-batch tensors from a list of (image, caption) tuples
src/data.py:51
Function
cosine_sim
Cosine similarity between all the image and sentence pairs
src/utils.py:104
Method
forward
(self, input)
src/utils.py:13
Method
forward
extract image feature vectors
src/model.py:39
Method
forward
sample a tree for each sentence
src/model.py:82
Method
forward
return the reward
src/model.py:188
Method
forward
(self, im, s)
src/model.py:224
Function
get_train_loaders
(data_path, vocab, batch_size, workers)
src/data.py:78
Function
index_range_ellipsis
(x, a, b, dim=1, padding_zero=True)
src/utils.py:160
Method
load_state_dict
copies parameters, overwritting the default one to accept state_dict from Full model
src/model.py:50
Method
recall
(self)
analysis/constituent_recall.py:24
Function
replace_leaves
(tree, leaves)
data/add_c_parse.py:10
Method
reset_weights
(self)
src/model.py:79
Function
tree2list
(tokens)
src/utils.py:17
Function
tree2str
(tree)
src/utils.py:45
Function
treelist2dict
(tree, d)
src/utils.py:37
Method
update
(self, k, v, n=0)
src/evaluation.py:51