MCPcopy Create free account

hub / github.com/annegnx/PnP-Flow / functions

Functions418 in github.com/annegnx/PnP-Flow

↓ 20 callersFunctionncsn_conv3x3
3x3 convolution with PyTorch initialization. Same as NCSNv1/NCSNv2.
pnpflow/image_generation/models/layers.py:108
↓ 18 callersMethod__init__
(self, in_dim, num_units, init_scale=0.1)
pnpflow/image_generation/models/layers.py:547
↓ 16 callersFunctionpostprocess
(img, args)
pnpflow/utils.py:560
↓ 14 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
pnpflow/image_generation/models/utils.py:117
↓ 13 callersMethodrandn_like
r""" Equivalent to `torch.randn_like` but supports a pseudorandom number generator argument. :param int seed: the seed for the random
pnpflow/methods/pnp_diff.py:253
↓ 12 callersFunctionconv2d
( in_planes, out_planes, kernel_size=( 3, 3), stride=1,
pnpflow/models.py:226
↓ 10 callersMethodload_state_dict
(self, state_dict)
pnpflow/image_generation/models/ema.py:95
↓ 10 callersFunctionrestore_checkpoint
(ckpt_dir, state, device)
pnpflow/image_generation/utils.py:7
↓ 9 callersMethod__init__
(self, input_channels, input_height, ch, o
pnpflow/models.py:303
↓ 8 callersMethodcopy_to
Copy current parameters into given collection of parameters. Args: parameters: Iterable of `torch.nn.Parameter`; the parameters to be
pnpflow/image_generation/models/ema.py:53
↓ 8 callersFunctiondefault_init
The same initialization used in DDPM.
pnpflow/image_generation/models/layers.py:88
↓ 8 callersMethodstate_dict
(self)
pnpflow/image_generation/models/ema.py:91
↓ 7 callersMethod__init__
(self, num_features, bias=True)
pnpflow/image_generation/models/normalization.py:150
↓ 7 callersFunctionget_default_configs
()
pnpflow/image_generation/configs/default_cifar10_configs.py:5
↓ 7 callersMethodsample
(self, random_seed=None)
pnpflow/utils.py:963
↓ 6 callersMethod__init__
(self, dim1, dim2, method='cat')
pnpflow/image_generation/models/layerspp.py:47
↓ 6 callersMethod__init__
(self)
pnpflow/methods/pnp_diff.py:315
↓ 6 callersMethod_compute_cond_module
(self, module, x)
pnpflow/image_generation/models/ncsnv2.py:381
↓ 6 callersFunctionget_act
Get activation functions from the config file.
pnpflow/image_generation/models/layers.py:29
↓ 6 callersMethodget_z0
(self, batch, train=True)
pnpflow/image_generation/sde_lib.py:96
↓ 6 callersFunctionsave_checkpoint
(ckpt_dir, state)
pnpflow/image_generation/utils.py:16
↓ 6 callersMethodupdate
Update currently maintained parameters. Call this every time the parameters are updated, such as the result of the `optimizer.step()` ca
pnpflow/image_generation/models/ema.py:32
↓ 5 callersMethod_compute_cond_module
(self, module, x)
pnpflow/image_generation/models/ncsnv2.py:279
↓ 5 callersFunction_shape
(x, dim)
pnpflow/image_generation/models/up_or_down_sampling.py:193
↓ 5 callersMethodbackward
(ctx, grad_output)
pnpflow/image_generation/op/upfirdn2d.py:127
↓ 5 callersMethodcalculate_grad
Calculate Dg(x) the gradient of the regularizer g at input x :param x: torch.tensor Input image :param sigma: Denoiser level
pnpflow/train_denoiser.py:39
↓ 5 callersFunctionddpm_conv3x3
3x3 convolution with DDPM initialization.
pnpflow/image_generation/models/layers.py:118
↓ 5 callersFunctionto_flattened_numpy
Flatten a torch tensor `x` and convert it to numpy.
pnpflow/image_generation/models/utils.py:192
↓ 5 callersMethodtrain
(self, data_loaders)
pnpflow/train_flow_matching.py:216
↓ 4 callersMethodH_adj
(self, x)
pnpflow/degradations.py:19
↓ 4 callersMethod_compute_cond_module
(self, module, x)
pnpflow/image_generation/models/ncsnv2.py:101
↓ 4 callersMethod_compute_cond_module
(self, module, x, y)
pnpflow/image_generation/models/ncsnv2.py:191
↓ 4 callersFunction_setup_kernel
(k)
pnpflow/image_generation/models/up_or_down_sampling.py:183
↓ 4 callersFunctiondrift_fn
The drift function of the reverse-time SDE.
pnpflow/image_generation/likelihood.py:60
↓ 4 callersFunctionget_default_configs
()
pnpflow/image_generation/configs/default_lsun_configs.py:5
↓ 4 callersFunctionget_normalization
Obtain normalization modules from the config file.
pnpflow/image_generation/models/normalization.py:22
↓ 4 callersFunctionload_cfg_from_cfg_file
(file: str)
pnpflow/utils.py:135
↓ 4 callersMethodobjective
(self, x, y, H, H_adj, lmbda, g)
pnpflow/methods/pnp_gs.py:78
↓ 4 callersMethodrestore
Restore the parameters stored with the `store` method. Useful to validate the model with EMA parameters without affecting the original op
pnpflow/image_generation/models/ema.py:76
↓ 4 callersMethodstore
Save the current parameters for restoring later. Args: parameters: Iterable of `torch.nn.Parameter`; the parameters to be temp
pnpflow/image_generation/models/ema.py:66
↓ 4 callersFunctionupfirdn2d
(input, kernel, up=1, down=1, pad=(0, 0))
pnpflow/image_generation/op/upfirdn2d.py:145
↓ 3 callersMethod__init__
(self, half_size_mask)
pnpflow/degradations.py:24
↓ 3 callersMethod__init__
(self, config)
pnpflow/image_generation/models/ncsnv2.py:137
↓ 3 callersFunction_check_nan
(vec, msg)
pnpflow/utils.py:1044
↓ 3 callersFunctiondense
(in_channels, out_channels, init_scale=1.)
pnpflow/models.py:219
↓ 3 callersMethodforward
Denoising with Gradient Step Denoiser :param x: torch.tensor input image :param sigma: Denoiser level (std) :return:
pnpflow/train_denoiser.py:59
↓ 3 callersMethodforward_flow_matching
(self, z)
pnpflow/methods/d_flow.py:41
↓ 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
pnpflow/image_generation/models/utils.py:52
↓ 3 callersMethodload_data
(self)
pnpflow/dataloaders.py:23
↓ 3 callersFunctionload_model
(name_model, model, state, download=False, checkpoint_path=None, dataset=None, device='cuda')
pnpflow/utils.py:208
↓ 3 callersMethodmodel_forward
(self, x, t)
pnpflow/methods/flow_priors.py:18
↓ 3 callersMethodprox_datafit
(self, x, y, H, H_adj, degradation=None, alpha=None)
pnpflow/methods/pnp_gs.py:32
↓ 3 callersMethodrng_manual_seed
r""" Sets the seed for the random number generator. :param int seed: the seed to set for the random number generator. If not provided
pnpflow/methods/pnp_diff.py:223
↓ 2 callersMethodH
(self, x)
pnpflow/degradations.py:16
↓ 2 callersFunction_decode_cfg_value
(v)
pnpflow/utils.py:89
↓ 2 callersFunction_inception_v3
Wraps `torchvision.models.inception_v3` Skips default weight inititialization if supported by torchvision version. See https://github.com/mse
pnpflow/models.py:654
↓ 2 callersFunction_safe_normalize
(x, threshold=None)
pnpflow/utils.py:1049
↓ 2 callersMethodapply_flow_matching
(self, NO_samples)
pnpflow/train_flow_matching.py:131
↓ 2 callersFunctioncalculate_activation_statistics
Calculation of the statistics used by the FID. Params: -- images : Images -- model : Instance of inception model -- batch_s
pnpflow/fid_score.py:131
↓ 2 callersMethodcompute_norm
(self, img)
pnpflow/methods/d_flow.py:62
↓ 2 callersFunctiondiv_fn
(x, t, eps)
pnpflow/image_generation/likelihood.py:30
↓ 2 callersFunctiondownsample
s-fold downsampler Keeping the upper-left pixel for each distinct sfxsf patch and discarding the others x: tensor image, NxCxWxH
pnpflow/utils.py:302
↓ 2 callersFunctiondownsample
(in_ch, with_conv)
pnpflow/models.py:50
↓ 2 callersMethodeuler_ode
(self, init_input, model, reverse=False, N=100)
pnpflow/image_generation/sde_lib.py:75
↓ 2 callersFunctionfrom_flattened_numpy
Form a torch tensor with the given `shape` from a flattened numpy array `x`.
pnpflow/image_generation/models/utils.py:197
↓ 2 callersFunctiongaussian_2d_kernel
Generate a 2D Gaussian kernel.
pnpflow/utils.py:273
↓ 2 callersFunctionget_div_fn
Create the divergence function of `fn` using the Hutchinson-Skilling trace estimator.
pnpflow/image_generation/likelihood.py:27
↓ 2 callersFunctionlikelihood_fn
Compute an unbiased estimate to the log-likelihood in bits/dim. Args: model: A score model. data: A PyTorch tensor. Returns:
pnpflow/image_generation/likelihood.py:70
↓ 2 callersFunctionloss_fn
Compute the loss function. Args: model: A velocity model. batch: A mini-batch of training data. Returns:
pnpflow/image_generation/losses.py:71
↓ 2 callersFunctionmerge_cfg_from_list
(cfg: CfgNode, cfg_list: List[str])
pnpflow/utils.py:151
↓ 2 callersMethodmodel_forward
(self, x, t)
pnpflow/methods/d_flow.py:25
↓ 2 callersMethodmodel_forward
(self, x, t)
pnpflow/methods/ot_ode.py:17
↓ 2 callersFunctionpaintbrush_mask
Black mask that looks like paintbrush on the image. Make it random
pnpflow/utils.py:339
↓ 2 callersFunctionrandom_mask
Random mask on x
pnpflow/utils.py:353
↓ 2 callersFunctionsquare_mask
Black square mask of 20 x 20 pixels at the center of the image
pnpflow/utils.py:327
↓ 2 callersMethodupdate_parameters
r""" Updates the standard deviation of the noise. :param float, torch.Tensor sigma: standard deviation of the noise.
pnpflow/methods/pnp_diff.py:286
↓ 2 callersFunctionupsample
s-fold upsampler Upsampling the spatial size by filling the new entries with zeros x: tensor image, NxCxWxH
pnpflow/utils.py:283
↓ 2 callersFunctionupsample
(in_ch, with_conv)
pnpflow/models.py:41
↓ 2 callersFunctionvariance_scaling_init_
(tensor, scale)
pnpflow/models.py:212
↓ 1 callersMethodA
(self, x, filter=None, **kwargs)
pnpflow/methods/pnp_diff.py:173
↓ 1 callersMethodA_adjoint
(self, y, filter=None, **kwargs)
pnpflow/methods/pnp_diff.py:176
↓ 1 callersMethodH
(self, x)
pnpflow/degradations.py:28
↓ 1 callersMethodH_adj
(self, x)
pnpflow/degradations.py:122
↓ 1 callersFunction_calculate_correct_fan
copied and modified from https://github.com/pytorch/pytorch/blob/master/torch/nn/init.py#L337
pnpflow/models.py:165
↓ 1 callersFunction_check_and_coerce_cfg_value_type
(replacement, original, key, full_key)
pnpflow/utils.py:101
↓ 1 callersMethod_compute_cond_module
(self, module, x, temp)
pnpflow/models.py:436
↓ 1 callersFunction_compute_fans
(shape, in_axis=1, out_axis=0)
pnpflow/image_generation/models/layers.py:60
↓ 1 callersFunction_einsum
(a, b, c, x, y)
pnpflow/image_generation/models/layers.py:532
↓ 1 callersMethod_generate_mask
(self)
pnpflow/utils.py:923
↓ 1 callersMethod_load_mask
(self, rotation=True, dilation=True, cropping=True)
pnpflow/utils.py:941
↓ 1 callersFunction_register
(cls)
pnpflow/image_generation/models/utils.py:30
↓ 1 callersFunctionapply_given_rotation
Apply givens rotation to H columns :param H: :param cs: :param ss: :param j: :return:
pnpflow/utils.py:1092
↓ 1 callersFunctionarnoldi
Arnoldi iteration to find the j th l2-orthonormal vector compute the j-1 th column of Hessenberg matrix
pnpflow/utils.py:1061
↓ 1 callersFunctionbicubic_filter
r""" Bicubic filter. It has size (4*factor, 4*factor) and is defined as .. math:: \begin{equation*} w(x, y) = \begi
pnpflow/utils.py:365
↓ 1 callersFunctioncal_rotation
Args: a: element h in position j b: element h in position j+1 Returns: cosine = a / \sqrt{a^2 + b^2} sine = -
pnpflow/utils.py:1079
↓ 1 callersFunctioncalculate_frechet_distance
Numpy implementation of the Frechet Distance. The Frechet distance between two multivariate Gaussians X_1 ~ N(mu_1, C_1) and X_2 ~ N(mu_2, C_2
pnpflow/fid_score.py:74
↓ 1 callersFunctionclassifier_fn_from_tfhub
Returns a function that can be as a classifier function. Copied from tfgan but avoid loading the model each time calling _classifier_fn Args
pnpflow/image_generation/evaluation.py:58
↓ 1 callersMethodcompute_fid
(self, num_images_fid, train_feat, ft_extractor, batch_size=512, integration_method="dopri5", integration_step
pnpflow/train_flow_matching.py:200
↓ 1 callersMethodcompute_metrics
(self, num_samples)
pnpflow/compute_metric.py:17
↓ 1 callersFunctionconditional_cast
(from_type, to_type)
pnpflow/utils.py:110
next →1–100 of 418, ranked by callers