MCPcopy Create free account

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

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

↓ 1 callersFunctionload_images
(input_dir, batch_size)
defense/rs/datasets.py:94
↓ 1 callersFunctionload_labels
(file_name, targeted=False)
defense/rs/datasets.py:121
↓ 1 callersMethodload_labels
(self, file_name)
defense/diffpure/dataset.py:44
↓ 1 callersMethodload_labels
(self, file_name)
transferattack/utils.py:142
↓ 1 callersMethodload_labels
(self, file_name)
transferattack/model_related/ata_vit.py:158
↓ 1 callersMethodload_model
The model Loading stage, which should be overridden when surrogate model is customized (e.g., DSM, SETR, etc.) Prioritize the model i
transferattack/attack.py:40
↓ 1 callersMethodload_models
(seld, model_names)
transferattack/input_transformation/lpm.py:58
↓ 1 callersMethodload_object
(self, obj_file_name, device)
transferattack/input_transformation/odi/odi.py:490
↓ 1 callersFunctionload_pretrained_model
(cnn_model=[], vit_model=[])
transferattack/utils.py:29
↓ 1 callersFunctionload_state_dict
(checkpoint_path, use_ema=False)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/helpers.py:19
↓ 1 callersMethodlocal_fusion
(self, x, num_block=2, probabilities=0.5, omega=0.5)
transferattack/input_transformation/sid.py:128
↓ 1 callersMethodlocal_mix
(self, B1)
transferattack/input_transformation/idaa.py:110
↓ 1 callersFunctionlog_loss_dict
(diffusion, ts, losses)
defense/diffpure/guided_diffusion/train_util.py:303
↓ 1 callersMethodlog_step
(self)
defense/diffpure/guided_diffusion/train_util.py:236
↓ 1 callersMethodlogits_interaction
(self, outputs, leave_one_outputs, only_add_one_outputs, zero_outputs)
transferattack/advanced_objective/ir.py:14
↓ 1 callersFunctionlogkv
Log a value of some diagnostic Call this once for each diagnostic quantity, each iteration If called many times, last value will be used.
defense/diffpure/guided_diffusion/logger.py:220
↓ 1 callersMethodloss_function
Get the loss function
transferattack/attack.py:155
↓ 1 callersFunctionmain
()
main.py:30
↓ 1 callersFunctionmain
()
defense/check_output.py:28
↓ 1 callersFunctionmain
()
defense/at/main_fast.py:55
↓ 1 callersFunctionmain
()
defense/hgd/defense.py:57
↓ 1 callersFunctionmain
()
transferattack/model_related/qaa_utils/train.py:274
↓ 1 callersMethodmake_mask_embed
(self, shape, num_pixel, embed)
transferattack/model_related/ata_vit.py:324
↓ 1 callersFunctionmake_output_format
(format, ev_dir, log_suffix="")
defense/diffpure/guided_diffusion/logger.py:199
↓ 1 callersFunctionmaster_params_to_model_params
Copy the master parameter data back into the model parameters.
defense/diffpure/guided_diffusion/fp16_util.py:73
↓ 1 callersFunctionmaster_params_to_state_dict
( model, param_groups_and_shapes, master_params, use_fp16 )
defense/diffpure/guided_diffusion/fp16_util.py:103
↓ 1 callersMethodmaster_params_to_state_dict
(self, master_params)
defense/diffpure/guided_diffusion/fp16_util.py:234
↓ 1 callersFunctionmatrix_mul
(x)
transferattack/advanced_objective/yaila/yaila_utils.py:130
↓ 1 callersFunctionmodel_grads_to_master_grads
Copy the gradients from the model parameters into the master parameters from make_master_params().
defense/diffpure/guided_diffusion/fp16_util.py:60
↓ 1 callersMethodmodify_model
Modify the model with IAA - Replace ReLU with Softplus - Decrease the weight for certain residual modules
transferattack/model_related/iaa.py:48
↓ 1 callersMethodmove_log_distribute
(self, delta, k, **kwargs)
transferattack/gradient/liboost.py:65
↓ 1 callersFunctionmpi_weighted_mean
Copied from: https://github.com/openai/baselines/blob/ea25b9e8b234e6ee1bca43083f8f3cf974143998/baselines/common/mpi_util.py#L110 Perform a we
defense/diffpure/guided_diffusion/logger.py:420
↓ 1 callersMethodmulti_scale
(self, x, resize_ratio)
transferattack/input_transformation/sid.py:146
↓ 1 callersFunctionnatural_key
See http://www.codinghorror.com/blog/archives/001018.html
defense/at/dataset.py:11
↓ 1 callersFunctionnatural_key
See http://www.codinghorror.com/blog/archives/001018.html
defense/hgd/dataset.py:11
↓ 1 callersFunctionnoisy_grid
Make uniform grid points, and add noise except for edge points.
transferattack/input_transformation/decowa.py:177
↓ 1 callersMethodnorm_patchs
(self, GF, index, patch, scale, offset)
transferattack/model_related/att.py:242
↓ 1 callersFunctionnormalize_fn
Differentiable version of torchvision.functional.normalize
transferattack/model_related/qaa_utils/train.py:109
↓ 1 callersFunctionnormalize_fn
Differentiable version of torchvision.functional.normalize
transferattack/model_related/qaa_utils/utils.py:29
↓ 1 callersMethodode_fn
Create the drift and diffusion functions for the reverse SDE
defense/diffpure/runners/diffpure_ode.py:90
↓ 1 callersFunctionone_hot_emb
(trans_list)
transferattack/input_transformation/aitl.py:152
↓ 1 callersMethodoptimize
(self, opt: th.optim.Optimizer)
defense/diffpure/guided_diffusion/fp16_util.py:191
↓ 1 callersFunctionoptimize_fn
Optimizes with warmup and gradient clipping (disabled if negative).
defense/diffpure/score_sde/losses.py:41
↓ 1 callersMethodoptimize_parameter
(self, x, y, model, gammas, nsample)
transferattack/model_related/llta_networks/llta.py:180
↓ 1 callersMethodp_sample_loop_progressive
Generate samples from the model and yield intermediate samples from each timestep of diffusion. Arguments are the same as p_
defense/diffpure/guided_diffusion/gaussian_diffusion.py:495
↓ 1 callersFunctionparam_grad_or_zeros
(param)
defense/diffpure/guided_diffusion/fp16_util.py:149
↓ 1 callersFunctionparse_args
()
defense/at/main_fast.py:29
↓ 1 callersFunctionparse_args_and_config
()
defense/diffpure/diffpure.py:97
↓ 1 callersFunctionparse_config_file
(args)
defense/at/lib/utils.py:79
↓ 1 callersFunctionparse_resume_step_from_filename
Parse filenames of the form path/to/modelNNNNNN.pt, where NNNNNN is the checkpoint's number of steps.
defense/diffpure/guided_diffusion/train_util.py:266
↓ 1 callersMethodpredict
Monte Carlo algorithm for evaluating the prediction of g at x. With probability at least 1 - alpha, the class returned by this method will e
defense/rs/core.py:53
↓ 1 callersMethodpredict_transfer_score
(self, x, img, label, white_models, gray_models, batch_size=4)
transferattack/input_transformation/lpm.py:222
↓ 1 callersMethodprep_hook
(self, ori_img)
transferattack/advanced_objective/ilpd.py:44
↓ 1 callersMethodprepare
(self,idx)
transferattack/generation/aim.py:262
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:92
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:126
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:222
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:285
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:354
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:419
↓ 1 callersMethodpreprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:484
↓ 1 callersMethodprint_timing_stats
Print timing statistics
transferattack/gradient/foolmix.py:380
↓ 1 callersMethodprob
(self, x)
transferattack/model_related/llta_networks/models/utils.py:24
↓ 1 callersFunctionprofile_kv
(scopename)
defense/diffpure/guided_diffusion/logger.py:302
↓ 1 callersMethodproject_kern
(self, kern_size)
transferattack/gradient/pifgsm.py:46
↓ 1 callersMethodproject_noise
(self, x, stack_kern, padding_size)
transferattack/gradient/pifgsm.py:55
↓ 1 callersMethodprune
Prune the model parameters with the smallest 'p' weights Arguments: model (torch.nn.Module): the surrogate model to be p
transferattack/model_related/mup.py:87
↓ 1 callersMethodprune_from_mask
Inplace prune the module with mask, and save the original weights in module.weight_orig
transferattack/model_related/mup.py:114
↓ 1 callersMethodq_mean_variance
Get the distribution q(x_t | x_0). :param x_start: the [N x C x ...] tensor of noiseless inputs. :param t: the number of dif
defense/diffpure/guided_diffusion/gaussian_diffusion.py:179
↓ 1 callersFunctionrandom_crop_arr
(pil_image, image_size, min_crop_frac=0.8, max_crop_frac=1.0)
defense/diffpure/guided_diffusion/image_datasets.py:154
↓ 1 callersFunctionread_img
read image by cv2 or from lmdb return: Numpy float32, HWC, BGR, [0,1]
defense/nrp/utils.py:57
↓ 1 callersMethodrecover_step
(self, zero_grad=False)
transferattack/model_related/awt.py:176
↓ 1 callersFunctionregister_attention_control
(model, controller)
transferattack/generation/diffattack.py:428
↓ 1 callersMethodregister_hook
(self)
transferattack/advanced_objective/p2fa.py:74
↓ 1 callersFunctionregister_hook_for_densenet
register hook for densenet models (This code is copied from https://github.com/csdongxian/skip-connections-matter)
transferattack/model_related/sgm.py:87
↓ 1 callersFunctionregister_hook_for_resnet
register hook for resnet models (This code is copied from https://github.com/csdongxian/skip-connections-matter)
transferattack/model_related/sgm.py:67
↓ 1 callersMethodrelprop
(self, R, alpha)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/modules/layers_ours.py:101
↓ 1 callersMethodremove_hooks
(self)
transferattack/advanced_objective/ftm.py:326
↓ 1 callersMethodremove_hooks
(self)
transferattack/input_transformation/everywhere.py:204
↓ 1 callersMethodremove_module
(self, state_dict)
transferattack/model_related/ma.py:43
↓ 1 callersMethodrender
(self, img, device)
transferattack/input_transformation/odi/odi.py:340
↓ 1 callersMethodreplace_layers
Replace the old layer with the new layer in the model Inputs: model (nn.Module): the model to be modified ol
transferattack/model_related/iaa.py:83
↓ 1 callersMethodreplace_self_attention
(self, attn_base, att_replace)
transferattack/generation/diffattack.py:755
↓ 1 callersMethodrescale_grad
Rescale the gradient
transferattack/gradient/smifgrm.py:65
↓ 1 callersMethodreset
(self)
defense/at/lib/utils.py:16
↓ 1 callersMethodreset
(self)
transferattack/model_related/qaa_utils/train.py:168
↓ 1 callersFunctionreset_attention_control
(model)
transferattack/generation/diffattack.py:534
↓ 1 callersMethodreset_states
Reset all stored states to None
transferattack/model_related/ll2s.py:45
↓ 1 callersFunctionresnet101
r"""ResNet-101 model from `"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_ Args: pretrained (b
transferattack/model_related/qaa_utils/archs/apot/resnet.py:312
↓ 1 callersFunctionresnet152
r"""ResNet-152 model from `"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_ Args: pretrained (b
transferattack/model_related/qaa_utils/archs/apot/resnet.py:323
↓ 1 callersFunctionresnet18
r"""ResNet-18 model from `"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>'_ Args: pretrained (bo
transferattack/model_related/qaa_utils/archs/apot/resnet.py:279
↓ 1 callersFunctionresnet50_forward
(ila, model, x, mid_layer_index, tap)
transferattack/advanced_objective/yaila/yaila_utils.py:94
↓ 1 callersMethodresnet_forward_hook
Forward hook for residual modules Inputs: lamb (float): the weight for the residual modules
transferattack/model_related/iaa.py:100
↓ 1 callersMethodrestore
Restore the parameters stored with the `store` method. Useful to validate the model with EMA parameters without affecting the original op
defense/diffpure/score_sde/models/ema.py:84
↓ 1 callersFunctionrestore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_ode.py:43
↓ 1 callersFunctionrestore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_sde.py:42
↓ 1 callersFunctionrestore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_ldsde.py:42
↓ 1 callersMethodrestore_weight
Restore the original weights in model
transferattack/model_related/mup.py:121
↓ 1 callersFunctionrgb_to_hsv
(img)
transferattack/input_transformation/aitl.py:441
↓ 1 callersMethodrun_step
(self, batch, cond)
defense/diffpure/guided_diffusion/train_util.py:180
← previousnext →701–800 of 2,264, ranked by callers