Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/airsplay/lxmert
/ functions
Functions
214 in github.com/airsplay/lxmert
⨍
Functions
214
◇
Types & classes
53
↓ 21 callers
Method
__init__
(self)
src/lxrt/modeling.py:127
↓ 12 callers
Method
load
(self, path)
src/tasks/gqa.py:167
↓ 6 callers
Function
load_obj_tsv
Load object features from tsv file. :param fname: The path to the tsv file. :param topk: Only load features for top K images (lines) in the t
src/utils.py:16
↓ 5 callers
Method
dim
(self)
src/lxrt/entry.py:106
↓ 5 callers
Method
load
(self, path)
src/pretrain/lxmert_pretrain.py:394
↓ 4 callers
Method
evaluate
(self, eval_tuple: DataTuple, dump=None)
src/tasks/gqa.py:147
↓ 4 callers
Method
evaluate
Evaluate all data in data_tuple.
src/tasks/vqa.py:150
↓ 4 callers
Method
from_pretrained
Instantiate a PreTrainedBertModel from a pre-trained model file. Download and cache the pre-trained model file if needed.
src/lxrt/tokenization.py:136
↓ 4 callers
Function
get_data_tuple
(splits: str, bs:int, shuffle=False, drop_last=False)
src/tasks/vqa.py:20
↓ 4 callers
Function
get_tuple
(splits: str, bs:int, shuffle=False, drop_last=False)
src/tasks/gqa.py:21
↓ 4 callers
Function
get_tuple
(splits: str, bs:int, shuffle=False, drop_last=False)
src/tasks/nlvr2.py:19
↓ 4 callers
Method
step
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
src/lxrt/optimization.py:101
↓ 3 callers
Function
cached_path
Given something that might be a URL (or might be a local path), determine which. If it's a URL, download the file and cache it, and retur
src/lxrt/file_utils.py:81
↓ 3 callers
Method
dump_result
Dump the result to a GQA-challenge submittable json file. GQA json file submission requirement: results = [result]
src/tasks/gqa_data.py:171
↓ 3 callers
Method
evaluate
(self, eval_tuple: DataTuple, dump=None)
src/tasks/nlvr2.py:133
↓ 3 callers
Method
multi_gpu
(self)
src/lxrt/entry.py:102
↓ 3 callers
Method
transpose_for_scores
(self, x)
src/lxrt/modeling.py:315
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
src/lxrt/tokenization.py:63
↓ 2 callers
Method
ans2id
(self, ans)
src/pretrain/qa_answer_table.py:61
↓ 2 callers
Method
convert_ans
(self, ans)
src/pretrain/qa_answer_table.py:45
↓ 2 callers
Method
convert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
src/lxrt/tokenization.py:115
↓ 2 callers
Method
evaluate
(self, uid2ans: dict, pprint=False)
src/pretrain/lxmert_data.py:224
↓ 2 callers
Method
forward
(self, examples)
src/pretrain/lxmert_pretrain.py:251
↓ 2 callers
Function
get_tuple
(splits: str, bs: int, shuffle=False, drop_last=False, topk=-1)
src/pretrain/lxmert_pretrain.py:23
↓ 2 callers
Method
id2ans
(self, ans_id)
src/pretrain/qa_answer_table.py:64
↓ 2 callers
Method
load
(self, path)
src/tasks/nlvr2.py:142
↓ 2 callers
Method
load
(self, path)
src/tasks/vqa.py:170
↓ 2 callers
Method
load_data
(self, name, number)
src/tasks/gqa_data.py:67
↓ 2 callers
Function
load_lxmert_qa
Load model weights from LXMERT pre-training. The answers in the fine-tuned QA task (indicated by label2ans) would also be properly in
src/pretrain/qa_answer_table.py:84
↓ 2 callers
Function
make_uid
(img_id, dset, sent_idx)
src/pretrain/lxmert_data.py:78
↓ 2 callers
Method
predict
(self, eval_tuple: DataTuple, dump=None)
src/tasks/gqa.py:130
↓ 2 callers
Method
predict
(self, eval_tuple: DataTuple, dump=None)
src/tasks/nlvr2.py:117
↓ 2 callers
Method
predict
Predict the answers to questions in a data split. :param eval_tuple: The data tuple to be evaluated. :param dump: The path o
src/tasks/vqa.py:126
↓ 2 callers
Method
save
(self, name)
src/tasks/gqa.py:163
↓ 2 callers
Method
save
(self, name)
src/tasks/nlvr2.py:138
↓ 2 callers
Method
save
(self, name)
src/tasks/vqa.py:166
↓ 2 callers
Method
save
(self, name)
src/pretrain/lxmert_pretrain.py:390
↓ 2 callers
Function
set_visual_config
(args)
src/lxrt/entry.py:74
↓ 2 callers
Function
split_s3_path
Split a full s3 path into the bucket name and path.
src/lxrt/file_utils.py:111
↓ 2 callers
Method
tokenize
(self, text)
src/lxrt/tokenization.py:105
↓ 2 callers
Method
used
(self, ans)
src/pretrain/qa_answer_table.py:73
↓ 1 callers
Method
__init__
(self, splits: str)
src/tasks/nlvr2_data.py:32
↓ 1 callers
Method
__init__
(self, splits: str)
src/tasks/gqa_data.py:32
↓ 1 callers
Method
__init__
(self, splits: str)
src/tasks/vqa_data.py:47
↓ 1 callers
Method
__init__
(self, uid, sent, visual_feats=None, obj_labels=None, attr_labels=None, is_m
src/pretrain/lxmert_data.py:28
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
src/lxrt/tokenization.py:277
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
src/lxrt/tokenization.py:255
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
src/lxrt/tokenization.py:363
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
src/lxrt/tokenization.py:375
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
src/lxrt/tokenization.py:351
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
src/lxrt/tokenization.py:220
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
src/lxrt/tokenization.py:209
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
src/lxrt/tokenization.py:242
↓ 1 callers
Method
ans2id_map
(self)
src/pretrain/qa_answer_table.py:67
↓ 1 callers
Function
convert_example_to_features
Convert a raw sample (pair of sentences as tokenized strings) into a proper training sample with IDs, LM labels, input_mask, CLS and SEP toke
src/pretrain/lxmert_pretrain.py:134
↓ 1 callers
Function
convert_sents_to_features
Loads a data file into a list of `InputBatch`s.
src/lxrt/entry.py:36
↓ 1 callers
Method
cross_att
(self, lang_input, lang_attention_mask, visn_input, visn_attention_mask)
src/lxrt/modeling.py:455
↓ 1 callers
Method
evaluate_epoch
(self, eval_tuple: DataTuple, iters: int=-1)
src/pretrain/lxmert_pretrain.py:360
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
src/lxrt/modeling.py:234
↓ 1 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
src/lxrt/modeling.py:242
↓ 1 callers
Function
gelu
Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results
src/lxrt/modeling.py:112
↓ 1 callers
Function
generate_tsv
(prototxt, weights, image_ids, outfile)
data/mscoco_imgfeat/extract_coco_image.py:54
↓ 1 callers
Function
generate_tsv
(prototxt, weights, image_ids, outfile)
data/nlvr2_imgfeat/extract_nlvr2_image.py:69
↓ 1 callers
Function
generate_tsv
(prototxt, weights, image_ids, outfile)
data/vg_gqa_imgfeat/extract_gqa_image.py:45
↓ 1 callers
Function
get_detections_from_im
:param net: :param im_file: full path to an image :param image_id: :param conf_thresh: :return: all information from detection an
data/mscoco_imgfeat/extract_coco_image.py:83
↓ 1 callers
Function
get_detections_from_im
:param net: :param im_file: full path to an image :param image_id: :param conf_thresh: :return: all information from detection an
data/nlvr2_imgfeat/extract_nlvr2_image.py:98
↓ 1 callers
Function
get_detections_from_im
:param net: :param im_file: full path to an image :param image_id: :param conf_thresh: :return: all information from detection an
data/vg_gqa_imgfeat/extract_gqa_image.py:74
↓ 1 callers
Function
get_from_cache
Given a URL, look for the corresponding dataset in the local cache. If it's not there, download it. Then return the path to the cached file.
src/lxrt/file_utils.py:172
↓ 1 callers
Function
get_optimizer
(optim)
src/param.py:11
↓ 1 callers
Function
http_get
(url, temp_file)
src/lxrt/file_utils.py:160
↓ 1 callers
Method
load
(module, prefix='')
src/lxrt/modeling.py:812
↓ 1 callers
Method
load
(self, path)
src/lxrt/entry.py:126
↓ 1 callers
Function
load_image_ids
images in the same directory are in the same split
data/mscoco_imgfeat/extract_coco_image.py:42
↓ 1 callers
Function
load_image_ids
images in the same directory are in the same sequential region, but with no internal ordering
data/nlvr2_imgfeat/extract_nlvr2_image.py:45
↓ 1 callers
Function
load_image_ids
(img_root)
data/vg_gqa_imgfeat/extract_gqa_image.py:35
↓ 1 callers
Method
load_lxmert
(self, path)
src/pretrain/lxmert_pretrain.py:399
↓ 1 callers
Function
load_tf_weights_in_bert
Load tf checkpoints in a pytorch model
src/lxrt/modeling.py:51
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
src/lxrt/tokenization.py:48
↓ 1 callers
Method
oracle_score
(data_tuple)
src/tasks/gqa.py:153
↓ 1 callers
Method
oracle_score
(data_tuple)
src/tasks/vqa.py:156
↓ 1 callers
Method
output_fc
(self, lang_input, visn_input)
src/lxrt/modeling.py:467
↓ 1 callers
Function
parse_args
Parse input arguments
data/mscoco_imgfeat/extract_coco_image.py:137
↓ 1 callers
Function
parse_args
Parse input arguments
data/nlvr2_imgfeat/extract_nlvr2_image.py:152
↓ 1 callers
Function
parse_args
Parse input arguments
data/vg_gqa_imgfeat/extract_gqa_image.py:128
↓ 1 callers
Function
parse_args
()
src/param.py:33
↓ 1 callers
Function
random_feat
(feats)
src/pretrain/lxmert_pretrain.py:110
↓ 1 callers
Method
random_feat
Get a random obj feat from the dataset.
src/pretrain/lxmert_data.py:136
↓ 1 callers
Function
random_word
Masking some random tokens for Language Model task with probabilities as in the original BERT paper. :param tokens: list of str, tokenized se
src/pretrain/lxmert_pretrain.py:71
↓ 1 callers
Function
s3_etag
Check ETag on S3 object.
src/lxrt/file_utils.py:144
↓ 1 callers
Function
s3_get
Pull a file directly from S3.
src/lxrt/file_utils.py:153
↓ 1 callers
Method
self_att
(self, lang_input, lang_attention_mask, visn_input, visn_attention_mask)
src/lxrt/modeling.py:461
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
src/lxrt/modeling.py:251
↓ 1 callers
Method
to_json_string
Serializes this instance to a JSON string.
src/lxrt/modeling.py:256
↓ 1 callers
Method
train
(self, train_tuple, eval_tuple)
src/tasks/gqa.py:80
↓ 1 callers
Method
train
(self, train_tuple, eval_tuple)
src/tasks/nlvr2.py:74
↓ 1 callers
Method
train
(self, train_tuple, eval_tuple)
src/tasks/vqa.py:80
↓ 1 callers
Method
train
(self, train_tuple: DataTuple, eval_tuple: DataTuple)
src/pretrain/lxmert_pretrain.py:309
↓ 1 callers
Method
train_batch
(self, optim, batch)
src/pretrain/lxmert_pretrain.py:289
↓ 1 callers
Function
url_to_filename
Convert `url` into a hashed filename in a repeatable way. If `etag` is specified, append its hash to the url's, delimited by a period.
src/lxrt/file_utils.py:37
↓ 1 callers
Method
valid_batch
(self, batch)
src/pretrain/lxmert_pretrain.py:301
next →
1–100 of 214, ranked by callers