MCPcopy Create free account

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

Functions191 in github.com/NUSTM/VLP-MABSA

Method__init__
( self, input_dim, inner_dim, num_classes, pooler_
src/model/modeling_bart.py:842
Method__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx: int, offset)
src/model/modeling_bart.py:870
Method__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx
src/model/modeling_bart.py:903
Method__init__
(self, num_embeddings: int, embedding_dim: int, padding_idx
src/model/modeling_bart.py:985
Method__init__
(self, config: BartConfig)
src/model/modeling_bart.py:1095
Method__init__
(self, config: BartConfig)
src/model/modeling_bart.py:1224
Method__init__
(self, config: BartConfig, **kwargs)
src/model/modeling_bart.py:1410
Method__init__
(self, config)
src/model/modeling_bart.py:1500
Method__init__
(self, num_positions, embedding_dim, padding_idx=None)
src/model/modeling_bart.py:1605
Method__init__
(self, eos_token_id, num_labels, conflict_id,
src/model/metrics.py:7
Method__init__
(self, image_dim, final_dim)
src/model/modules.py:23
Method__init__
(self, config: MultiModalBartConfig, encoder, img_feat_id, cls_token_id)
src/model/modules.py:55
Method__init__
(self, config: MultiModalBartConfig, tokenizer, decoder,
src/model/modules.py:173
Method__init__
(self, config: MultiModalBartConfig, decoder)
src/model/modules.py:339
Method__init__
(self, config: MultiModalBartConfig, decoder)
src/model/modules.py:381
Method__init__
(self, config: MultiModalBartConfig, decoder, senti_ids,
src/model/modules.py:425
Method__init__
(self, config: MultiModalBartConfig, decoder, causal_mask, args)
src/model/modules.py:468
Method__init__
:param Seq2SeqModel seq2seq_model: 序列到序列模型. 会使用seq2seq_model的decoder进行生成 :param int,None bos_token_id: 句子开头的token id :param
src/model/generater.py:17
Method__init__
:param Seq2SeqDecoder decoder: Decoder对象 :param int max_length: 生成句子的最大长度, 每句话的decode长度为max_length + max_len_a*src_len :para
src/model/generater.py:123
Method__init__
(self, config: MultiModalBartConfig, args, bart_model, tokenizer, label_ids)
src/model/MAESC_model.py:72
Method__init__
(self, config: MultiModalBartConfig, bart_model, tokenizer, label_ids, senti_ids, args)
src/model/model.py:80
Method__init__
(self, args, pretrained_model_name='facebook/bart-base', cl
src/data/tokenization_new.py:20
Method__init__
(self, infos)
src/data/dataset.py:13
Method__init__
(self, infos, split)
src/data/dataset.py:125
Method__init__
:param tokenizer: ConditionTokenizer :param mlm_enabled: bool, if use mlm for language modeling. False for autoregressive modeling
src/data/collation.py:14
Method__len__
Number of hypotheses in the list.
src/model/generater.py:759
Method__len__
(self)
src/data/tokenization_new.py:676
Method__len__
(self)
src/data/dataset.py:34
Method__len__
(self)
src/data/dataset.py:143
Function_check_shapes
(shape_1, shape2)
src/model/modeling_bart.py:206
Method_clip_text
(self, text, length)
src/data/collation.py:69
Function_get_shape
(t)
src/model/modeling_bart.py:1086
Method_init_weights
(self, module)
src/model/modules.py:439
Method_reorder_cache
(past, beam_idx)
src/model/modeling_bart.py:1387
Method_reorder_cache
(past, beam_idx)
src/model/mixins.py:420
Methodadjust_logits_during_generation
(self, logits, cur_len, max_length)
src/model/modeling_bart.py:1374
Methodadjust_logits_during_generation
(self, logits, cur_len, max_length)
src/model/mixins.py:400
Functionclip_gradient
(optimizer, grad_clip)
src/model/utils.py:16
Functioncmp
(v1, v2)
src/data/tokenization_new.py:9
Methodconvert_ids_to_tokens
(self, ids)
src/data/tokenization_new.py:670
Methoddummy_inputs
(self)
src/model/modeling_bart.py:187
Methodencode_anp_dis
(self, batch_size)
src/data/tokenization_new.py:336
Methodencode_mlm_sentence
(self, labels)
src/data/tokenization_new.py:173
Functioneval
(args, model, loader, metric, device)
src/eval_utils.py:5
Methodevaluate
(self, aesc_target_span, pred, tgt_tokens)
src/model/metrics.py:34
Methodforward
Args: x (Tensor): input to the layer of shape `(seq_len, batch, embed_dim)` encoder_padding_mask (ByteTensor): binary
src/model/modeling_bart.py:248
Methodforward
Args: input_ids (LongTensor): tokens in the source language of shape `(batch, src_len)` attention_mas
src/model/modeling_bart.py:327
Methodforward
( self, x, encoder_hidden_states, encoder_attn_mask=None,
src/model/modeling_bart.py:426
Methodforward
Includes several features from "Jointly Learning to Align and Translate with Transformer Models" (Garg et al., EMNLP 2019).
src/model/modeling_bart.py:541
Methodforward
(self, x)
src/model/modeling_bart.py:854
Methodforward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:881
Methodforward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:919
Methodforward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:1001
Methodforward
( self, input_ids, attention_mask=None, decoder_input_ids=None
src/model/modeling_bart.py:1113
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`): Labels for computing the masked l
src/model/modeling_bart.py:1253
Methodforward
r""" labels (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`): Labels for computing the sequence classification/
src/model/modeling_bart.py:1429
Methodforward
r""" start_positions (:obj:`torch.LongTensor` of shape :obj:`(batch_size,)`, `optional`): Labels for position (index) of the start
src/model/modeling_bart.py:1518
Methodforward
Input is expected to be of size [bsz x seqlen].
src/model/modeling_bart.py:1629
Methodforward
(self, image_features)
src/model/modules.py:27
Methodforward
:param input_ids: LongTensor, tokens in the source language of shape (batch, src_len) :param image_features: list[FloatTensor], imag
src/model/modules.py:98
Methodforward
(self, tokens, state, only_sc=False)
src/model/modules.py:208
Methodforward
(self, labels, input_ids, encoder_outputs, attention_mask, decoder_input_ids, decoder_attentio
src/model/modules.py:347
Methodforward
(self, labels, input_ids, encoder_outputs, attention_mask, decoder_input_ids, decoder_attentio
src/model/modules.py:389
Methodforward
(self, senti_labels, encoder_outputs, attention_mask, senti_decoder_input_ids)
src/model/modules.py:444
Methodforward
(self, mrm_labels, mrm_masks, encoder_outputs, attention_mask, mrm_decoder_input_ids, mrm_deco
src/model/modules.py:489
Methodforward
透传调用seq2seq_model的forward :param torch.LongTensor src_tokens: bsz x max_len :param torch.LongTensor tgt_tokens: bsz x max_le
src/model/generater.py:64
Methodforward
( self, input_ids, image_features, attention_mask=None,
src/model/MAESC_model.py:124
Methodforward
( self, task_type, input_ids, image_features, atte
src/model/model.py:125
Methodgenerate
Generates sequences for models with a LM head. The method currently supports greedy decoding, beam-search decoding, sampling with tem
src/model/mixins.py:33
Methodget_encoder
(self)
src/model/modeling_bart.py:1398
Methodget_input_embeddings
(self)
src/model/modeling_bart.py:1203
Functionget_lr
(optimizer)
src/model/utils.py:11
Methodget_metric
(self, reset=True)
src/model/metrics.py:140
Methodget_output_embeddings
(self)
src/model/modeling_bart.py:1211
Methodget_output_embeddings
(self)
src/model/modeling_bart.py:1401
Methodget_output_embeddings
(self)
src/model/mixins.py:439
Functiongreedy_generate
贪婪地搜索句子 :param Decoder decoder: Decoder对象 :param torch.LongTensor tokens: batch_size x len, decode的输入值,如果为None,则自动从bos_token_id开始生成
src/model/generater.py:223
Methodline
(self)
src/utils.py:55
Functionliner_warmup
(cur_step, t_step, warmup)
src/model/utils.py:25
Functionload_training_data
(path, optimizer=None, scaler=None, map_location=None)
src/utils.py:30
Methodprepare_inputs_for_generation
(self, decoder_input_ids, past, attention_mask, use_cache,
src/model/modeling_bart.py:1360
Methodprepare_inputs_for_generation
(self, decoder_input_ids, past, attention_mask, use_cache, **kwargs)
src/model/mixins.py:386
Methodpri
(self)
src/model/metrics.py:136
Methodreorder_state
(self, indices: torch.LongTensor)
src/model/MAESC_model.py:158
Methodresize_token_embeddings
(self, new_num_tokens: int)
src/model/modeling_bart.py:1232
Functionsample_sentence
(model, input_ids, image_features, attention_mask,
src/model/utils.py:32
Methodset_input_embeddings
(self, value)
src/model/modeling_bart.py:1206
Functionset_lr
(optimizer, lr)
src/model/utils.py:6
Methodset_new_generator
(self, max_length=-1, max_len_a=-1,
src/model/generater.py:176
Methodset_position_embedding
(self, special_tag_start_id, tag_first=True)
src/model/modeling_bart.py:526
Functionsetup_process
(rank, world_size, master_port='12355')
src/utils.py:9
← previous101–191 of 191, ranked by callers