MCPcopy Create free account

hub / github.com/Trustworthy-AI-Group/TransferAttack / functions

Functions2,264 in github.com/Trustworthy-AI-Group/TransferAttack

↓ 1 callersMethodsample
Importance-sample timesteps for a batch. :param batch_size: the number of timesteps. :param device: the torch device to save
defense/diffpure/guided_diffusion/resample.py:50
↓ 1 callersMethodsample_embedding
(self, n)
transferattack/input_transformation/stm.py:284
↓ 1 callersFunctionsample_for_interaction
(delta, sample_grid_num, grid_scale,
transferattack/advanced_objective/ir.py:54
↓ 1 callersFunctionsample_grids
(sample_grid_num=16, grid_scale=16, img_size=224, sample_ti
transferattack/advanced_objective/ir.py:37
↓ 1 callersMethodsample_random_example
Randomly sample an example x' in B_epsilon(x)
transferattack/gradient/gaa.py:108
↓ 1 callersMethodsave_attn
(self, attn)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/ViT_LRP.py:105
↓ 1 callersMethodsave_attn_cam
(self, cam)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/ViT_LRP.py:108
↓ 1 callersFunctionsave_img
(img, img_path, mode='RGB')
defense/nrp/utils.py:102
↓ 1 callersMethodsave_outputs_hook
(self, layer_idx)
transferattack/advanced_objective/cfm.py:224
↓ 1 callersMethodsave_outputs_hook
(self, layer_idx)
transferattack/advanced_objective/ftm.py:211
↓ 1 callersMethodsave_outputs_hook
(self, layer_idx)
transferattack/input_transformation/everywhere.py:112
↓ 1 callersMethodsave_params
(self)
transferattack/model_related/awt.py:170
↓ 1 callersMethodsave_v
(self, v)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/ViT_LRP.py:117
↓ 1 callersMethodsave_v_cam
(self, cam)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/ViT_LRP.py:120
↓ 1 callersMethodscore_transferability
(self, X_adv, label, gray_models)
transferattack/input_transformation/lpm.py:168
↓ 1 callersMethodsecond_step
(self, zero_grad=False)
transferattack/model_related/awt.py:134
↓ 1 callersFunctionselect_op
Select operations based on learned probabilities
transferattack/model_related/ll2s.py:78
↓ 1 callersFunctionselect_op
(op_params, num_ops)
transferattack/input_transformation/l2t.py:16
↓ 1 callersMethodselect_transform_apply
(self, x, **kwargs)
transferattack/gradient/mumodig.py:200
↓ 1 callersMethodset_adv_gen
(self)
transferattack/generation/aim.py:24
↓ 1 callersMethodset_comm
(self, comm)
defense/diffpure/guided_diffusion/logger.py:393
↓ 1 callersFunctionset_layer
(model, name, layer)
transferattack/model_related/dhf_networks/utils.py:61
↓ 1 callersMethodset_level
(self, level)
defense/diffpure/guided_diffusion/logger.py:390
↓ 1 callersMethodset_mode
(self, mode: str)
transferattack/generation/aim.py:49
↓ 1 callersMethodset_paras
(self, batchsize, masknum, selected_region)
transferattack/input_transformation/everywhere.py:199
↓ 1 callersMethodset_rest_tokens
Store REST tokens for query, key, and value
transferattack/model_related/ll2s.py:52
↓ 1 callersMethodsetup_params
Setup hyperparameters based on model type
transferattack/model_related/ll2s.py:62
↓ 1 callersMethodsingle_attn
(self, x)
transferattack/model_related/setr_networks/token_performer.py:45
↓ 1 callersFunctionspace_timesteps
Create a list of timesteps to use from an original diffusion process, given the number of timesteps we want to take from equally-sized portio
defense/diffpure/guided_diffusion/respace.py:15
↓ 1 callersMethodspatial_attention_map
(self, feat, label)
transferattack/ensemble/rfcoa/rfcoa.py:82
↓ 1 callersFunctionsr_create_model
( large_size, small_size, num_channels, num_res_blocks, learn_sigma, class_cond, u
defense/diffpure/guided_diffusion/script_util.py:342
↓ 1 callersMethodssign
(self, noise)
transferattack/gradient/ifgssm.py:38
↓ 1 callersMethodstart_feature_record
(self)
transferattack/advanced_objective/cfm.py:291
↓ 1 callersMethodstart_feature_record
(self)
transferattack/advanced_objective/ftm.py:320
↓ 1 callersMethodstart_feature_record
(self)
transferattack/input_transformation/everywhere.py:193
↓ 1 callersFunctionstate_dict_to_master_params
(model, state_dict, use_fp16)
defense/diffpure/guided_diffusion/fp16_util.py:124
↓ 1 callersMethodstate_dict_to_master_params
(self, state_dict)
defense/diffpure/guided_diffusion/fp16_util.py:239
↓ 1 callersMethodstore
Save the current parameters for restoring later. Args: parameters: Iterable of `torch.nn.Parameter`; the parameters to be temp
defense/diffpure/score_sde/models/ema.py:74
↓ 1 callersFunctionswin_small_patch4_window7_224
Swin-S @ 224x224, trained ImageNet-1k
transferattack/model_related/setr_networks/swin_transformer.py:613
↓ 1 callersFunctiontensor2img
Converts a torch Tensor into an image Numpy array Input: 4D(B,(3/1),H,W), 3D(C,H,W), or 2D(H,W), any range, RGB channel order Output: 3D(
defense/nrp/utils.py:75
↓ 1 callersMethodtheoretical_cdf
(self,dx, m)
transferattack/gradient/liboost.py:48
↓ 1 callersMethodtotal_variation
(self, tensor)
transferattack/ensemble/rfcoa/rfcoa.py:55
↓ 1 callersFunctiontrace_prob
Calculate the probability trace for selected operations
transferattack/model_related/ll2s.py:85
↓ 1 callersFunctiontrace_prob
(op_params, op_ids)
transferattack/input_transformation/l2t.py:21
↓ 1 callersFunctiontrain
(train_loader, model, criterion, optimizer, epoch, args, device, writer=None)
transferattack/model_related/qaa_utils/train.py:227
↓ 1 callersMethodtrain_SP
(self, input_dir = './data', checkpoint_dir = './checkpoints', batch_size=1, is_training=True, **kwargs)
transferattack/input_transformation/pam.py:137
↓ 1 callersMethodtransform
(self, thetas, data)
transferattack/gradient/anda.py:151
↓ 1 callersMethodtransform
Admix the input for Admix Attack
transferattack/gradient/emifgsm.py:53
↓ 1 callersMethodtransform
(self, data, **kwargs)
transferattack/advanced_objective/trap.py:86
↓ 1 callersMethodtransform
(self, data, **kwargs)
transferattack/advanced_objective/fft.py:101
↓ 1 callersMethodtransform
Random transform the input images
transferattack/advanced_objective/logit_margin.py:95
↓ 1 callersMethodtransform
Random transform the input images
transferattack/advanced_objective/logit.py:66
↓ 1 callersMethodtransform
(self, x, **kwargs)
transferattack/input_transformation/usmm.py:45
↓ 1 callersMethodtransform
Use an arbitrary style transfer network to transform the images into different domains Mix up the generated images added by random no
transferattack/input_transformation/stm.py:53
↓ 1 callersMethodtransform
(self, data, transform_list, **kwargs)
transferattack/input_transformation/aitl.py:99
↓ 1 callersMethodtransform
Random transform the input images
transferattack/input_transformation/dem.py:50
↓ 1 callersMethodtransform
Use DCT to transform the input image from spatial domain to frequency domain, Use IDCT to transform the input image from frequency do
transferattack/input_transformation/ssm.py:41
↓ 1 callersMethodtransform
(self, x, **kwargs)
transferattack/input_transformation/pam.py:70
↓ 1 callersMethodtransform
Use DCT to transform the input image from spatial domain to frequency domain, Use IDCT to transform the input image from frequency do
transferattack/input_transformation/ssm_with_tricks.py:50
↓ 1 callersMethodtransform
Use DCT to transform the input image from spatial domain to frequency domain, Use IDCT to transform the input image from frequency do
transferattack/input_transformation/ssm_with_tricks.py:263
↓ 1 callersMethodtransform
(self, x, **kwargs)
transferattack/input_transformation/l2t.py:437
↓ 1 callersMethodtransform
(self, data, renderer,**kwargs)
transferattack/input_transformation/odi/odi.py:80
↓ 1 callersFunctiontransform_index
(data, trans_index, **kwargs)
transferattack/input_transformation/aitl.py:533
↓ 1 callersMethodupdate_delta
(self, delta, data, grad, alpha, **kwargs)
transferattack/attack.py:145
↓ 1 callersMethodupdate_delta
Update adversarial perturbation
transferattack/gradient/foolmix.py:368
↓ 1 callersMethodupdate_delta
(self, delta, data, grad, alpha, **kwargs)
transferattack/gradient/aifgtm.py:53
↓ 1 callersMethodupdate_delta
(self, delta, data, grad, alpha, projection, **kwargs)
transferattack/gradient/pifgsm.py:60
↓ 1 callersMethodupdate_delta
(self, delta, data, grad, alpha, **kwargs)
transferattack/gradient/vaifgsm.py:68
↓ 1 callersMethodupdate_delta
(self, delta, data, grad, alpha, **kwargs)
transferattack/gradient/adamsi_fgm.py:52
↓ 1 callersFunctionupdate_ema
Update target parameters to be closer to those of source parameters using an exponential moving average. :param target_params: the targe
defense/diffpure/guided_diffusion/nn.py:63
↓ 1 callersMethodupdate_fn
(self, x, t)
defense/diffpure/score_sde/sampling.py:195
↓ 1 callersMethodupdate_fn
(self, x, t)
defense/diffpure/score_sde/sampling.py:249
↓ 1 callersMethodupdate_fn
(self, x, t)
defense/diffpure/score_sde/sampling.py:329
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:56
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:121
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:186
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:251
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:318
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:383
↓ 1 callersMethodupdate_mixup_feature
(self, data: Tensor)
transferattack/model_related/dhf.py:448
↓ 1 callersMethodupdate_n_rap
(self, delta, data, grad, alpha, **kwargs)
transferattack/gradient/rap.py:81
↓ 1 callersMethodupdate_noise_map
(self, x, label)
transferattack/input_transformation/decowa.py:56
↓ 1 callersMethodupdate_robust_tokens
Update robust tokens using gradient information
transferattack/model_related/ll2s.py:506
↓ 1 callersMethodupdate_with_all_losses
Update the reweighting using losses from a model. Sub-classes should override this method to update the reweighting using lo
defense/diffpure/guided_diffusion/resample.py:115
↓ 1 callersMethodupdate_with_local_losses
Update the reweighting using losses from a model. Call this method from each rank with a batch of timesteps and the correspo
defense/diffpure/guided_diffusion/resample.py:79
↓ 1 callersFunctionupfirdn2d_native
( input, kernel, up_x, up_y, down_x, down_y, pad_x0, pad_x1, pad_y0, pad_y1 )
defense/diffpure/score_sde/op/upfirdn2d.py:167
↓ 1 callersFunctionupsample_conv_2d
Fused `upsample_2d()` followed by `tf.nn.conv2d()`. Padding is performed only once at the beginning, not between the operations. The f
defense/diffpure/score_sde/models/up_or_down_sampling.py:80
↓ 1 callersFunctionvariance_scaling
Ported from JAX.
defense/diffpure/score_sde/models/layers.py:54
↓ 1 callersMethodvesde_update_fn
(self, x, t)
defense/diffpure/score_sde/sampling.py:213
↓ 1 callersMethodvpsde_fn
(self, t, x)
defense/diffpure/runners/diffpure_ode.py:84
↓ 1 callersMethodvpsde_fn
(self, t, x)
defense/diffpure/runners/diffpure_sde.py:86
↓ 1 callersMethodvpsde_update_fn
(self, x, t)
defense/diffpure/score_sde/sampling.py:225
↓ 1 callersMethodweights
Get a numpy array of weights, one per diffusion step. The weights needn't be normalized, but must be positive.
defense/diffpure/guided_diffusion/resample.py:43
↓ 1 callersFunctionwindow_reverse
Args: windows: (num_windows*B, window_size, window_size, C) window_size (int): Window size H (int): Height of image
transferattack/model_related/setr_networks/swin_transformer.py:103
↓ 1 callersMethodwrap_attention
Apply attack operations to attention and FFN modules
transferattack/model_related/ll2s.py:326
↓ 1 callersFunctionwrap_model
Add normalization layer with mean and std in training configuration
defense/diffpure/utils.py:126
↓ 1 callersFunctionwrap_vit_forward_features
Replace the forward_features method of VisionTransformer with our custom version This enables injection of robust tokens during forward pass
transferattack/model_related/ll2s.py:375
↓ 1 callersMethodwritekvs
(self, kvs)
defense/diffpure/guided_diffusion/logger.py:35
↓ 1 callersMethodwriteseq
(self, seq)
defense/diffpure/guided_diffusion/logger.py:40
↓ 1 callersMethodycbcr_to_rgb
(self, x: torch.Tensor)
transferattack/generation/fap.py:308
← previousnext →801–900 of 2,264, ranked by callers