Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HobbitLong/CMC
/ functions
Functions
98 in github.com/HobbitLong/CMC
⨍
Functions
98
◇
Types & classes
35
↓ 42 callers
Method
cuda
(self)
NCE/alias_multinomial.py:45
↓ 33 callers
Method
update
(self, val, n=1)
util.py:31
↓ 8 callers
Method
__init__
(self, block, layers, low_dim=128, in_channel=3, width=1)
models/resnet.py:110
↓ 7 callers
Function
resnet50
Constructs a ResNet-50 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet
models/resnet.py:207
↓ 6 callers
Function
resnet101
Constructs a ResNet-101 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet
models/resnet.py:218
↓ 6 callers
Function
resnet18
Constructs a ResNet-18 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet
models/resnet.py:185
↓ 4 callers
Method
_make_layer
(self, block, planes, blocks, stride=1)
models/resnet.py:137
↓ 4 callers
Function
adjust_learning_rate
Sets the learning rate to the initial LR decayed by 0.2 every steep step
util.py:7
↓ 3 callers
Method
__init__
(self, feat_dim=128)
models/alexnet.py:18
↓ 2 callers
Method
__init__
(self, inputSize, outputSize, K, T=0.07, momentum=0.5, use_softmax=False)
NCE/NCEAverage.py:9
↓ 2 callers
Method
__init__
(self)
models/LinearModel.py:7
↓ 2 callers
Function
accuracy
Computes the accuracy over the k top predictions for the specified values of k
eval_moco_ins.py:468
↓ 2 callers
Function
accuracy
Computes the accuracy over the k top predictions for the specified values of k
util.py:38
↓ 2 callers
Function
conv3x3
3x3 convolution with padding
models/resnet.py:19
↓ 2 callers
Method
draw
Draw N samples from multinomial :param N: number of samples :return: samples
NCE/alias_multinomial.py:49
↓ 2 callers
Function
moment_update
model_ema = m * model_ema + (1 - m) model
train_moco_ins.py:140
↓ 1 callers
Method
__init__
(self, n_data)
NCE/NCECriterion.py:11
↓ 1 callers
Function
get_shuffle_ids
generate shuffle ids for ShuffleBN
train_moco_ins.py:146
↓ 1 callers
Function
get_train_loader
get the train loader
train_CMC.py:127
↓ 1 callers
Function
get_train_val_loader
(args)
LinearProbing.py:114
↓ 1 callers
Method
initilize
(self)
models/LinearModel.py:47
↓ 1 callers
Method
initilize
(self)
models/LinearModel.py:102
↓ 1 callers
Function
main
()
eval_moco_ins.py:134
↓ 1 callers
Function
main
()
train_moco_ins.py:155
↓ 1 callers
Function
main
()
train_CMC.py:270
↓ 1 callers
Function
main
()
LinearProbing.py:321
↓ 1 callers
Function
parse_option
()
eval_moco_ins.py:31
↓ 1 callers
Function
parse_option
()
train_moco_ins.py:40
↓ 1 callers
Function
parse_option
()
train_CMC.py:37
↓ 1 callers
Function
parse_option
()
LinearProbing.py:27
↓ 1 callers
Method
reset
(self)
util.py:25
↓ 1 callers
Function
set_model
(args, n_data)
train_CMC.py:165
↓ 1 callers
Function
set_model
(args)
LinearProbing.py:166
↓ 1 callers
Function
set_optimizer
(args, model)
train_CMC.py:188
↓ 1 callers
Function
set_optimizer
(args, classifier)
LinearProbing.py:200
↓ 1 callers
Function
train
one epoch training
eval_moco_ins.py:357
↓ 1 callers
Function
train
one epoch training
train_CMC.py:197
↓ 1 callers
Function
train
one epoch training
LinearProbing.py:208
↓ 1 callers
Function
train_ins
one epoch training for instance discrimination
train_moco_ins.py:336
↓ 1 callers
Function
train_moco
one epoch training for instance discrimination
train_moco_ins.py:400
↓ 1 callers
Function
validate
(val_loader, model, classifier, criterion, opt)
eval_moco_ins.py:418
↓ 1 callers
Function
validate
evaluation
LinearProbing.py:268
Method
__call__
(self, img)
dataset.py:41
Method
__call__
(self, img)
dataset.py:49
Method
__call__
(self, img)
dataset.py:57
Method
__call__
(self, img)
dataset.py:65
Method
__call__
(self, img)
dataset.py:73
Method
__call__
(self, img)
dataset.py:81
Method
__call__
(self, img)
dataset.py:89
Method
__call__
(self, img)
dataset.py:97
Method
__call__
(self, img)
dataset.py:105
Method
__call__
(self, img)
dataset.py:113
Method
__call__
(self, img)
dataset.py:121
Method
__getitem__
Args: index (int): Index Returns: tuple: (image, target, index) where target is class_index of the target cla
dataset.py:18
Method
__init__
(self, root, transform=None, target_transform=None, two_crop=False)
dataset.py:14
Method
__init__
(self)
util.py:18
Method
__init__
(self)
NCE/NCECriterion.py:37
Method
__init__
(self, inputSize, outputSize, K, T=0.07, momentum=0.5, use_softmax=False)
NCE/NCEAverage.py:94
Method
__init__
(self, inputSize, outputSize, K, T=0.07, use_softmax=False)
NCE/NCEAverage.py:153
Method
__init__
(self, probs)
NCE/alias_multinomial.py:8
Method
__init__
(self, layer=5, n_label=1000, pool_type='max')
models/LinearModel.py:15
Method
__init__
(self, layer=6, n_label=1000, pool_type='avg', width=1)
models/LinearModel.py:58
Method
__init__
(self, feat_dim=128)
models/alexnet.py:8
Method
__init__
(self, in_channel=1, feat_dim=128)
models/alexnet.py:32
Method
__init__
(self, power=2)
models/alexnet.py:109
Method
__init__
(self, power=2)
models/resnet.py:27
Method
__init__
(self, inplanes, planes, stride=1, downsample=None)
models/resnet.py:40
Method
__init__
(self, inplanes, planes, stride=1, downsample=None)
models/resnet.py:72
Method
__init__
(self, width=1)
models/resnet.py:242
Method
__init__
(self, name='resnet50')
models/resnet.py:252
Method
__init__
(self, name='resnet50')
models/resnet.py:274
Method
__init__
(self, name='resnet50')
models/resnet.py:296
Method
__init__
(self, name='resnet50v1')
models/resnet.py:318
Method
forward
(self, x)
NCE/NCECriterion.py:15
Method
forward
(self, x)
NCE/NCECriterion.py:41
Method
forward
(self, l, ab, y, idx=None)
NCE/NCEAverage.py:23
Method
forward
(self, x, y, idx=None)
NCE/NCEAverage.py:107
Method
forward
(self, q, k)
NCE/NCEAverage.py:167
Method
forward
(self, feat)
models/LinearModel.py:10
Method
forward
(self, x)
models/LinearModel.py:53
Method
forward
(self, x)
models/LinearModel.py:108
Method
forward
(self, x, layer=8)
models/alexnet.py:13
Method
forward
(self, x, layer=8)
models/alexnet.py:24
Method
forward
(self, x, layer)
models/alexnet.py:77
Method
forward
(self, x)
models/alexnet.py:113
Method
forward
(self, x)
models/resnet.py:31
Method
forward
(self, x)
models/resnet.py:50
Method
forward
(self, x)
models/resnet.py:85
Method
forward
(self, x, layer=7)
models/resnet.py:154
Method
forward
(self, x, layer=7)
models/resnet.py:247
Method
forward
(self, x, layer=7)
models/resnet.py:266
Method
forward
(self, x, layer=7)
models/resnet.py:288
Method
forward
(self, x, layer=7)
models/resnet.py:310
Method
forward
(self, x, layer=7)
models/resnet.py:331
Function
resnet152
Constructs a ResNet-152 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet
models/resnet.py:229
Function
resnet34
Constructs a ResNet-34 model. Args: pretrained (bool): If True, returns a model pre-trained on ImageNet
models/resnet.py:196
Function
set_bn_train
(m)
train_moco_ins.py:408
Function
set_lr
set the learning rate
eval_moco_ins.py:349