MCPcopy Create free account

hub / github.com/DPS2022/diffusion-posterior-sampling / functions

Functions290 in github.com/DPS2022/diffusion-posterior-sampling

↓ 16 callersMethodtranspose
(self, data, **kwargs)
guided_diffusion/measurements.py:42
↓ 14 callersFunctionconv_nd
Create a 1D, 2D, or 3D convolution module.
guided_diffusion/nn.py:22
↓ 14 callersFunctionextract_and_expand
(array, time, target)
guided_diffusion/posterior_mean_variance.py:248
↓ 13 callersFunctionextract_and_expand
(array, time, target)
guided_diffusion/gaussian_diffusion.py:463
↓ 11 callersMethod__init__
Initialize the GANLoss class. Parameters: gan_mode (str) - - the type of GAN objective. It currently supports vanilla, lsgan, an
guided_diffusion/unet.py:1021
↓ 7 callersFunctionnormalization
Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization.
guided_diffusion/nn.py:93
↓ 5 callersFunctionlinear
Create a linear module.
guided_diffusion/nn.py:35
↓ 4 callersMethod_wrap_model
(self, model)
guided_diffusion/gaussian_diffusion.py:336
↓ 4 callersFunctionclear_color
(x)
util/img_utils.py:45
↓ 4 callersFunctionfftshift
Similar to np.fft.fftshift but applies to PyTorch Tensors Args: x: A PyTorch tensor. dim: Which dimension to fftshift. Re
util/fastmri_utils.py:163
↓ 4 callersMethodforward
(self, x)
guided_diffusion/nn.py:13
↓ 4 callersFunctionifftshift
Similar to np.fft.ifftshift but applies to PyTorch Tensors Args: x: A PyTorch tensor. dim: Which dimension to ifftshift.
util/fastmri_utils.py:186
↓ 4 callersFunctionnormalize_np
Normalize img in arbitrary range to [0, 1]
util/tools.py:20
↓ 4 callersFunctionzero_module
Zero out the parameters of a module and return it.
guided_diffusion/nn.py:68
↓ 3 callersMethod__init__
(self, betas, dynamic_threshold, clip_denoised)
guided_diffusion/posterior_mean_variance.py:32
↓ 3 callersFunctionload_yaml
(file_path: str)
sample_condition.py:19
↓ 3 callersFunctionnormalize_np
Normalize img in arbitrary range to [0, 1]
util/img_utils.py:52
↓ 3 callersMethodprocess_xstart
(self, x)
guided_diffusion/posterior_mean_variance.py:40
↓ 2 callersMethod__init__
(self, operator, noiser, **kwargs)
guided_diffusion/condition_methods.py:80
↓ 2 callersMethod_compute_norms
(self, grad_scale=1.0)
guided_diffusion/fp16_util.py:214
↓ 2 callersMethod_retrieve_box
(self, img)
util/img_utils.py:193
↓ 2 callersFunctionbbox2mask
(bboxes, height, width, max_delta_h, max_delta_w)
util/tools.py:144
↓ 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:124
↓ 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:379
↓ 2 callersMethodforward
(self, data, **kwargs)
guided_diffusion/measurements.py:37
↓ 2 callersMethodforward
(self, in_tensor)
util/resizer.py:55
↓ 2 callersFunctionget_param_groups_and_shapes
(named_model_params)
guided_diffusion/fp16_util.py:80
↓ 2 callersMethodgrad_and_value
(self, x_prev, x_0_hat, measurement, **kwargs)
guided_diffusion/condition_methods.py:28
↓ 2 callersFunctionmake_master_params
Copy model parameters into a (differently-shaped) list of full-precision parameters.
guided_diffusion/fp16_util.py:33
↓ 2 callersMethodp_mean_variance
( self, model, *args, **kwargs )
guided_diffusion/gaussian_diffusion.py:320
↓ 2 callersMethodproject
(self, data, noisy_measurement, **kwargs)
guided_diffusion/condition_methods.py:25
↓ 2 callersFunctionrandom_bbox
Generate a random tlhw with configuration. Args: config: Config should have configuration including img Returns: tuple: (top
util/tools.py:106
↓ 2 callersFunctionroll
Similar to np.roll but applies to PyTorch Tensors. Args: x: A PyTorch tensor. shift: Amount to roll. dim: Which dimen
util/fastmri_utils.py:140
↓ 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:103
↓ 2 callersMethodtranspose
(self, data, **kwargs)
guided_diffusion/measurements.py:83
↓ 2 callersFunctionunflatten_master_params
(param_group, master_param)
guided_diffusion/fp16_util.py:76
↓ 2 callersMethodupdate_weights
(self, k)
util/img_utils.py:294
↓ 2 callersFunctionzero_master_grads
(master_params)
guided_diffusion/fp16_util.py:126
↓ 1 callersMethod__init__
(self, model, timestep_map, rescale_timesteps, original_num_steps)
guided_diffusion/gaussian_diffusion.py:349
↓ 1 callersMethod__init__
(self, img_size=256, crop_size=128, stride=64)
util/img_utils.py:144
↓ 1 callersMethod_optimize_fp16
(self, opt: th.optim.Optimizer)
guided_diffusion/fp16_util.py:187
↓ 1 callersMethod_optimize_normal
(self, opt: th.optim.Optimizer)
guided_diffusion/fp16_util.py:207
↓ 1 callersMethod_retrieve_random
(self, img)
util/img_utils.py:204
↓ 1 callersMethod_scale_timesteps
(self, t)
guided_diffusion/gaussian_diffusion.py:235
↓ 1 callersFunctionavg_pool_nd
Create a 1D, 2D, or 3D average pooling module.
guided_diffusion/nn.py:42
↓ 1 callersFunctionbetas_for_alpha_bar
Create a beta schedule that discretizes the given alpha_t_bar function, which defines the cumulative product of (1-beta) over time from t = [
guided_diffusion/gaussian_diffusion.py:440
↓ 1 callersFunctioncheck_overflow
(value)
guided_diffusion/fp16_util.py:233
↓ 1 callersFunctioncompute_color
(u, v)
util/tools.py:372
↓ 1 callersMethodcontributions
(self, in_length, out_length, scale, kernel, kernel_width, antialiasing)
util/resizer.py:104
↓ 1 callersMethodconvert_to_fp16
Convert the torso of the model to float16.
guided_diffusion/unet.py:689
↓ 1 callersFunctioncreate_gaussian
Return a Gaussian
util/img_utils.py:351
↓ 1 callersFunctioncreate_model
( image_size, num_channels, num_res_blocks, channel_mult="", learn_sigma=False, class_
guided_diffusion/unet.py:25
↓ 1 callersFunctioncreate_sampler
(sampler, steps, noise_schedule, model_mean_type,
guided_diffusion/gaussian_diffusion.py:31
↓ 1 callersFunctiondynamic_thresholding
(img, s=0.95)
util/img_utils.py:240
↓ 1 callersFunctionfft2_m
FFT for multi-coil
util/img_utils.py:26
↓ 1 callersFunctionfft2c_new
Apply centered 2 dimensional Fast Fourier Transform. Args: data: Complex valued input data containing at least 3 dimensions:
util/fastmri_utils.py:67
↓ 1 callersMethodfix_scale_and_size
(self, input_shape, output_shape, scale_factor)
util/resizer.py:76
↓ 1 callersMethodforward
(self, x)
guided_diffusion/unet.py:171
↓ 1 callersMethodforward
(self, data, **kwargs)
guided_diffusion/measurements.py:80
↓ 1 callersMethodforward
(self, data, **kwargs)
guided_diffusion/measurements.py:142
↓ 1 callersMethodforward
(self, data, **kwargs)
guided_diffusion/measurements.py:157
↓ 1 callersMethodforward
(self, data)
guided_diffusion/measurements.py:229
↓ 1 callersFunctionget_conditioning_method
(name: str, operator, noiser, **kwargs)
guided_diffusion/condition_methods.py:14
↓ 1 callersFunctionget_dataloader
(dataset: VisionDataset, batch_size: int, num_workers: int,
data/dataloader.py:25
↓ 1 callersFunctionget_dataset
(name: str, root: str, **kwargs)
data/dataloader.py:19
↓ 1 callersMethodget_kernel
(self)
guided_diffusion/measurements.py:110
↓ 1 callersFunctionget_logger
()
util/logger.py:3
↓ 1 callersMethodget_mean_and_xstart
(self, x, t, model_output)
guided_diffusion/posterior_mean_variance.py:37
↓ 1 callersFunctionget_mean_processor
(name: str, **kwargs)
guided_diffusion/posterior_mean_variance.py:24
↓ 1 callersFunctionget_named_beta_schedule
Get a pre-defined beta schedule for the given name. The beta schedule library consists of beta schedules which remain similar in the lim
guided_diffusion/gaussian_diffusion.py:413
↓ 1 callersFunctionget_noise
(name: str, **kwargs)
guided_diffusion/measurements.py:217
↓ 1 callersFunctionget_operator
(name: str, **kwargs)
guided_diffusion/measurements.py:29
↓ 1 callersFunctionget_sampler
(name: str)
guided_diffusion/gaussian_diffusion.py:25
↓ 1 callersMethodget_target_tensor
Create label tensors with the same size as the input. Parameters: prediction (tensor) - - tpyically the prediction from a discrim
guided_diffusion/unet.py:1045
↓ 1 callersFunctionget_var_processor
(name: str, **kwargs)
guided_diffusion/posterior_mean_variance.py:145
↓ 1 callersMethodget_variance
(self, x, t)
guided_diffusion/posterior_mean_variance.py:156
↓ 1 callersFunctionifft2c_new
Apply centered 2-dimensional Inverse Fast Fourier Transform. Args: data: Complex valued input data containing at least 3 dimensions:
util/fastmri_utils.py:92
↓ 1 callersFunctionmain
()
sample_condition.py:25
↓ 1 callersFunctionmake_color_wheel
()
util/tools.py:434
↓ 1 callersFunctionmaster_params_to_model_params
Copy the master parameter data back into the model parameters.
guided_diffusion/fp16_util.py:63
↓ 1 callersFunctionmaster_params_to_state_dict
( model, param_groups_and_shapes, master_params, use_fp16 )
guided_diffusion/fp16_util.py:93
↓ 1 callersFunctionmodel_grads_to_master_grads
Copy the gradients from the model parameters into the master parameters from make_master_params().
guided_diffusion/fp16_util.py:50
↓ 1 callersFunctionnormalize
(img, s=0.95)
util/img_utils.py:235
↓ 1 callersMethodortho_project
(self, data, **kwargs)
guided_diffusion/measurements.py:46
↓ 1 callersMethodp_sample
(self, model, x, t)
guided_diffusion/gaussian_diffusion.py:209
↓ 1 callersFunctionparam_grad_or_zeros
(param)
guided_diffusion/fp16_util.py:139
↓ 1 callersFunctionpil_loader
(path)
util/tools.py:27
↓ 1 callersMethodpredict_eps_from_x_start
(self, x_t, t, pred_xstart)
guided_diffusion/gaussian_diffusion.py:403
↓ 1 callersMethodpredict_xstart
(self, x_t, t, x_prev)
guided_diffusion/posterior_mean_variance.py:58
↓ 1 callersMethodpredict_xstart
(self, x_t, t, eps)
guided_diffusion/posterior_mean_variance.py:120
↓ 1 callersMethodprepare_nonlinear_blur_model
Nonlinear deblur requires external codes (bkse).
guided_diffusion/measurements.py:180
↓ 1 callersFunctionpt_compute_color
(u, v)
util/tools.py:401
↓ 1 callersFunctionpt_make_color_wheel
()
util/tools.py:465
↓ 1 callersMethodpxt_given_x0
(self, x0, xt, t, verbose=False)
util/img_utils.py:319
↓ 1 callersMethodpy_given_x0
(self, x0, y, A, verbose=False)
util/img_utils.py:311
↓ 1 callersMethodq_posterior_mean
Compute the mean of the diffusion posteriro: q(x_{t-1} | x_t, x_0)
guided_diffusion/posterior_mean_variance.py:79
↓ 1 callersMethodq_posterior_mean
Compute the mean of the diffusion posteriro: q(x_{t-1} | x_t, x_0)
guided_diffusion/posterior_mean_variance.py:110
↓ 1 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:129
↓ 1 callersFunctionrandom_sq_bbox
Generate a random sqaure mask for inpainting
util/img_utils.py:157
↓ 1 callersFunctionreshape_patch
(x, crop_size=128, dim_size=3)
util/img_utils.py:93
next →1–100 of 290, ranked by callers