MCPcopy Create free account

hub / github.com/NUSTM/VLP-MABSA / functions

Functions191 in github.com/NUSTM/VLP-MABSA

↓ 75 callersMethodinfo
(self, message, pad=False)
src/utils.py:50
↓ 33 callersMethodconvert_tokens_to_ids
(self, tokens)
src/data/tokenization_new.py:667
↓ 21 callersMethodload
(module: nn.Module, prefix="")
src/model/mixins.py:789
↓ 13 callersMethod__init__
( self, embed_dim, num_heads, dropout=0.0, bias=Tr
src/model/modeling_bart.py:676
↓ 13 callersMethodfrom_pretrained
r"""Instantiate a pretrained pytorch model from a pre-trained model configuration. The model is set in evaluation mode by default using model
src/model/mixins.py:552
↓ 9 callersFunctionLayerNorm
(normalized_shape, eps=1e-5, elementwise_affine=True)
src/model/modeling_bart.py:1069
↓ 7 callersMethod__init__
(self)
src/model/modules.py:326
↓ 5 callersMethoddecode
(self, tokens, state, only_sc=False)
src/model/modules.py:321
↓ 4 callersFunction_compute_f_pre_rec
r""" :param tp: int, true positive :param fn: int, false negative :param fp: int, false positive :return: (f, pre, rec)
src/model/metrics.py:196
↓ 4 callersMethodadd
Add a new hypothesis to the list.
src/model/generater.py:765
↓ 4 callersMethodencode
(self, *args, **kwargs)
src/data/tokenization_new.py:159
↓ 4 callersMethodforward
Input shape: Time(SeqLen) x Batch x Channel
src/model/modeling_bart.py:703
↓ 4 callersFunctioninvert_mask
Turns 1->0, 0->1, False->True, True-> False
src/model/modeling_bart.py:134
↓ 4 callersMethodpad_tokens
(self, tokens)
src/data/tokenization_new.py:162
↓ 3 callersFunction_compute_tp_fn_fp
(ps, ts)
src/model/metrics.py:211
↓ 3 callersMethod_init_weights
(self, module)
src/model/modeling_bart.py:173
↓ 3 callersFunction_make_linear_from_emb
(emb)
src/model/modeling_bart.py:198
↓ 3 callersFunction_prepare_bart_decoder_inputs
Prepare masks that ignore padding tokens in the decoder and a causal mask for the decoder if none are provided. This mimics the default behavior i
src/model/modeling_bart.py:140
↓ 3 callersMethod_shape
(self, tensor, seq_len, bsz)
src/model/modeling_bart.py:699
↓ 3 callersFunctionfine_tune
(epoch, model, train_loader, test_loader, metric,
src/training.py:105
↓ 3 callersMethodforward
(self, tgt_tokens, pred, mask)
src/model/modules.py:331
↓ 2 callersMethod_force_token_ids_generation
force one of token_ids to be generated by setting prob of all other tokens to 0 (logprob=-float("inf"))
src/model/modeling_bart.py:1381
↓ 2 callersMethod_force_token_ids_generation
force one of token_ids to be generated by setting prob of all other tokens to 0
src/model/mixins.py:407
↓ 2 callersMethod_init_weights
(self, module)
src/model/modules.py:484
↓ 2 callersFunction_reorder_buffer
(attn_cache, new_order)
src/model/modeling_bart.py:667
↓ 2 callersMethodgenerate
:param State state: encoder结果的State, 是与Decoder配套是用的 :param torch.LongTensor,None tokens: batch_size x length, 开始的token :retu
src/model/generater.py:209
↓ 2 callersMethodget_base_tokenizer
(self)
src/data/tokenization_new.py:673
↓ 2 callersMethodget_encoder
(self)
src/model/mixins.py:436
↓ 2 callersMethodprepare_state
(self, input_ids, image_features, attention_
src/model/MAESC_model.py:100
↓ 2 callersMethodreorder_state
(self, indices: torch.LongTensor)
src/model/model.py:220
↓ 2 callersMethodresize_token_embeddings
(self, new_num_tokens: int)
src/model/mixins.py:442
↓ 2 callersFunctionshift_tokens_right
Shift input ids one token to the right, and wrap the last non pad token (usually <eos>).
src/model/modeling_bart.py:212
↓ 1 callersMethod__init__
(self, eos_token_id, num_labels, opinion_first=True)
src/model/metrics.py:242
↓ 1 callersMethod__init__
Initialize n-best list of hypotheses.
src/model/generater.py:748
↓ 1 callersMethod__init__
(self, encoder_output, encoder_mask, src_tokens, first, src_embed_outputs)
src/model/MAESC_model.py:150
↓ 1 callersMethod__init__
(self, encoder_output, encoder_mask, src_tokens, first, src_embed_outputs)
src/model/model.py:212
↓ 1 callersFunction_beam_search_generate
(decoder: Seq2SeqDecoder, tokens=None, state=None,
src/model/generater.py:499
↓ 1 callersMethod_embed_multi_modal
embed textual and visual inputs and combine them into one embedding
src/model/modules.py:81
↓ 1 callersMethod_get_logger
get a logger for displaying information to console or log to file (optional) :param log_dir: str, logging path. None for not log to f
src/utils.py:60
↓ 1 callersMethod_init_weight
Identical to the XLM create_sinusoidal_embeddings except features are not interleaved. The cos features are in the 2nd half of the vector. [di
src/model/modeling_bart.py:1613
↓ 1 callersMethod_load_from_state_dict
r"""Copies parameters and buffers from :attr:`state_dict` into only this module, but not its descendants. This is called on every submodule
src/model/mixins.py:463
↓ 1 callersMethod_mask_tokens
Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original. :param inputs: torch.LongTenso
src/data/collation.py:185
↓ 1 callersFunction_no_beam_search_generate
(decoder: Seq2SeqDecoder, state, tokens=None,
src/model/generater.py:300
↓ 1 callersMethod_pad_message
(self, message)
src/utils.py:47
↓ 1 callersMethod_resize_final_logits_bias
(self, new_num_tokens: int, old_num_tokens: int)
src/model/modeling_bart.py:1239
↓ 1 callersMethod_resize_final_logits_bias
(self, new_num_tokens: int, old_num_tokens: int)
src/model/mixins.py:449
↓ 1 callersMethod_use_saved_state
(self, k, v, saved_state, key_padding_mask, static_kv, bsz)
src/model/modeling_bart.py:801
↓ 1 callersMethodbuild_model
(self, args, bart_model, tokenizer,
src/model/MAESC_model.py:19
↓ 1 callersMethodbuild_model
(self, args, bart_model, tokenizer,
src/model/model.py:31
↓ 1 callersFunctioncleanup_process
()
src/utils.py:16
↓ 1 callersMethodcreate_id2idx
(self)
src/data/dataset.py:37
↓ 1 callersMethoddecode
(self, token_ids, skip_special_tokens=False)
src/data/tokenization_new.py:663
↓ 1 callersMethodencode_ae_oe
(self, label, aspect_spans, opinion_spans)
src/data/tokenization_new.py:448
↓ 1 callersMethodencode_aesc
(self, label, aesc_spans, aesc_max_len)
src/data/tokenization_new.py:393
↓ 1 callersMethodencode_anp_generate
(self, ANP_words)
src/data/tokenization_new.py:350
↓ 1 callersMethodencode_condition
tokenize text, image features and event the output format (after decoded back): task_type [<img> <img_feat> ... <img_feat> </
src/data/tokenization_new.py:186
↓ 1 callersMethodencode_label
(self, label, img_num=None)
src/data/tokenization_new.py:268
↓ 1 callersMethodencode_mrm
(self, box_cls)
src/data/tokenization_new.py:510
↓ 1 callersMethodencode_senti
(self, sentis)
src/data/tokenization_new.py:313
↓ 1 callersMethodencode_twitter_ae
(self, label, aspect_spans, ae_max_len)
src/data/tokenization_new.py:529
↓ 1 callersMethodencode_twitter_sc
(self, label, aesc_spans, aesc_max_len)
src/data/tokenization_new.py:586
↓ 1 callersMethodevaluate
(self, oe_target_span, pred, tgt_tokens)
src/model/metrics.py:257
↓ 1 callersFunctionfill_with_neg_inf
FP16-compatible function that fills a input_ids with -inf.
src/model/modeling_bart.py:1080
↓ 1 callersMethodget_ANP_word
(self, distribution)
src/data/dataset.py:60
↓ 1 callersMethodget_aesc_spans
(self, dic)
src/data/dataset.py:155
↓ 1 callersMethodget_aspect_spans
(self, id)
src/data/dataset.py:81
↓ 1 callersMethodget_cls
(self, id)
src/data/dataset.py:89
↓ 1 callersMethodget_gt_aspect_senti
(self, dic)
src/data/dataset.py:161
↓ 1 callersMethodget_img_ANP
(self, idx)
src/data/dataset.py:65
↓ 1 callersMethodget_img_region_box
(self, id)
src/data/dataset.py:46
↓ 1 callersMethodget_img_region_box
(self, id)
src/data/dataset.py:146
↓ 1 callersMethodget_metric
(self, reset=True)
src/model/metrics.py:315
↓ 1 callersMethodget_opinion_spans
(self, id)
src/data/dataset.py:85
↓ 1 callersMethodget_sentence
(self, id)
src/data/dataset.py:76
↓ 1 callersMethodget_sentiment
(self, id)
src/data/dataset.py:72
↓ 1 callersMethodis_done
If there are enough hypotheses and that none of the hypotheses being generated can become better than the worst one in the heap, then
src/model/generater.py:781
↓ 1 callersFunctionmain
(rank, args)
pretrain.py:26
↓ 1 callersFunctionmain
(rank, args)
twitter_sc_training.py:30
↓ 1 callersFunctionmain
(rank, args)
MAESC_training.py:30
↓ 1 callersFunctionmain
(rank, args)
twitter_ae_training.py:30
↓ 1 callersFunctionmake_padding_mask
True for pad tokens
src/model/modeling_bart.py:221
↓ 1 callersFunctionparse_args
()
pretrain.py:245
↓ 1 callersFunctionparse_args
()
twitter_sc_training.py:298
↓ 1 callersFunctionparse_args
()
MAESC_training.py:260
↓ 1 callersFunctionparse_args
()
twitter_ae_training.py:274
↓ 1 callersMethodpredict
给定source的内容,输出generate的内容 :param torch.LongTensor src_tokens: bsz x max_len :param torch.LongTensor src_seq_len: bsz
src/model/generater.py:84
↓ 1 callersMethodprepare_state
(self, input_ids, image_features, attention_
src/model/model.py:106
↓ 1 callersFunctionpretrain
(task_list, epoch, model, train_loaders, optimizer_dict,
src/training.py:10
↓ 1 callersMethodprocess_ANP_distribution
(self, distribution)
src/data/dataset.py:53
↓ 1 callersFunctionsave_training_data
(path, optimizer=None, scaler=None, epoch=None)
src/utils.py:20
↓ 1 callersFunctionsc_generate
(decoder: Seq2SeqDecoder, state, tokens=None, gt_tokens=None,
src/model/generater.py:413
Method__call__
(self, batch)
src/data/collation.py:82
Method__getitem__
(self, index)
src/data/dataset.py:96
Method__getitem__
(self, index)
src/data/dataset.py:167
Method__init__
(self, log_dir=None, enabled=True, pad_length=50)
src/utils.py:43
Method__init__
( self, activation_dropout=0.0, extra_pos_embeddings=2, activa
src/model/config.py:5
Method__init__
(self, config: BartConfig)
src/model/modeling_bart.py:233
Method__init__
(self, config: BartConfig, embed_tokens)
src/model/modeling_bart.py:296
Method__init__
(self, config: BartConfig)
src/model/modeling_bart.py:400
Method__init__
(self, config: BartConfig, embed_tokens: nn.Embedding)
src/model/modeling_bart.py:499
next →1–100 of 191, ranked by callers