MCPcopy Create free account

hub / github.com/NVlabs/DiffPure / functions

Functions875 in github.com/NVlabs/DiffPure

↓ 25 callersFunction_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array. :param timesteps: a tensor of indices int
guided_diffusion/gaussian_diffusion.py:903
↓ 25 callersMethodload_state_dict
(self, state_dict)
score_sde/models/ema.py:103
↓ 24 callersMethodeval
Evaluates how good the adversarial examples are ARGS: ground_truths: Variable (NxCxHxW) - examples before we did
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:72
↓ 22 callersMethodforward
(self, examples, labels, *args, **kwargs)
stadv_eot/recoloradv/mister_ed/loss_functions.py:222
↓ 21 callersMethodlog
(self, *args, level=INFO)
guided_diffusion/logger.py:384
↓ 20 callersFunctionncsn_conv3x3
3x3 convolution with PyTorch initialization. Same as NCSNv1/NCSNv2.
score_sde/models/layers.py:108
↓ 19 callersMethodsave
(self)
guided_diffusion/train_util.py:240
↓ 18 callersMethod__init__
(self, in_dim, num_units, init_scale=0.1)
score_sde/models/layers.py:547
↓ 17 callersFunctionnormalization
Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization.
guided_diffusion/nn.py:101
↓ 15 callersMethodlog
Logs the data point by specifying each of epoch, minibatch, value ARGS: name : string - name of existing series in self.series
stadv_eot/recoloradv/mister_ed/utils/pytorch_utils.py:629
↓ 15 callersMethodwrite
Write text to stdout (and a file) and optionally flush.
utils.py:63
↓ 14 callersMethodclone
(self, shape=None, example_index=None)
stadv_eot/recoloradv/color_transformers.py:177
↓ 14 callersFunctionconv_nd
Create a 1D, 2D, or 3D convolution module.
guided_diffusion/nn.py:30
↓ 13 callersMethodnorm
(self, lp='inf')
stadv_eot/recoloradv/color_transformers.py:199
↓ 12 callersMethodforward
(self, img1, img2)
stadv_eot/recoloradv/mister_ed/utils/pytorch_ssim.py:63
↓ 12 callersMethodzero_grad
(self)
stadv_eot/recoloradv/mister_ed/loss_functions.py:122
↓ 11 callersMethod__init__
(self, classifier, normalizer=None, kappa=0.0)
stadv_eot/recoloradv/mister_ed/loss_functions.py:215
↓ 9 callersMethod__init__
(self, channels, use_conv, dims=2, out_channels=None)
guided_diffusion/unet.py:99
↓ 9 callersFunctionget_current
()
guided_diffusion/logger.py:333
↓ 8 callersMethod__init__
( self, num_channels=3, # Number of input color channels. Overridden based on dataset
classifiers/attribute_net.py:158
↓ 8 callersFunctiondefault_init
The same initialization used in DDPM.
score_sde/models/layers.py:88
↓ 8 callersMethodlogkv_mean
(self, key, val)
guided_diffusion/logger.py:358
↓ 8 callersFunctionscore_fn
(x, t)
score_sde/models/utils.py:143
↓ 7 callersMethod__init__
(self, num_features, bias=True)
score_sde/models/normalization.py:150
↓ 7 callersMethodbackward
(ctx, grad_output)
score_sde/op/upfirdn2d.py:135
↓ 7 callersMethodupdate
Update currently maintained parameters. Call this every time the parameters are updated, such as the result of the `optimizer.step()` ca
score_sde/models/ema.py:40
↓ 6 callersMethod__init__
(self, sde, score_fn, probability_flow=False)
score_sde/sampling.py:129
↓ 6 callersMethod__init__
(self, dim1, dim2, method='cat')
score_sde/models/layerspp.py:47
↓ 6 callersMethod_compute_cond_module
(self, module, x)
score_sde/models/ncsnv2.py:381
↓ 6 callersMethodclose
(self)
guided_diffusion/logger.py:399
↓ 6 callersMethodflush
Flush written text to both stdout and a file, if open.
utils.py:76
↓ 6 callersFunctionget_accuracy
(model, x_orig, y_orig, bs=64, device=torch.device('cuda:0'))
utils.py:131
↓ 6 callersFunctionget_act
Get activation functions from the config file.
score_sde/models/layers.py:29
↓ 6 callersMethodidentity_params
Returns some grid parameters such that the minibatch of images isn't changed when forward is called on it ARGS: shape
stadv_eot/recoloradv/mister_ed/spatial_transformers.py:124
↓ 6 callersFunctionlog
Write the sequence of args, with no separators, to the console and output files (if you've configured an output file).
guided_diffusion/logger.py:255
↓ 6 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
guided_diffusion/nn.py:94
↓ 5 callersMethod__init__
FullSpatial just has parameters that are the grid themselves. Forward then will just call grid sample using these params directly
stadv_eot/recoloradv/mister_ed/spatial_transformers.py:112
↓ 5 callersMethod__init__
Factory class to generate per_minibatch instances of Adversarial perturbations. ARGS: perturbation_class : class - su
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:391
↓ 5 callersMethod_compute_cond_module
(self, module, x)
score_sde/models/ncsnv2.py:279
↓ 5 callersFunction_shape
(x, dim)
score_sde/models/up_or_down_sampling.py:199
↓ 5 callersMethodadversarial_tensors
Little helper method to get the tensors of the adversarial images directly
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:187
↓ 5 callersMethodconvert_to_fp16
Convert the torso of the model to float16.
guided_diffusion/unet.py:626
↓ 5 callersFunctionddpm_conv3x3
3x3 convolution with DDPM initialization.
score_sde/models/layers.py:118
↓ 5 callersFunctionget_image_classifier
(classifier_name)
utils.py:143
↓ 5 callersFunctionlinear
Create a linear module.
guided_diffusion/nn.py:43
↓ 5 callersMethodmerge_perturbation
(self, other, self_mask)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:508
↓ 5 callersFunctionmodel_and_diffusion_defaults
Defaults for image training.
guided_diffusion/script_util.py:51
↓ 5 callersFunctionmodel_fn
Compute the output of the score-based model. Args: x: A mini-batch of input data. labels: A mini-batch of conditioning va
score_sde/models/utils.py:107
↓ 5 callersFunctionnonlinearity
(x)
ddpm/unet_ddpm.py:35
↓ 5 callersFunctionparams_to_filename
Outputs string name of file. ARGS: experiment_name : string - name of experiment we're saving architecture : string - abbreviatio
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:64
↓ 5 callersMethodsetup
(self, x)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:465
↓ 4 callersFunctionNormalize
(in_channels)
ddpm/unet_ddpm.py:40
↓ 4 callersMethod__init__
(self, config)
ddpm/unet_ddpm.py:201
↓ 4 callersMethod__init__
(self, block, num_blocks, num_classes=10)
classifiers/cifar10_resnet.py:46
↓ 4 callersMethod_compute_cond_module
(self, module, x)
score_sde/models/ncsnv2.py:101
↓ 4 callersMethod_compute_cond_module
(self, module, x, y)
score_sde/models/ncsnv2.py:191
↓ 4 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
classifiers/cifar10_resnet.py:64
↓ 4 callersMethod_scale_timesteps
(self, t)
guided_diffusion/gaussian_diffusion.py:359
↓ 4 callersFunction_setup_kernel
(k)
score_sde/models/up_or_down_sampling.py:189
↓ 4 callersMethod_wrap_model
(self, model)
guided_diffusion/respace.py:112
↓ 4 callersMethodcleanup_attack_batch
Does some cleanup stuff after we finish on a minibatch: - clears the fixed images for ReferenceRegularizers - zeros grads - c
stadv_eot/recoloradv/mister_ed/loss_functions.py:94
↓ 4 callersMethodcopy_to
Copy current parameters into given collection of parameters. Args: parameters: Iterable of `torch.nn.Parameter`; the parameters to be
score_sde/models/ema.py:61
↓ 4 callersFunctioncreate_model_and_diffusion
( image_size, class_cond, learn_sigma, num_channels, num_res_blocks, channel_mult,
guided_diffusion/script_util.py:82
↓ 4 callersFunctionget_normalization
Obtain normalization modules from the config file.
score_sde/models/normalization.py:22
↓ 4 callersMethodmarginal_prob
Parameters to determine the marginal distribution of the SDE, $p_t(x)$.
score_sde/sde_lib.py:38
↓ 4 callersMethodnorm
Returns the 'norm' of this transformation in terms of an LP norm on the parameters, summed across each transformation per minibatch
stadv_eot/recoloradv/mister_ed/spatial_transformers.py:216
↓ 4 callersMethodp_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x, x_0. :param model: the model, which takes
guided_diffusion/gaussian_diffusion.py:240
↓ 4 callersMethodq_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
guided_diffusion/gaussian_diffusion.py:216
↓ 4 callersMethodreset_counter
(self)
eval_sde_adv.py:62
↓ 4 callersMethodsde
(self, x, t)
score_sde/sde_lib.py:34
↓ 4 callersMethodstate_dict
(self)
score_sde/models/ema.py:99
↓ 4 callersFunctionupfirdn2d
(input, kernel, up=1, down=1, pad=(0, 0))
score_sde/op/upfirdn2d.py:153
↓ 4 callersFunctionzero_module
Zero out the parameters of a module and return it.
guided_diffusion/nn.py:76
↓ 3 callersMethod__init__
Construct an SDE. Args: N: number of discretization time steps.
score_sde/sde_lib.py:18
↓ 3 callersMethod__init__
(self, config)
score_sde/models/ncsnv2.py:137
↓ 3 callersMethod_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
guided_diffusion/gaussian_diffusion.py:353
↓ 3 callersMethod_to_rgb_part
Implements the function f(n) defined here: https://en.wikipedia.org/wiki/HSL_and_HSV#Alternative_HSV_to_RGB
stadv_eot/recoloradv/color_spaces.py:149
↓ 3 callersMethod_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This allow
guided_diffusion/gaussian_diffusion.py:717
↓ 3 callersMethodattach_originals
(self, originals)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:805
↓ 3 callersMethodclose
Flush, close possible files, and remove stdout/stderr mirroring.
utils.py:83
↓ 3 callersFunctioncreate_gaussian_diffusion
( *, steps=1000, learn_sigma=False, sigma_small=False, noise_schedule="linear", use_kl
guided_diffusion/script_util.py:394
↓ 3 callersFunctioncreate_window
(window_size, channel)
stadv_eot/recoloradv/mister_ed/utils/pytorch_ssim.py:27
↓ 3 callersFunctionextract
Extract coefficients from a based on t and reshape to make it broadcastable with x_shape.
runners/diffpure_ddpm.py:26
↓ 3 callersFunctionfind_resume_checkpoint
()
guided_diffusion/train_util.py:287
↓ 3 callersMethodfrom_rgb
Converts an Nx3xWxH tensor in RGB color space to a Nx3xWxH tensor in this color space. All outputs should be in the 0-1 range.
stadv_eot/recoloradv/color_spaces.py:28
↓ 3 callersFunctionget_optimizer
Returns a flax optimizer object based on `config`.
score_sde/losses.py:26
↓ 3 callersFunctionget_sigmas
Get sigmas --- the set of noise levels for SMLD from config files. Args: config: A ConfigDict object parsed from the config file Returns
score_sde/models/utils.py:49
↓ 3 callersMethodidentity_params
(self, shape)
stadv_eot/recoloradv/color_transformers.py:120
↓ 3 callersMethodidentity_params
Returns parameters for identity affine transformation ARGS: shape: torch.Size - shape of the minibatch of images we'll be
stadv_eot/recoloradv/mister_ed/spatial_transformers.py:319
↓ 3 callersMethodlogkv
(self, key, val)
guided_diffusion/logger.py:355
↓ 3 callersFunctionpath_resolver
(path)
stadv_eot/recoloradv/mister_ed/config.py:19
↓ 3 callersMethodsample
Importance-sample timesteps for a batch. :param batch_size: the number of timesteps. :param device: the torch device to save
guided_diffusion/resample.py:50
↓ 3 callersMethodset_tag
(self, tag=None)
eval_sde_adv.py:65
↓ 3 callersMethodsetup_attack_batch
Setup before calling loss on a new minibatch. Ensures the correct fix_im for reference regularizers and that all grads are zeroed
stadv_eot/recoloradv/mister_ed/loss_functions.py:81
↓ 3 callersMethodto_rgb
Converts an Nx3xWxH tensor in this color space to a Nx3xWxH tensor in RGB color space.
stadv_eot/recoloradv/color_spaces.py:35
↓ 3 callersMethodupdate_params
(self, step_fxn)
stadv_eot/recoloradv/mister_ed/adversarial_perturbations.py:491
↓ 3 callersFunctionupdate_state_dict
(state_dict, idx_start=9)
utils.py:119
↓ 2 callersMethod__init__
(self, *args, resolution_x=8, resolution_y=8, resolution_z=8, **kwargs)
stadv_eot/recoloradv/color_transformers.py:151
↓ 2 callersMethod__init__
(self, classifier_net, normalizer, threat_model, loss_fxn, manual_gpu=None)
stadv_eot/recoloradv/mister_ed/adversarial_attacks.py:242
↓ 2 callersMethod_base_loader
(self, prefix, which)
stadv_eot/recoloradv/mister_ed/utils/checkpoints.py:249
next →1–100 of 875, ranked by callers