MCPcopy Index your code

hub / github.com/imrahulr/hat / functions

Functions206 in github.com/imrahulr/hat

↓ 1 callersFunctionupdate_bn
Update batch normalization layers.
gowal21uncovering/utils/watrain.py:213
↓ 1 callersFunctionwideresnet
Returns suitable Wideresnet model from its name. Arguments: name (str): name of resnet architecture. num_classes (int): numbe
core/models/wideresnet.py:122
↓ 1 callersFunctionwideresnetwithswish
Returns suitable Wideresnet model with Swish activation function from its name. Arguments: name (str): name of resnet architecture.
core/models/wideresnetwithswish.py:171
FunctionCWLoss
CW loss (Marging loss).
core/attacks/utils.py:201
Method__call__
(self, sample)
core/utils/utils.py:162
Method__call__
(self, *args, **kwargs)
core/attacks/base.py:35
Method__enter__
(self)
core/utils/context.py:10
Method__enter__
(self)
core/utils/context.py:24
Method__exit__
(self, *args)
core/utils/context.py:13
Method__exit__
(self, *args)
core/utils/context.py:27
Method__getattr__
(self, name)
eval-adv.py:174
Method__getitem__
(self, item)
core/data/semisup.py:117
Method__getitem__
(self, idx)
core/data/utils.py:41
Method__init__
(self, module)
core/utils/context.py:5
Method__init__
(self, module)
core/utils/context.py:19
Method__init__
(self, info, args)
core/utils/train.py:37
Method__init__
(self, optimizer, max_lr, epochs, last_epoch=-1)
core/utils/rst.py:10
Method__init__
(self, smoothing=0.0, reduction='mean')
core/utils/utils.py:14
Method__init__
(self, path)
core/utils/logger.py:10
Method__init__
(self, sup_inds, unsup_inds, batch_size, unsup_fraction=0.5, num_batches=None)
core/data/semisup.py:126
Method__init__
(self, root, transform=NumpyToTensor(), target_transform=None)
core/data/utils.py:19
Method__init__
(self, data_path, **kwargs)
core/data/imagenet100.py:17
Method__init__
(self, predict, loss_fn=None, eps=0.3, clip_min=0., clip_max=1., targeted=False)
core/attacks/fgsm.py:21
Method__init__
(self, predict, loss_fn='ce', n_restarts=2, eps=0.3, nb_iter=40, seed=1)
core/attacks/apgd.py:49
Method__init__
(self, predict, loss_fn='ce', n_restarts=2, eps=0.3, nb_iter=40, seed=1)
core/attacks/apgd.py:67
Method__init__
(self, predict, loss_fn, clip_min, clip_max)
core/attacks/base.py:17
Method__init__
( self, predict, loss_fn=None, eps=0.3, nb_iter=40, eps_iter=0.01, rand_init=True, clip_min=0., cl
core/attacks/pgd.py:159
Method__init__
( self, predict, loss_fn=None, eps=0.3, nb_iter=40, eps_iter=0.01, rand_init=True, clip_min=0., cl
core/attacks/pgd.py:184
Method__init__
( self, predict, overshoot=0.02, nb_iter=50, search_iter=50, clip_min=0., clip_max=1.)
core/attacks/deepfool.py:166
Method__init__
( self, predict, overshoot=0.02, nb_iter=50, search_iter=50, clip_min=0., clip_max=1.)
core/attacks/deepfool.py:188
Method__init__
(self, in_planes, planes, stride=1)
core/models/ti_preact_resnet.py:47
Method__init__
(self, block, num_blocks, num_classes=200)
core/models/ti_preact_resnet.py:75
Method__init__
(self, num_blocks, in_planes, out_planes, stride, activation_fn=nn.ReLU)
core/models/wideresnetwithswish.py:81
Method__init__
(self, num_classes: int = 10, depth: int = 28, width: int =
core/models/wideresnetwithswish.py:110
Method__init__
(self, in_planes, planes, stride=1)
core/models/in_preact_resnet.py:47
Method__init__
(self, block, num_blocks, num_classes=10)
core/models/in_preact_resnet.py:75
Method__init__
(self, in_planes, planes, stride=1)
core/models/preact_resnet.py:47
Method__init__
(self, block, num_blocks, num_classes=10)
core/models/preact_resnet.py:75
Method__init__
(self, mean, std)
core/models/resnet.py:15
Method__init__
(self, in_planes, planes, stride=1)
core/models/resnet.py:43
Method__init__
(self, in_planes, planes, stride=1)
core/models/resnet.py:75
Method__init__
(self, nb_layers, in_planes, out_planes, block, stride, dropRate=0.0)
core/models/wideresnet.py:57
Method__init__
(self, depth=34, num_classes=10, widen_factor=10, dropRate=0.0)
core/models/wideresnet.py:80
Method__init__
(self, num_classes: int = 10, depth: int = 18, width: int = 0, #
core/models/preact_resnetwithswish.py:82
Method__init__
(self, info, args)
gowal21uncovering/utils/watrain.py:36
Method__iter__
(self)
core/data/semisup.py:144
Method__len__
(self)
core/data/semisup.py:114
Method__len__
(self)
core/data/semisup.py:161
Method__len__
(self)
core/data/utils.py:38
Function_thresh_by_magnitude
Threshold by magnitude.
core/attacks/utils.py:126
Functioncalc_l2distsq
Calculate L2 distance between tensors x and y.
core/attacks/utils.py:27
Functionclear_data
()
core/setup.py:40
Methoddata
(self)
core/data/semisup.py:99
Functioneval_multiple_restarts_advertorch
Evaluate adversarial accuracy with multiple restarts (Advertorch).
eval-adv.py:96
Methodforward
(self, input, target)
core/utils/utils.py:19
Methodforward
(self, x)
core/models/ti_preact_resnet.py:28
Methodforward
(self, x)
core/models/ti_preact_resnet.py:61
Methodforward
(self, x)
core/models/ti_preact_resnet.py:96
Methodforward
(self, x)
core/models/wideresnetwithswish.py:53
Methodforward
(self, x)
core/models/wideresnetwithswish.py:93
Methodforward
(self, x)
core/models/wideresnetwithswish.py:152
Methodforward
(self, x)
core/models/in_preact_resnet.py:28
Methodforward
(self, x)
core/models/in_preact_resnet.py:61
Methodforward
(self, x)
core/models/in_preact_resnet.py:100
Methodforward
(self, x)
core/models/preact_resnet.py:28
Methodforward
(self, x)
core/models/preact_resnet.py:61
Methodforward
(self, x)
core/models/preact_resnet.py:95
Methodforward
(self, x)
core/models/resnet.py:22
Methodforward
(self, x)
core/models/resnet.py:57
Methodforward
(self, x)
core/models/resnet.py:91
Methodforward
(self, x)
core/models/resnet.py:128
Methodforward
(self, x)
core/models/wideresnet.py:34
Methodforward
(self, x)
core/models/wideresnet.py:67
Methodforward
(self, x)
core/models/wideresnet.py:111
Methodforward
(self, x)
core/models/preact_resnetwithswish.py:60
Methodforward
(self, x)
core/models/preact_resnetwithswish.py:126
Methodget_lr
(self)
core/utils/rst.py:27
Methodgroup_weight
(model)
gowal21uncovering/utils/watrain.py:56
Methodinit_optimizer
Initialize optimizer and schedulers.
gowal21uncovering/utils/watrain.py:52
Functionl2_norm
(x)
core/utils/trades.py:17
Functionl2_norm
(x)
gowal21uncovering/utils/trades.py:17
Methodload_base_dataset
(self, train=False, **kwargs)
core/data/cifar10s.py:49
Methodload_base_dataset
(self, train=False, **kwargs)
core/data/cifar100s.py:48
Functionload_cifar10
Returns CIFAR10 train, test datasets and dataloaders. Arguments: data_dir (str): path to data directory. use_augmentation (bo
core/data/cifar10.py:16
Functionload_cifar100
Returns CIFAR100 train, test datasets and dataloaders. Arguments: data_dir (str): path to data directory. use_augmentation (b
core/data/cifar100.py:16
Functionload_cifar100s
Returns semisupervised CIFAR100 train, test datasets and dataloaders (with DDPM Images). Arguments: data_dir (str): path to data dire
core/data/cifar100s.py:12
Functionload_cifar10s
Returns semisupervised CIFAR10 train, test datasets and dataloaders (with Tiny Images). Arguments: data_dir (str): path to data direc
core/data/cifar10s.py:12
Functionload_imagenet100
Returns ImageNet100 train, test datasets. Arguments: data_dir (str): path to data directory. use_augmentation (bool): whether
core/data/imagenet100.py:25
Methodload_model
Load model weights.
gowal21uncovering/utils/watrain.py:185
Functionload_svhn
Returns SVHN train, test datasets and dataloaders. Arguments: data_dir (str): path to data directory. use_augmentation (bool)
core/data/svhn.py:16
Functionload_tinyimagenet
Returns Tiny Imagenet-200 train, test datasets and dataloaders. Arguments: data_dir (str): path to data directory. use_augmen
core/data/tiny_imagenet.py:18
Functionmeasure_margin
Estimate margin using line search.
core/utils/exp.py:63
Methodperturb
Given examples (x, y), returns their adversarial counterparts with an attack length of eps. Arguments: x (torch.Tensor):
core/attacks/fgsm.py:29
Methodperturb
Given examples (x, y), returns their adversarial counterparts with an attack length of eps. Arguments: x (torch.Tensor):
core/attacks/fgsm.py:83
Methodperturb
Given examples (x, y), returns their adversarial counterparts with an attack length of eps. Arguments: x (torch.Tensor):
core/attacks/pgd.py:107
Methodperturb
Given examples x, returns their adversarial counterparts. Arguments: x (torch.Tensor): input tensor. y (torch
core/attacks/deepfool.py:134
Functionpickle_data
Write data to pickled file. Arguments: data (Any): data to be written. filename (str): path to the pickled file. mode
core/utils/utils.py:110
Functionreplicate_input_withgrad
Clone the input tensor x and set requires_grad=True.
core/attacks/utils.py:20
Methodsave_model
Save model weights.
gowal21uncovering/utils/watrain.py:175
Methodset_bn_to_eval
Set all batch normalization layers to evaluation mode.
core/utils/train.py:292
← previousnext →101–200 of 206, ranked by callers