Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Trustworthy-AI-Group/TransferAttack
/ functions
Functions
2,264 in github.com/Trustworthy-AI-Group/TransferAttack
⨍
Functions
2,264
◇
Types & classes
551
↓ 1 callers
Function
load_images
(input_dir, batch_size)
defense/rs/datasets.py:94
↓ 1 callers
Function
load_labels
(file_name, targeted=False)
defense/rs/datasets.py:121
↓ 1 callers
Method
load_labels
(self, file_name)
defense/diffpure/dataset.py:44
↓ 1 callers
Method
load_labels
(self, file_name)
transferattack/utils.py:142
↓ 1 callers
Method
load_labels
(self, file_name)
transferattack/model_related/ata_vit.py:158
↓ 1 callers
Method
load_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 callers
Method
load_models
(seld, model_names)
transferattack/input_transformation/lpm.py:58
↓ 1 callers
Method
load_object
(self, obj_file_name, device)
transferattack/input_transformation/odi/odi.py:490
↓ 1 callers
Function
load_pretrained_model
(cnn_model=[], vit_model=[])
transferattack/utils.py:29
↓ 1 callers
Function
load_state_dict
(checkpoint_path, use_ema=False)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/baselines/ViT/helpers.py:19
↓ 1 callers
Method
local_fusion
(self, x, num_block=2, probabilities=0.5, omega=0.5)
transferattack/input_transformation/sid.py:128
↓ 1 callers
Method
local_mix
(self, B1)
transferattack/input_transformation/idaa.py:110
↓ 1 callers
Function
log_loss_dict
(diffusion, ts, losses)
defense/diffpure/guided_diffusion/train_util.py:303
↓ 1 callers
Method
log_step
(self)
defense/diffpure/guided_diffusion/train_util.py:236
↓ 1 callers
Method
logits_interaction
(self, outputs, leave_one_outputs, only_add_one_outputs, zero_outputs)
transferattack/advanced_objective/ir.py:14
↓ 1 callers
Function
logkv
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 callers
Method
loss_function
Get the loss function
transferattack/attack.py:155
↓ 1 callers
Function
main
()
main.py:30
↓ 1 callers
Function
main
()
defense/check_output.py:28
↓ 1 callers
Function
main
()
defense/at/main_fast.py:55
↓ 1 callers
Function
main
()
defense/hgd/defense.py:57
↓ 1 callers
Function
main
()
transferattack/model_related/qaa_utils/train.py:274
↓ 1 callers
Method
make_mask_embed
(self, shape, num_pixel, embed)
transferattack/model_related/ata_vit.py:324
↓ 1 callers
Function
make_output_format
(format, ev_dir, log_suffix="")
defense/diffpure/guided_diffusion/logger.py:199
↓ 1 callers
Function
master_params_to_model_params
Copy the master parameter data back into the model parameters.
defense/diffpure/guided_diffusion/fp16_util.py:73
↓ 1 callers
Function
master_params_to_state_dict
( model, param_groups_and_shapes, master_params, use_fp16 )
defense/diffpure/guided_diffusion/fp16_util.py:103
↓ 1 callers
Method
master_params_to_state_dict
(self, master_params)
defense/diffpure/guided_diffusion/fp16_util.py:234
↓ 1 callers
Function
matrix_mul
(x)
transferattack/advanced_objective/yaila/yaila_utils.py:130
↓ 1 callers
Function
model_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 callers
Method
modify_model
Modify the model with IAA - Replace ReLU with Softplus - Decrease the weight for certain residual modules
transferattack/model_related/iaa.py:48
↓ 1 callers
Method
move_log_distribute
(self, delta, k, **kwargs)
transferattack/gradient/liboost.py:65
↓ 1 callers
Function
mpi_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 callers
Method
multi_scale
(self, x, resize_ratio)
transferattack/input_transformation/sid.py:146
↓ 1 callers
Function
natural_key
See http://www.codinghorror.com/blog/archives/001018.html
defense/at/dataset.py:11
↓ 1 callers
Function
natural_key
See http://www.codinghorror.com/blog/archives/001018.html
defense/hgd/dataset.py:11
↓ 1 callers
Function
noisy_grid
Make uniform grid points, and add noise except for edge points.
transferattack/input_transformation/decowa.py:177
↓ 1 callers
Method
norm_patchs
(self, GF, index, patch, scale, offset)
transferattack/model_related/att.py:242
↓ 1 callers
Function
normalize_fn
Differentiable version of torchvision.functional.normalize
transferattack/model_related/qaa_utils/train.py:109
↓ 1 callers
Function
normalize_fn
Differentiable version of torchvision.functional.normalize
transferattack/model_related/qaa_utils/utils.py:29
↓ 1 callers
Method
ode_fn
Create the drift and diffusion functions for the reverse SDE
defense/diffpure/runners/diffpure_ode.py:90
↓ 1 callers
Function
one_hot_emb
(trans_list)
transferattack/input_transformation/aitl.py:152
↓ 1 callers
Method
optimize
(self, opt: th.optim.Optimizer)
defense/diffpure/guided_diffusion/fp16_util.py:191
↓ 1 callers
Function
optimize_fn
Optimizes with warmup and gradient clipping (disabled if negative).
defense/diffpure/score_sde/losses.py:41
↓ 1 callers
Method
optimize_parameter
(self, x, y, model, gammas, nsample)
transferattack/model_related/llta_networks/llta.py:180
↓ 1 callers
Method
p_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 callers
Function
param_grad_or_zeros
(param)
defense/diffpure/guided_diffusion/fp16_util.py:149
↓ 1 callers
Function
parse_args
()
defense/at/main_fast.py:29
↓ 1 callers
Function
parse_args_and_config
()
defense/diffpure/diffpure.py:97
↓ 1 callers
Function
parse_config_file
(args)
defense/at/lib/utils.py:79
↓ 1 callers
Function
parse_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 callers
Method
predict
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 callers
Method
predict_transfer_score
(self, x, img, label, white_models, gray_models, batch_size=4)
transferattack/input_transformation/lpm.py:222
↓ 1 callers
Method
prep_hook
(self, ori_img)
transferattack/advanced_objective/ilpd.py:44
↓ 1 callers
Method
prepare
(self,idx)
transferattack/generation/aim.py:262
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:92
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:126
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:222
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:285
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:354
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:419
↓ 1 callers
Method
preprocess
(self, *args, **kwargs)
transferattack/model_related/dhf.py:484
↓ 1 callers
Method
print_timing_stats
Print timing statistics
transferattack/gradient/foolmix.py:380
↓ 1 callers
Method
prob
(self, x)
transferattack/model_related/llta_networks/models/utils.py:24
↓ 1 callers
Function
profile_kv
(scopename)
defense/diffpure/guided_diffusion/logger.py:302
↓ 1 callers
Method
project_kern
(self, kern_size)
transferattack/gradient/pifgsm.py:46
↓ 1 callers
Method
project_noise
(self, x, stack_kern, padding_size)
transferattack/gradient/pifgsm.py:55
↓ 1 callers
Method
prune
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 callers
Method
prune_from_mask
Inplace prune the module with mask, and save the original weights in module.weight_orig
transferattack/model_related/mup.py:114
↓ 1 callers
Method
q_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 callers
Function
random_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 callers
Function
read_img
read image by cv2 or from lmdb return: Numpy float32, HWC, BGR, [0,1]
defense/nrp/utils.py:57
↓ 1 callers
Method
recover_step
(self, zero_grad=False)
transferattack/model_related/awt.py:176
↓ 1 callers
Function
register_attention_control
(model, controller)
transferattack/generation/diffattack.py:428
↓ 1 callers
Method
register_hook
(self)
transferattack/advanced_objective/p2fa.py:74
↓ 1 callers
Function
register_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 callers
Function
register_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 callers
Method
relprop
(self, R, alpha)
transferattack/model_related/ata_vit_utils/Transformer_Explainability/modules/layers_ours.py:101
↓ 1 callers
Method
remove_hooks
(self)
transferattack/advanced_objective/ftm.py:326
↓ 1 callers
Method
remove_hooks
(self)
transferattack/input_transformation/everywhere.py:204
↓ 1 callers
Method
remove_module
(self, state_dict)
transferattack/model_related/ma.py:43
↓ 1 callers
Method
render
(self, img, device)
transferattack/input_transformation/odi/odi.py:340
↓ 1 callers
Method
replace_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 callers
Method
replace_self_attention
(self, attn_base, att_replace)
transferattack/generation/diffattack.py:755
↓ 1 callers
Method
rescale_grad
Rescale the gradient
transferattack/gradient/smifgrm.py:65
↓ 1 callers
Method
reset
(self)
defense/at/lib/utils.py:16
↓ 1 callers
Method
reset
(self)
transferattack/model_related/qaa_utils/train.py:168
↓ 1 callers
Function
reset_attention_control
(model)
transferattack/generation/diffattack.py:534
↓ 1 callers
Method
reset_states
Reset all stored states to None
transferattack/model_related/ll2s.py:45
↓ 1 callers
Function
resnet101
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 callers
Function
resnet152
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 callers
Function
resnet18
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 callers
Function
resnet50_forward
(ila, model, x, mid_layer_index, tap)
transferattack/advanced_objective/yaila/yaila_utils.py:94
↓ 1 callers
Method
resnet_forward_hook
Forward hook for residual modules Inputs: lamb (float): the weight for the residual modules
transferattack/model_related/iaa.py:100
↓ 1 callers
Method
restore
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 callers
Function
restore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_ode.py:43
↓ 1 callers
Function
restore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_sde.py:42
↓ 1 callers
Function
restore_checkpoint
(ckpt_dir, state, device)
defense/diffpure/runners/diffpure_ldsde.py:42
↓ 1 callers
Method
restore_weight
Restore the original weights in model
transferattack/model_related/mup.py:121
↓ 1 callers
Function
rgb_to_hsv
(img)
transferattack/input_transformation/aitl.py:441
↓ 1 callers
Method
run_step
(self, batch, cond)
defense/diffpure/guided_diffusion/train_util.py:180
← previous
next →
701–800 of 2,264, ranked by callers