MCPcopy Create free account

hub / github.com/JonasGeiping/data-poisoning / functions

Functions297 in github.com/JonasGeiping/data-poisoning

↓ 30 callersFunction_maybe
Retrieve stat if it was recorded. Return empty string otherwise.
forest/utils.py:135
↓ 18 callersMethodstep
Step through a model epoch. Optionally: minimize target loss.
forest/victims/victim_single.py:110
↓ 16 callersFunctioncriterion
(outputs, labels)
forest/victims/training.py:96
↓ 12 callersMethod_set_locations
Fix locations where we’ll put the patches.
forest/victims/batched_attacks.py:332
↓ 12 callersMethodget_target
Return only the target and its id. Args: index (int): Index Returns: tuple: (target, idx) where target is cl
forest/data/datasets.py:276
↓ 12 callersMethodtrain
Clean (pre)-training of the chosen model, no poisoning involved.
forest/victims/victim_base.py:98
↓ 12 callersMethodvalidate
Check poison on a new initialization(s), depending on the scenario.
forest/victims/victim_base.py:138
↓ 10 callersMethod_patch
(self, inputs, labels, patches, x_locations, y_locations)
forest/victims/batched_attacks.py:445
↓ 9 callersFunctionbypass_last_layer
Hacky way of separating features and classification head for many models. Patch this function if problems appear.
forest/utils.py:64
↓ 8 callersFunction_save_image
(sample, index, filename, train=True)
forest/gcloud.py:43
↓ 8 callersMethodeval
Switch everything into evaluation mode.
forest/victims/victim_base.py:160
↓ 8 callersMethodinitialize_poison
Initialize according to args.init. Propagate initialization in distributed settings.
forest/data/kettle_base.py:206
↓ 8 callersFunctionset_random_seed
233 = 144 + 89 is my favorite number.
forest/utils.py:231
↓ 7 callersMethod_create_patch
(self, patch_shape)
forest/victims/batched_attacks.py:341
↓ 7 callersMethod_initialize_model
(self, model_name, pretrain=False)
forest/victims/victim_base.py:172
↓ 7 callersMethod_random_derangement
(self, n)
forest/victims/batched_attacks.py:411
↓ 7 callersFunctionlabel_name
(label)
forest/gcloud.py:49
↓ 7 callersFunctionresnet_picker
Pick an appropriate resnet architecture for MNIST/CIFAR.
forest/victims/models.py:189
↓ 6 callersMethod_init_perturbation
(self, input_shape)
forest/victims/batched_attacks.py:101
↓ 6 callersMethodreinitialize_last_layer
(self, seed=None)
forest/victims/victim_base.py:83
↓ 5 callersMethod_step
Single epoch. Can't say I'm a fan of this interface, but ...
forest/victims/victim_base.py:187
↓ 5 callersMethodattack
Attack within given constraints with task as in _objective.
forest/victims/batched_attacks.py:266
↓ 5 callersFunctionbypass_last_layer
Hacky way of separating features and classification head for many models. Patch this function if problems appear.
plotting/featurespace_visualizations.py:154
↓ 5 callersMethodcorrected_loss
Compute the corrected loss under consideration of the mixing.
forest/data/mixing_data_augmentations.py:38
↓ 5 callersMethodgradient
Compute the gradient of criterion(model) w.r.t to given data.
forest/victims/victim_base.py:53
↓ 4 callersFunction_command
(idx, name, ensemble, model, add_options)
scripts/benchmark_gen.py:13
↓ 4 callersMethod_init_optimizer
(self, delta_iterable)
forest/victims/batched_attacks.py:128
↓ 4 callersMethod_iterate
Validate a given poison by training the model and checking target accuracy.
forest/victims/victim_base.py:164
↓ 4 callersMethod_passenger_loss
Compute the blind passenger loss term.
forest/witchcoven/witch_matching.py:39
↓ 4 callersMethodexport_poison
Export poisons in either packed mode (just ids and raw data) or in full export mode, exporting all images. In full export mode, export data i
forest/data/kettle_base.py:261
↓ 4 callersFunctionget_defense
(args)
forest/filtering_defenses.py:5
↓ 4 callersFunctionget_model
Retrieve an appropriate architecture.
forest/victims/models.py:13
↓ 4 callersFunctionget_optimizers
Construct optimizer as given in defs.
forest/victims/training.py:284
↓ 4 callersMethodload_feature_representation
(self)
forest/victims/victim_base.py:92
↓ 4 callersMethodlookup_poison_indices
Given a list of ids, retrieve the appropriate poison perturbation from poison delta and apply it.
forest/data/kettle_base.py:248
↓ 4 callersMethodreset_trainset
(self, new_ids)
forest/data/kettle_base.py:241
↓ 4 callersFunctionsoftmax
Compute the softmax of each element along an axis of X. Parameters ---------- X: ND-Array. Probably should be floats. theta (opt
plotting/featurespace_visualizations.py:249
↓ 4 callersFunctiontraining_strategy
Parse training strategy.
forest/hyperparameters.py:7
↓ 3 callersMethod__init__
Implement differentiable mixup, mixing nway-many examples with the given mixing factor alpha.
forest/data/mixing_data_augmentations.py:17
↓ 3 callersFunction_get_poisoned_features
(kettle, victim, poison_delta, dryrun=False)
forest/filtering_defenses.py:14
↓ 3 callersMethod_initialize_brew
Implement common initialization operations for brewing.
forest/witchcoven/witch_base.py:83
↓ 3 callersMethod_objective
Evaluate Gradient Alignment and descend.
forest/victims/batched_attacks.py:291
↓ 3 callersMethod_pgd_step
PGD step.
forest/witchcoven/witch_base.py:316
↓ 3 callersFunction_split_data
Split data for meta update steps and other defenses.
forest/victims/training.py:242
↓ 3 callersMethodbrew
Recipe interface.
forest/witchcoven/witch_base.py:40
↓ 3 callersMethodcompute
Compute function on all models. Function has arguments: model, ...
forest/victims/victim_base.py:58
↓ 3 callersFunctionconstruct_attack
Interface for this submodule.
forest/victims/batched_attacks.py:10
↓ 3 callersFunctionconstruct_datasets
Construct datasets with appropriate transforms.
forest/data/datasets.py:20
↓ 3 callersFunctionconvnet
Define a simple ConvNet. This architecture only really works for CIFAR10.
forest/victims/models.py:96
↓ 3 callersMethoddistributed_control
Control distributed poison brewing, no-op in single network training.
forest/victims/victim_base.py:65
↓ 3 callersMethodget_num_workers
Check devices and set an appropriate number of workers.
forest/data/kettle_base.py:132
↓ 3 callersMethodinitialize
(self, seed=None)
forest/victims/victim_base.py:80
↓ 3 callersMethodpatch_targets
Backdoor trigger attacks need to patch kettle.targets.
forest/witchcoven/witch_base.py:333
↓ 3 callersMethodretrain
Check poison on the initialization it was brewed on.
forest/victims/victim_base.py:122
↓ 3 callersMethodsync_gradients
Sync gradients of given variable. No-op for single network training.
forest/victims/victim_base.py:70
↓ 2 callersMethod__init__
(self, dataset, delta)
forest/data/datasets.py:147
↓ 2 callersMethod_patch
(self, inputs, labels, patches, x_locations, y_locations)
forest/victims/batched_attacks.py:498
↓ 2 callersMethod_patch
(self, inputs, labels, patches, x_locations, y_locations)
forest/victims/batched_attacks.py:538
↓ 2 callersMethod_patch
(self, inputs, labels, patches, x_locations, y_locations)
forest/victims/batched_attacks.py:583
↓ 2 callersMethod_rand_bbox
(size, lmb)
forest/data/mixing_data_augmentations.py:73
↓ 2 callersMethod_set_locations
.Fix locations where we’ll put the patches.
forest/victims/batched_attacks.py:391
↓ 2 callersFunctionalexnet_metapoison
AlexNet variant as used in MetaPoison.
forest/victims/models.py:117
↓ 2 callersFunctionautoml_interface
(setup, kettle, poison_delta)
forest/gcloud.py:437
↓ 2 callersFunctionaverage_dicts
Average entries in a list of dictionaries.
forest/utils.py:35
↓ 2 callersFunctionf
(x)
forest/witchcoven/witch_convex_polytope.py:80
↓ 2 callersFunctionget_features
(model, data, poison_delta)
plotting/brew_and_visualize_poison.py:30
↓ 2 callersFunctionlinear_model
Define the simplest linear model.
forest/victims/models.py:82
↓ 2 callersMethodprepare_diff_data_augmentations
Load differentiable data augmentations separately from usual torchvision.transforms.
forest/data/kettle_base.py:149
↓ 2 callersMethodprint_status
(self)
forest/data/kettle_base.py:105
↓ 2 callersFunctionupload_to_automl
(dataset_id, project_id, csvpath, wait_for_response=True)
forest/gcloud.py:231
↓ 1 callersMethod__init__
Initialize as usual. Layers and strides are scriptable.
forest/victims/models.py:247
↓ 1 callersMethod__init__
( self, in_planes, out_planes, expansion, stride, train_dp,
forest/victims/mobilenet.py:23
↓ 1 callersMethod_apply_patch
(self, temp_targets)
forest/victims/batched_attacks.py:304
↓ 1 callersMethod_batched_step
Take a step toward minmizing the current target loss.
forest/witchcoven/witch_htbd.py:105
↓ 1 callersMethod_batched_step
Take a step toward minmizing the current target loss.
forest/witchcoven/witch_base.py:210
↓ 1 callersMethod_brew
Run generalized iterative routine.
forest/witchcoven/witch_base.py:62
↓ 1 callersMethod_choose_poisons_benchmark
(self, setup_dict)
forest/data/kettle_benchmark_experiment.py:37
↓ 1 callersMethod_choose_poisons_deterministic
(self, target_id)
forest/data/kettle_det_experiment.py:44
↓ 1 callersMethod_choose_poisons_randomly
Subconstruct poison and targets. The behavior is different for poisons and targets. We still consider poisons to be part of the original trai
forest/data/kettle_random_experiment.py:110
↓ 1 callersMethod_create_patch
(self, patch_shape)
forest/victims/batched_attacks.py:400
↓ 1 callersMethod_create_patch
(self, inputs, patch_shapes)
forest/victims/batched_attacks.py:570
↓ 1 callersMethod_create_patch
(self, patch_shape)
forest/witchcoven/witch_patch.py:40
↓ 1 callersMethod_create_patch
(self, patch_shape)
forest/witchcoven/witch_htbd.py:201
↓ 1 callersMethod_define_objective
Implement the closure here.
forest/witchcoven/witch_htbd.py:179
↓ 1 callersMethod_define_objective
Implement the closure here.
forest/witchcoven/witch_base.py:309
↓ 1 callersMethod_define_objective
Implement the closure here.
forest/witchcoven/witch_matching.py:275
↓ 1 callersMethod_get_mask
(self, inputs)
forest/victims/batched_attacks.py:712
↓ 1 callersMethod_get_temp_targets
(self, kettle)
forest/witchcoven/witch_htbd.py:237
↓ 1 callersFunction_gradient_matching
Compute the blind passenger loss term.
forest/utils.py:48
↓ 1 callersMethod_hide_gradient
Enforce batch-wise privacy if necessary. This is attacking a defense discussed in Hong et al., 2020 We enforce privacy on mini batche
forest/witchcoven/witch_matching.py:126
↓ 1 callersMethod_index_mapping
(self, inputs, temp_targets)
forest/victims/batched_attacks.py:317
↓ 1 callersMethod_index_mapping
(self, model, inputs, temp_targets)
forest/witchcoven/witch_htbd.py:246
↓ 1 callersMethod_initialize_brew
(self, victim, kettle)
forest/witchcoven/witch_matching.py:310
↓ 1 callersFunction_label_to_onehot
(target, num_classes=100)
forest/utils.py:83
↓ 1 callersFunction_least_squares_simplex
Implement the inner loop of Algorithm 1.
forest/witchcoven/witch_convex_polytope.py:66
↓ 1 callersMethod_load_metapoison_files
Load a metapoison package. xtrain: CIFAR-10 training set images with a subset of them poisoned/perturbed ytrain: CIFAR-10 training se
forest/data/kettle_external.py:57
↓ 1 callersMethod_make_layers
(self, in_planes, train_dp=0, test_dp=0, droplayer=0, bdp=0)
forest/victims/mobilenet.py:140
↓ 1 callersMethod_make_layers
(self, cfg, in_channels)
forest/victims/vgg.py:56
↓ 1 callersMethod_objective
(self, inputs, labels, temp_targets, temp_fake_labels)
forest/victims/batched_attacks.py:98
↓ 1 callersMethod_parse_threats_randomly
Parse the different threat models. The threat-models are [In order of expected difficulty]: single-class replicates the threat model
forest/data/kettle_random_experiment.py:55
next →1–100 of 297, ranked by callers