MCPcopy Create free account

hub / github.com/NVlabs/DiffPure / functions

Functions875 in github.com/NVlabs/DiffPure

↓ 2 callersMethod_compute_norms
(self, grad_scale=1.0)
guided_diffusion/fp16_util.py:224
↓ 2 callersMethod_inner_loss
Computes the combined loss for a particular transformation
stadv_eot/recoloradv/mister_ed/loss_functions.py:478
↓ 2 callersMethod_predict_xstart_from_eps
(self, x_t, t, eps)
guided_diffusion/gaussian_diffusion.py:336
↓ 2 callersMethod_prepare_data
Takes in numpy examples and labels and tensor-ifies and cuda's them if necessary
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:234
↓ 2 callersFunction_register
(cls)
score_sde/sampling.py:37
↓ 2 callersFunction_ssim
(img1, img2, window, window_size, channel, size_average = True)
stadv_eot/recoloradv/mister_ed/utils/pytorch_ssim.py:33
↓ 2 callersMethod_truncate
(self, s)
guided_diffusion/logger.py:88
↓ 2 callersMethodadd_series
Adds the name of a 'data series' where each data series is a list of data-entries, where each data-entry is of the form ((epo
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:586
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
guided_diffusion/losses.py:50
↓ 2 callersMethodattach_attr
Special method to set an attribute if it doesn't exist in this object yet. throws error if this attr already exists ARGS:
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:198
↓ 2 callersMethodattack
Builds PGD examples for the given examples with l_inf bound and given step size. Is almost identical to the BIM attack, except
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:248
↓ 2 callersMethodattack_all
(self, X, y, batch_size)
bpda_eot/bpda_eot_attack.py:169
↓ 2 callersFunctionbatchwise_norm
Returns the per-example norm of the examples, keeping along the specified dimension. e.g. if examples is NxCxHxW, applying this fxn w
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:251
↓ 2 callersFunctioncheckpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
guided_diffusion/nn.py:132
↓ 2 callersFunctionconfigure
If comm is provided, average all numerical stats across that comm
guided_diffusion/logger.py:450
↓ 2 callersMethodconstrain_params
(self)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:478
↓ 2 callersFunctioncount_flops_attn
A counter for the `thop` package to count the operations in an attention operation. Meant to be used like: macs, params = thop.pr
guided_diffusion/unet.py:316
↓ 2 callersMethoddifferentiable_call
(self)
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:506
↓ 2 callersFunctiondiffusion_defaults
Defaults for image and classifier training.
guided_diffusion/script_util.py:19
↓ 2 callersMethoddumpkvs
(self)
guided_diffusion/logger.py:363
↓ 2 callersMethodeval_and_bpda_eot_grad
(self, X_adv, y, defended, requires_grad=True)
bpda_eot/bpda_eot_attack.py:119
↓ 2 callersMethodforward
This takes in the minibatch self's parameters were tuned for and outputs a variable of the perturbation applied to the images ARG
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:144
↓ 2 callersFunctionget_blob_logdir
()
guided_diffusion/train_util.py:281
↓ 2 callersMethodget_dir
(self)
guided_diffusion/logger.py:396
↓ 2 callersFunctionget_param_groups_and_shapes
(named_model_params)
guided_diffusion/fp16_util.py:90
↓ 2 callersFunctionget_score_fn
Wraps `score_fn` so that the model output corresponds to a real time-dependent score function. Args: sde: An `sde_lib.SDE` object that repr
score_sde/models/utils.py:128
↓ 2 callersMethodimage_editing_sample
(self, img=None, bs_id=0, tag=None)
runners/diffpure_ddpm.py:99
↓ 2 callersMethodldsde_fn
Create the drift and diffusion functions for the reverse SDE
runners/diffpure_ldsde.py:92
↓ 2 callersFunctionload_data
(args, adv_batch_size)
utils.py:256
↓ 2 callersFunctionloss_fn
Compute the loss function. Args: model: A score model. batch: A mini-batch of training data. Returns: loss: A scalar that
score_sde/losses.py:73
↓ 2 callersFunctionmake_master_params
Copy model parameters into a (differently-shaped) list of full-precision parameters.
guided_diffusion/fp16_util.py:43
↓ 2 callersMethodmake_valid_image
(self, x)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:485
↓ 2 callersFunctionnormal_kl
Compute the KL divergence between two gaussians. Shapes are automatically broadcasted, so batches can be compared to scalars, among othe
guided_diffusion/losses.py:20
↓ 2 callersMethodp_sample
Sample x_{t-1} from the model at the given timestep. :param model: the model to sample from. :param x: the current tensor at
guided_diffusion/gaussian_diffusion.py:403
↓ 2 callersMethodperturbation_norm
(self, x=None, lp_style=None)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:471
↓ 2 callersMethodperturbation_obj
(self)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:420
↓ 2 callersMethodprior_sampling
Generate one sample from the prior distribution, $p_T(x)$.
score_sde/sde_lib.py:43
↓ 2 callersMethodpurify
(self, x)
eval_sde_adv_bpda.py:37
↓ 2 callersMethodpurify
(self, x)
eval_sde_adv_bpda.py:83
↓ 2 callersMethodpurify_and_predict
(self, X, y, purify_reps=1, requires_grad=True)
bpda_eot/bpda_eot_attack.py:98
↓ 2 callersMethodq_sample
Diffuse the data for a given number of diffusion steps. In other words, sample from q(x_t | x_0). :param x_start: the initi
guided_diffusion/gaussian_diffusion.py:196
↓ 2 callersMethodrandom_init
(self)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:502
↓ 2 callersMethodreset_counter
(self)
eval_sde_adv_bpda.py:77
↓ 2 callersMethodreverse
Create the reverse-time SDE/ODE. Args: score_fn: A time-dependent score-based model that takes x and t and returns the score. probabi
score_sde/sde_lib.py:79
↓ 2 callersMethodrvpsde_fn
Create the drift and diffusion functions for the reverse SDE
runners/diffpure_sde.py:92
↓ 2 callersMethodset_gpu
Propagates changes of the 'use_gpu' parameter down to the attack ARGS: use_gpu : bool - if True, the attack uses the GPU, ow it d
stadv_eot/recoloradv/mister_ed/adversarial_training.py:59
↓ 2 callersMethodset_tag
(self, tag=None)
eval_sde_adv_bpda.py:80
↓ 2 callersMethodset_verbosity_loglevel
Sets the verbosity or loglevel for training. Is called in .train method so this method doesn't need to be explicitly called.
stadv_eot/recoloradv/mister_ed/adversarial_training.py:207
↓ 2 callersFunctionsizeof_fmt
https://stackoverflow.com/a/1094933 answer by Sridhar Ratnakumar
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:210
↓ 2 callersMethodsmoothness_norm
(self)
stadv_eot/recoloradv/color_transformers.py:195
↓ 2 callersFunctiontimestep_embedding
Create sinusoidal timestep embeddings. :param timesteps: a 1-D Tensor of N indices, one per batch element. These may b
guided_diffusion/nn.py:111
↓ 2 callersFunctionto_flattened_numpy
Flatten a torch tensor `x` and convert it to numpy.
score_sde/models/utils.py:180
↓ 2 callersMethodtrain
Modifies the NN weights of self.classifier_net by training with the specified parameters s ARGS: data_loader: torch.u
stadv_eot/recoloradv/mister_ed/adversarial_training.py:324
↓ 2 callersFunctionunflatten_master_params
(param_group, master_param)
guided_diffusion/fp16_util.py:86
↓ 2 callersFunctionzero_master_grads
(master_params)
guided_diffusion/fp16_util.py:136
↓ 1 callersFunctionResNet50
()
classifiers/cifar10_resnet.py:85
↓ 1 callersFunctionWideResNet_70_16_dropout
()
classifiers/cifar10_resnet.py:197
↓ 1 callersMethod__init__
(self, args, config)
eval_sde_adv_bpda.py:54
↓ 1 callersMethod__init__
(self, file_name: str = None, file_mode: str = "w", should_flush: bool = True)
utils.py:44
↓ 1 callersMethod__init__
Construct a Variance Preserving SDE. Args: model: diffusion model score_type: [guided_diffusion, score_sde, ddpm]
runners/diffpure_ode.py:52
↓ 1 callersMethod__init__
Construct a Variance Preserving SDE. Args: model: diffusion model score_type: [guided_diffusion, score_sde, ddpm]
runners/diffpure_sde.py:51
↓ 1 callersMethod__init__
Construct a Variance Preserving SDE. Args: model: diffusion model score_type: [guided_diffusion, score_sde, ddpm]
runners/diffpure_ldsde.py:51
↓ 1 callersMethod__init__
(self, model, bound=0.05, **kwargs)
stadv_eot/attacks.py:124
↓ 1 callersMethod__init__
(self, image_subdirectory)
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:191
↓ 1 callersMethod__init__
(self)
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:121
↓ 1 callersMethod__init__
(self, model, timestep_map, rescale_timesteps, original_num_steps)
guided_diffusion/respace.py:125
↓ 1 callersMethod_anneal_lr
(self)
guided_diffusion/train_util.py:228
↓ 1 callersMethod_attack_subroutine
Subroutine to run the specified attack on a minibatch and append the results to inputs/labels. NOTE: THIS DOES NOT MUTATE inputs
stadv_eot/recoloradv/mister_ed/adversarial_training.py:253
↓ 1 callersMethod_batch_compare
Returns a list of indices of valid adversarial examples ARGS: example_logits: Variable/Tensor (Nx#Classes) - output logits for a
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:490
↓ 1 callersFunction_compute_fans
(shape, in_axis=1, out_axis=0)
score_sde/models/layers.py:60
↓ 1 callersFunction_configure_default_logger
()
guided_diffusion/logger.py:482
↓ 1 callersMethod_construct_loss_fxn
Uses the distance_fxn and carlini_loss to create a loss function to be optimized ARGS: initial_lambda : float - which
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:453
↓ 1 callersMethod_do_log
(self, args)
guided_diffusion/logger.py:405
↓ 1 callersFunction_einsum
(a, b, c, x, y)
score_sde/models/layers.py:532
↓ 1 callersMethod_example_loader
Loads the numpy array of examples given the random 'prefix'
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:256
↓ 1 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array or a func. :param timesteps: a tensor of i
runners/diffpure_ode.py:24
↓ 1 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array or a func. :param timesteps: a tensor of i
runners/diffpure_sde.py:23
↓ 1 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array or a func. :param timesteps: a tensor of i
runners/diffpure_ldsde.py:23
↓ 1 callersMethod_find_classes
Finds the class folders in a dataset. Ensures: No class is a subdirectory of another.
data/datasets.py:77
↓ 1 callersFunction_find_free_port
()
guided_diffusion/dist_util.py:94
↓ 1 callersMethod_label_loader
Loads the numpy array of labels given the random 'prefix'
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:260
↓ 1 callersFunction_list_image_files_recursively
(data_dir)
guided_diffusion/image_datasets.py:78
↓ 1 callersMethod_load_and_sync_parameters
(self)
guided_diffusion/train_util.py:118
↓ 1 callersMethod_load_ema_parameters
(self, rate)
guided_diffusion/train_util.py:133
↓ 1 callersMethod_load_optimizer_state
(self)
guided_diffusion/train_util.py:149
↓ 1 callersMethod_make_layer
(self, block, in_planes, out_planes, nb_layers, stride, dropRate)
classifiers/cifar10_resnet.py:127
↓ 1 callersMethod_merge_setup
DANGEROUS TO BE CALLED OUTSIDE OF THIS FILE!!!
stadv_eot/recoloradv/perturbations.py:54
↓ 1 callersMethod_merge_setup
DANGEROUS TO BE CALLED OUTSIDE OF THIS FILE!!!
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:458
↓ 1 callersMethod_merge_setup
DANGEROUS TO BE CALLED OUTSIDE OF THIS FILE!!!
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:555
↓ 1 callersMethod_merge_setup
(self, num_examples)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:691
↓ 1 callersMethod_optimize_fp16
(self, opt: th.optim.Optimizer)
guided_diffusion/fp16_util.py:197
↓ 1 callersMethod_optimize_normal
(self, opt: th.optim.Optimizer)
guided_diffusion/fp16_util.py:217
↓ 1 callersMethod_optimize_step
Does one step of optimization
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:475
↓ 1 callersMethod_predict_xstart_from_xprev
(self, x_t, t, xprev)
guided_diffusion/gaussian_diffusion.py:343
↓ 1 callersMethod_prior_bpd
Get the prior KL term for the variational lower-bound, measured in bits-per-dim. This term can't be optimized, as it only de
guided_diffusion/gaussian_diffusion.py:827
↓ 1 callersFunction_register
(cls)
score_sde/models/utils.py:29
↓ 1 callersMethod_scale_timesteps
(self, t)
runners/diffpure_ode.py:80
↓ 1 callersMethod_scale_timesteps
(self, t)
runners/diffpure_sde.py:82
↓ 1 callersMethod_scale_timesteps
(self, t)
runners/diffpure_ldsde.py:88
↓ 1 callersMethod_setter
Modifies params going forward
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:525
← previousnext →101–200 of 875, ranked by callers