Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CAMMA-public/SSG-VQA
/ functions
Functions
100 in github.com/CAMMA-public/SSG-VQA
⨍
Functions
100
◇
Types & classes
32
↳
Endpoints
1
↓ 22 callers
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:561
↓ 3 callers
Method
transpose_for_scores
(self, x)
models/VisualBert_ssgqa.py:406
↓ 3 callers
Function
validate
( args, val_loader, model, criterion, epoch, tokenizer, device, save_output=False )
train.py:116
↓ 2 callers
Function
eval_for_f1_et_all
(y_true, y_pred)
utils/utils.py:158
↓ 2 callers
Method
transpose_for_scores
(self, x)
models/VisualBert_ssgqa.py:1768
↓ 2 callers
Function
validate
(args, val_loader, model, epoch, tokenizer, device, save_output=False)
test.py:44
↓ 1 callers
Function
adjust_learning_rate
Shrinks learning rate by a specified factor. :param optimizer: optimizer whose learning rate must be shrunk. :param shrink_factor: facto
utils/utils.py:103
↓ 1 callers
Function
calc_acc
(y_true, y_pred)
utils/utils.py:130
↓ 1 callers
Function
calc_classwise_acc
(y_true, y_pred)
utils/utils.py:135
↓ 1 callers
Function
calc_precision_recall_fscore
(y_true, y_pred)
utils/utils.py:146
↓ 1 callers
Method
prune_heads
(self, heads)
models/VisualBert_ssgqa.py:484
↓ 1 callers
Method
reset
(self)
utils/utils.py:22
↓ 1 callers
Function
save_clf_checkpoint
Saves model checkpoint.
utils/utils.py:68
↓ 1 callers
Function
seed_everything
Set random seed for reproducible experiments Inputs: seed number
train.py:32
↓ 1 callers
Function
seed_everything
Set random seed for reproducible experiments Inputs: seed number
test.py:32
↓ 1 callers
Function
train
( args, train_dataloader, model, criterion, optimizer, epoch, tokenizer, device )
train.py:44
↓ 1 callers
Method
update
(self, val, n=1)
utils/utils.py:28
Method
__getitem__
(self, idx)
utils/dataloaderClassification.py:112
Method
__getitem__
(self, idx)
utils/dataloaderClassification.py:246
Method
__init__
( self, )
utils/feature_extract_roi.py:28
Method
__init__
(self)
utils/utils.py:19
Method
__init__
(self, seq, folder_head, folder_tail, ana_type, patch_size=4)
utils/dataloaderClassification.py:24
Method
__init__
(self, seq, folder_head, folder_tail, patch_size=4)
utils/dataloaderClassification.py:162
Method
__init__
(self, patch_size=4)
utils/feat_extract_visual.py:25
Method
__init__
(self, vocab_size, layers, n_heads, num_class=10)
models/VisualBertClassification_ssgqa.py:27
Method
__init__
(self, emb_dim, heads, dropout_rate=0.1)
models/VisualBert_ssgqa.py:77
Method
__init__
(self, scene_dim, text_dim, dropout_rate=0.1)
models/VisualBert_ssgqa.py:116
Method
__init__
(self, scene_dim, text_dim, dropout_rate=0.1)
models/VisualBert_ssgqa.py:154
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:194
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:386
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:462
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:478
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:529
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:545
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:605
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:649
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:720
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:736
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:754
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:775
Method
__init__
(self, config, add_pooling_layer=True)
models/VisualBert_ssgqa.py:945
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1166
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1329
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1502
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1636
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1751
Method
__init__
(self, config)
models/VisualBert_ssgqa.py:1807
Method
__len__
(self)
utils/dataloaderClassification.py:109
Method
__len__
(self)
utils/dataloaderClassification.py:243
Method
_init_weights
Initialize the weights
models/VisualBert_ssgqa.py:796
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTrainedModel
models/VisualBert_ssgqa.py:968
Method
_set_gradient_checkpointing
(self, module, value=False)
models/VisualBert_ssgqa.py:809
Function
accuracy
Computes top-k accuracy, from predicted and true labels. :param scores: scores from the model :param targets: true labels :param k:
utils/utils.py:86
Function
calc_map
(y_true, y_scores)
utils/utils.py:141
Function
clip_gradient
Clips gradients computed during backpropagation to avoid explosion of gradients. :param optimizer: optimizer with the gradients to be clippe
utils/utils.py:117
Method
create_custom_forward
(module)
models/VisualBert_ssgqa.py:677
Method
custom_forward
(*inputs)
models/VisualBert_ssgqa.py:678
Function
densenet_121
(pretrained=True)
models/resnets.py:77
Function
densenet_161
(pretrained=True)
models/resnets.py:84
Function
densenet_169
(pretrained=True)
models/resnets.py:91
Method
feed_forward_chunk
(self, attention_output)
models/VisualBert_ssgqa.py:598
Method
feed_forward_chunk
(self, attention_output)
models/VisualBert_ssgqa.py:642
Method
forward
(self, img, boxes, classes)
utils/feature_extract_roi.py:39
Method
forward
(self, img)
utils/feat_extract_visual.py:34
Method
forward
(self, inputs, visual_embeds)
models/VisualBertClassification_ssgqa.py:39
Method
forward
(self, values, keys, queries)
models/VisualBert_ssgqa.py:95
Method
forward
(self, text, scene)
models/VisualBert_ssgqa.py:134
Method
forward
(self, text, scene)
models/VisualBert_ssgqa.py:172
Method
forward
( self, input_ids=None, token_type_ids=None, position_ids=None, inputs
models/VisualBert_ssgqa.py:248
Method
forward
( self, hidden_states, attention_mask=None, head_mask=None, output_att
models/VisualBert_ssgqa.py:414
Method
forward
( self, hidden_states: torch.Tensor, input_tensor: torch.Tensor )
models/VisualBert_ssgqa.py:468
Method
forward
( self, hidden_states, attention_mask=None, head_mask=None, output_att
models/VisualBert_ssgqa.py:507
Method
forward
(self, hidden_states: torch.Tensor)
models/VisualBert_ssgqa.py:537
Method
forward
( self, hidden_states: torch.Tensor, input_tensor: torch.Tensor )
models/VisualBert_ssgqa.py:551
Method
forward
( self, hidden_states, attention_mask=None, head_mask=None, output_att
models/VisualBert_ssgqa.py:569
Method
forward
( self, hidden_states, attention_mask=None, head_mask=None, output_att
models/VisualBert_ssgqa.py:613
Method
forward
( self, hidden_states, attention_mask=None, head_mask=None, output_att
models/VisualBert_ssgqa.py:657
Method
forward
(self, hidden_states: torch.Tensor)
models/VisualBert_ssgqa.py:725
Method
forward
(self, hidden_states: torch.Tensor)
models/VisualBert_ssgqa.py:745
Method
forward
(self, hidden_states)
models/VisualBert_ssgqa.py:767
Method
forward
(self, sequence_output, pooled_output)
models/VisualBert_ssgqa.py:780
Method
forward
r""" Returns: Example: ```python # Assumption: *get_visual_embeddings(image)* gets the visual embeddings of the ima
models/VisualBert_ssgqa.py:982
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, total_sequence_length)`, *optional*): Labels for computing the masked langu
models/VisualBert_ssgqa.py:1187
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the multiple choice classification los
models/VisualBert_ssgqa.py:1345
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, total_sequence_length)`, *optional*): Labels for computing the sequence cla
models/VisualBert_ssgqa.py:1519
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
models/VisualBert_ssgqa.py:1653
Method
forward
(self, query, key, attention_mask)
models/VisualBert_ssgqa.py:1776
Method
forward
r""" region_to_phrase_position (`torch.LongTensor` of shape `(batch_size, total_sequence_length)`, *optional*): The positions depi
models/VisualBert_ssgqa.py:1824
Method
forward
(self, x)
models/resnets.py:16
Method
get_input_embeddings
(self)
models/VisualBert_ssgqa.py:962
Method
get_output_embeddings
(self)
models/VisualBert_ssgqa.py:1175
Function
resnet_101
(pretrained=True)
models/resnets.py:58
Function
resnet_18
(pretrained=True)
models/resnets.py:26
Function
resnet_34
(pretrained=True)
models/resnets.py:33
Function
resnet_50
(pretrained="imagenet")
models/resnets.py:40
Function
resnext_100
(pretrained=True)
models/resnets.py:110
Function
resnext_50
(pretrained=True)
models/resnets.py:103
Function
save_checkpoint
Saves model checkpoint. :param data_name: base name of processed dataset :param epoch: epoch number :param epochs_since_improvement:
utils/utils.py:35
Method
set_input_embeddings
(self, value)
models/VisualBert_ssgqa.py:965
Method
set_output_embeddings
(self, new_embeddings)
models/VisualBert_ssgqa.py:1178