Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/FarinaMatteo/rethinking_fewshot_vlms
/ functions
Functions
188 in github.com/FarinaMatteo/rethinking_fewshot_vlms
⨍
Functions
188
◇
Types & classes
34
Method
__init__
(self, data_source, input_size, transform=None,
datasets/utils.py:324
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/oxford_pets.py:23
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/oxford_flowers.py:18
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/sun397.py:15
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/food101.py:15
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/ucf101.py:16
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/dtd.py:16
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/eurosat.py:29
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/stanford_cars.py:15
Method
__init__
(self, root, num_shots, setting="standard", seed=1)
datasets/caltech101.py:15
Method
__init__
(self, clip_model, classnames, template="a photo of a {}.")
fs/twostage.py:40
Method
__init__
( self, r: int, lora_alpha: int, fan_in_fan_out: bool = False, drop
loralib/layers.py:30
Method
__init__
( self, num_embeddings: int, embedding_dim: int, r: int = 0, lora_alph
loralib/layers.py:115
Method
__init__
( self, existing_linear: nn.Linear, r: int = 0, lora_alpha: int = 1,
loralib/layers.py:154
Method
__init__
( self, in_channels: int, out_channels: int, kernel_size: int, r: in
loralib/layers.py:255
Method
__init__
( self, in_channels: int, out_channels: int, kernel_size: int, r: in
loralib/layers.py:298
Method
__init__
( self, existing_mha: nn.MultiheadAttention, enable_lora: list = ['q', 'k'
loralib/layers.py:341
Method
__init__
( self, in_features: int, out_features: int, r: int = 0, lora_alph
loralib/layers.py:536
Method
__init__
( self, existing_mha: nn.MultiheadAttention)
loralib/easymultiheadattention.py:10
Method
__len__
(self)
datasets/utils.py:359
Method
_collate
(ims, y, c)
datasets/oxford_flowers.py:71
Method
_collate
(ims, y, c)
datasets/dtd.py:78
Method
_convert
(items)
datasets/oxford_pets.py:165
Function
_convert_image_to_rgb
(image)
clip/clip.py:72
Function
_convert_weights_to_fp16
(l)
clip/model.py:383
Method
_extract
(items)
datasets/oxford_pets.py:138
Method
check_input_domains
(self, source_domains, target_domains)
datasets/utils.py:216
Method
classname
(self)
datasets/utils.py:118
Method
classnames
(self)
datasets/utils.py:171
Method
domain
(self)
datasets/utils.py:114
Method
download_data
(self, url, dst, from_gdrive=True)
datasets/utils.py:228
Method
dtype
(self)
clip/model.py:342
Method
forward
(self, x: torch.Tensor)
clip/model.py:40
Method
forward
(self, x)
clip/model.py:66
Method
forward
(self, x)
clip/model.py:135
Method
forward
(self, x: torch.Tensor)
clip/model.py:156
Method
forward
(self, x: torch.Tensor)
clip/model.py:163
Method
forward
(self, x: torch.Tensor)
clip/model.py:186
Method
forward
(self, x: torch.Tensor)
clip/model.py:207
Method
forward
(self, x: torch.Tensor)
clip/model.py:228
Method
forward
(self, x, no_grad_backbone=False)
fs/twostage.py:68
Method
forward
(self, x: torch.Tensor, **kwargs)
loralib/layers.py:142
Method
forward
(self, x: torch.Tensor, **kwargs)
loralib/layers.py:186
Method
forward
(self, x: torch.Tensor, **kwargs)
loralib/layers.py:286
Method
forward
(self, x: torch.Tensor, **kwargs)
loralib/layers.py:329
Method
forward
(self, query: torch.Tensor, key: torch.Tensor, value: torch.Tensor,
loralib/layers.py:523
Method
forward
(self, x: torch.Tensor, **kwargs)
loralib/layers.py:590
Method
forward
( self, query, key, value, key_padding_mask=None,
loralib/easymultiheadattention.py:37
Method
get_last_hidden_states
(self, to_tensor=True)
clip/model.py:201
Method
impath
(self)
datasets/utils.py:106
Method
lab2cname
(self)
datasets/utils.py:167
Method
label
(self)
datasets/utils.py:110
Function
load
Load a CLIP model Parameters ---------- name : str A model name listed by `clip.available_models()`, or the path to a model check
clip/clip.py:91
Function
load_lora
(args, list_lora_layers)
loralib/utils.py:187
Method
load_preprocessed
(preprocessed)
datasets/oxford_pets.py:72
Function
lora_state_dict
(model: nn.Module, bias: str = 'none')
loralib/utils.py:67
Method
merge_BA
(self, param_name: str)
loralib/layers.py:577
Method
num_classes
(self)
datasets/utils.py:187
Method
read_and_split_data
( image_dir, p_trn=0.5, p_val=0.2, ignored=[], new_cnames=None )
datasets/dtd.py:57
Method
read_data
(self, split_file)
datasets/oxford_pets.py:89
Method
read_data
(self)
datasets/oxford_flowers.py:60
Method
read_data
(self, cname2lab, text_file)
datasets/sun397.py:54
Method
read_data
(self, cname2lab, text_file)
datasets/ucf101.py:56
Method
read_data
(self, image_dir, anno_file, meta_file)
datasets/stanford_cars.py:54
Function
run_ln_only
(args, clip_model, logit_scale, dataset, train_loader, val_loader, test_loader)
fs/ln_only.py:68
Function
run_lora
(args, clip_model, logit_scale, dataset, train_loader, val_loader, test_loader)
fs/lora.py:13
Function
run_twostage
(args, clip_model, logit_scale, dataset, train_loader, val_loader, test_loader)
fs/twostage.py:251
Method
save_split
(train, val, test, filepath, path_prefix)
datasets/oxford_pets.py:137
Method
split_dataset_by_domain
Split a dataset, i.e. a list of Datum objects, into domain-specific groups stored in a dictionary. Args: data_source (lis
datasets/utils.py:308
Method
split_trainval
(trainval, p_val=0.2)
datasets/oxford_pets.py:114
Method
stem
(x)
clip/model.py:136
Method
test
(self)
datasets/utils.py:159
Method
test_classnames
(self)
datasets/utils.py:179
Method
test_new
(self)
datasets/utils.py:163
Method
test_new_classnames
(self)
datasets/utils.py:183
Function
tokenize
Returns the tokenized representation of given input string(s) Parameters ---------- texts : Union[str, List[str]] An input s
clip/clip.py:193
Method
train
(self, mode: bool = True)
loralib/layers.py:138
Method
train
(self, mode: bool = True)
loralib/layers.py:181
Method
train
(self, mode: bool = True)
loralib/layers.py:282
Method
train
(self, mode: bool = True)
loralib/layers.py:325
Method
train
(self, mode: bool = True)
loralib/layers.py:519
Method
train
(self, mode: bool = True)
loralib/layers.py:586
Method
train_u
(self)
datasets/utils.py:151
Method
train_x
(self)
datasets/utils.py:147
Method
update_classname
(self, dataset_old)
datasets/eurosat.py:63
Method
val
(self)
datasets/utils.py:155
Method
val_classnames
(self)
datasets/utils.py:175
Function
zero_shot_eval
(clip_model, dataset, loader, split="test")
fs/utils/eval_utils.py:48
← previous
101–188 of 188, ranked by callers