MCPcopy Create free account

hub / github.com/CompVis/diff2flow / functions

Functions426 in github.com/CompVis/diff2flow

↓ 46 callersMethodregister_buffer
(self, name, attr)
diff2flow/ddim.py:59
↓ 23 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 into
diff2flow/openai_diffusion/gaussian_diffusion.py:861
↓ 22 callersFunctionexists
(val)
diff2flow/helpers.py:61
↓ 19 callersFunctionextract_into_tensor
(a, t, x_shape)
diff2flow/ddpm.py:496
↓ 16 callersFunctioninstantiate_from_config
(config)
diff2flow/helpers.py:20
↓ 13 callersFunctionconv
(n_in, n_out, **kwargs)
diff2flow/tiny_autoencoder.py:10
↓ 13 callersFunctionconv_nd
Create a 1D, 2D, or 3D convolution module.
diff2flow/models/unet/util.py:115
↓ 10 callersFunctiongetattr_recursive
(obj: Any, path: str)
diff2flow/lora.py:5
↓ 9 callersMethod__init__
(self, channels, use_conv, dims=2, out_channels=None, padding=1)
diff2flow/models/unet/openaimodel.py:103
↓ 7 callersFunctionpad_v_like_x
Function to reshape the vector by the number of dimensions of x. E.g. x (bs, c, h, w), v (bs) -> v (bs, 1, 1, 1).
diff2flow/flow.py:25
↓ 6 callersMethod__init__
(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, attn_resolutions, dropout=0.0, resam
diff2flow/kl_autoencoder.py:251
↓ 6 callersMethod__init__
(self, dim_in, dim_out)
diff2flow/models/unet/attention.py:48
↓ 6 callersFunctionextract_into_tensor
(a, t, x_shape)
diff2flow/utils/diffusion_utils.py:56
↓ 6 callersMethodget_buffers_iter
(self, model)
diff2flow/ema.py:147
↓ 6 callersMethodget_params_iter
(self, model)
diff2flow/ema.py:141
↓ 6 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diff2flow/openai_diffusion/gaussian_diffusion.py:16
↓ 6 callersMethodq_sample
Diffuse the data for a given number of diffusion steps => sample x_t ~ q(x_t | x_0) with x_t = sqrt(alpha_bar_t) *
diff2flow/ddpm.py:199
↓ 5 callersFunctionNormalize
(in_channels, num_groups=32)
diff2flow/kl_autoencoder.py:41
↓ 5 callersFunctiondefault
(val, d)
diff2flow/models/unet/attention.py:29
↓ 5 callersMethoddrift
(self, x, t, model, **model_kwargs)
diff2flow/flow.py:231
↓ 5 callersMethodeval
(self)
diff2flow/ema.py:134
↓ 5 callersFunctionlinear
Create a linear module.
diff2flow/models/unet/util.py:128
↓ 5 callersFunctionnonlinearity
(x)
diff2flow/kl_autoencoder.py:35
↓ 5 callersFunctionnormalization
Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization.
diff2flow/models/unet/util.py:101
↓ 5 callersMethodupdate
(self)
diff2flow/ema.py:180
↓ 4 callersMethod__init__
( self, model="ViT-L/14", jit=False, device='cuda' if torch.cu
diff2flow/conditioning/encoders.py:13
↓ 4 callersMethod_wrap_model
(self, model)
diff2flow/openai_diffusion/respace.py:105
↓ 4 callersMethodcompute_sigma_t
Compute the noise coefficient along the path
diff2flow/flow.py:78
↓ 4 callersFunctionexists
(x)
diff2flow/models/unet/openaimodel.py:23
↓ 4 callersFunctionexists
(val)
diff2flow/models/unet/attention.py:21
↓ 4 callersFunctionmake_attn
(in_channels, attn_type="vanilla", natten_kernel_size=-1, use_null_attention=False)
diff2flow/kl_autoencoder.py:231
↓ 4 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diff2flow/ddpm.py:502
↓ 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
diff2flow/openai_diffusion/gaussian_diffusion.py:254
↓ 4 callersMethodq_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
diff2flow/openai_diffusion/gaussian_diffusion.py:232
↓ 3 callersMethod_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
diff2flow/openai_diffusion/gaussian_diffusion.py:341
↓ 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 allows
diff2flow/openai_diffusion/gaussian_diffusion.py:682
↓ 3 callersFunctioncheckpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
diff2flow/models/unet/util.py:17
↓ 3 callersMethodcompute_ut
Compute the time-dependent conditional vector field ut = alpha_dt_t * x1 + sigma_dt_t * x0, see Eq. (7) in [3].
diff2flow/flow.py:573
↓ 3 callersMethodcompute_xt
Sample from the time-dependent density p_t xt ~ N(alpha_t * x1 + sigma_t * x0, sigma_min * I), according to Eq. (1) in [3
diff2flow/flow.py:552
↓ 3 callersMethoddecode
(self, *args, **kwargs)
diff2flow/ema.py:232
↓ 3 callersMethoddecode_first_stage
(self, z: Tensor)
diff2flow/trainer_module.py:434
↓ 3 callersMethodencode_first_stage
(self, x)
diff2flow/trainer_module.py:425
↓ 3 callersMethodextract_from_batch
Takes batch and extracts data. Returns: x0: Samples from source distribution (can also be None if we start from noise).
diff2flow/trainer_module.py:448
↓ 3 callersFunctionfreeze
(model: nn.Module)
diff2flow/helpers.py:56
↓ 3 callersMethodgenerate
(self, *args, **kwargs)
diff2flow/ema.py:238
↓ 3 callersMethodmake_loader
(self, dataset_config, train=True)
diff2flow/dataloader.py:92
↓ 3 callersMethodmake_schedule
(self, ddim_num_steps, device, ddim_discretize="uniform", ddim_eta=0., verbose=False)
diff2flow/ddim.py:65
↓ 3 callersMethodmode
(self)
diff2flow/kl_autoencoder.py:82
↓ 3 callersMethodsample_vt
Sample the v-parameterized vector field at time t
diff2flow/flow_obj.py:82
↓ 3 callersFunctiontimestep_embedding
Create sinusoidal timestep embeddings. :param timesteps: a 1-D Tensor of N indices, one per batch element. These may be
diff2flow/models/unet/util.py:69
↓ 3 callersFunctionzero_module
Zero out the parameters of a module and return it.
diff2flow/models/unet/util.py:92
↓ 2 callersFunctionNormalize
(in_channels)
diff2flow/models/unet/attention.py:86
↓ 2 callersMethod__init__
kwargs must contain the output keys with their corresponding shapes, e.g. image=(3, 32, 32), label=(1,)
diff2flow/dataloader.py:265
↓ 2 callersMethod__init__
( self, in_channels: int, out_channels: int, kernel_size: Union[int, Tuple[int
diff2flow/lora.py:84
↓ 2 callersMethod_predict_xstart_from_eps
(self, x_t, t, eps)
diff2flow/openai_diffusion/gaussian_diffusion.py:334
↓ 2 callersFunction_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
diff2flow/openai_diffusion/gaussian_diffusion.py:58
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diff2flow/ddpm.py:526
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diff2flow/openai_diffusion/diffusion_utils.py:39
↓ 2 callersMethodcompute_alpha_t
(self, t)
diff2flow/flow.py:75
↓ 2 callersMethodcompute_drift
We always output sde according to score parametrization;
diff2flow/flow.py:86
↓ 2 callersMethodcondition_score
Compute what the p_mean_variance output would have been, should the model's score function be conditioned by cond_fn. See con
diff2flow/openai_diffusion/gaussian_diffusion.py:358
↓ 2 callersMethodconvert_fm_t_to_dm_t
Convert the continuous time t in [0,1] to discrete time t [0, 1000] # TODO: Make it compatible with zero-terminal SNR
diff2flow/flow_obj.py:103
↓ 2 callersMethodcopy_params_from_model_to_ema
(self)
diff2flow/ema.py:153
↓ 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
diff2flow/models/unet/openaimodel.py:330
↓ 2 callersFunctionexists
(val)
diff2flow/kl_autoencoder.py:25
↓ 2 callersFunctionexists
(v)
diff2flow/dataset/depth_utils.py:8
↓ 2 callersMethodforward
(self, x: Tensor, t: Tensor, cfg_scale=1.0, uc_cond=None, cond_key="y", **kwargs)
diff2flow/flow.py:444
↓ 2 callersFunctionforward_with_cfg
Function to include sampling with Classifier-Free Guidance (CFG)
diff2flow/flow.py:35
↓ 2 callersFunctionget_obj_from_str
(string, reload=False)
diff2flow/helpers.py:12
↓ 2 callersMethodget_unconditional_conditioning
(self, device="cuda")
diff2flow/conditioning/encoders.py:59
↓ 2 callersFunctionload_partial_from_config
(config)
diff2flow/helpers.py:26
↓ 2 callersFunctionnormal_kl
Compute the KL divergence between two gaussians.
diff2flow/ddpm.py:508
↓ 2 callersFunctionnormal_kl
Compute the KL divergence between two gaussians. Shapes are automatically broadcasted, so batches can be compared to scalars, among other
diff2flow/openai_diffusion/diffusion_utils.py:10
↓ 2 callersMethodp_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x_0.
diff2flow/ddpm.py:306
↓ 2 callersMethodp_sample_ddim
( self, model, x, t, index, use_origin
diff2flow/ddim.py:150
↓ 2 callersFunctionpad_vector_like_x
Function to reshape the vector by the number of dimensions of x. E.g. x (bs, c, h, w), v (bs) -> v (bs, 1, 1, 1). Args: x :
diff2flow/dataset/depth_utils.py:107
↓ 2 callersFunctionper_sample_min_max_normalization
Normalize each sample in a batch independently with min-max normalization to [0, 1]
diff2flow/visualizer.py:83
↓ 2 callersFunctionpercentile_per_sample
(x, percentile)
diff2flow/dataset/depth_utils.py:103
↓ 2 callersMethodpredict_eps_from_z_and_v
(self, x_t, t, v)
diff2flow/flow_obj.py:144
↓ 2 callersMethodpredict_start_from_z_and_v
(self, x_t, t, v)
diff2flow/flow_obj.py:138
↓ 2 callersMethodq_posterior
Compute the mean and variance of the diffusion posterior q(x_{t-1} | x_t, x_0)
diff2flow/ddpm.py:293
↓ 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 initial
diff2flow/openai_diffusion/gaussian_diffusion.py:215
↓ 2 callersMethodsample
Args: - sampling_method: type of sampler used in solving the SDE; default to be Euler-Maruyama - diffusion_form: function for
diff2flow/flow.py:303
↓ 2 callersMethodsample
(self)
diff2flow/kl_autoencoder.py:56
↓ 2 callersFunctionsetattr_recursive
(obj: Any, path: str, value: Any)
diff2flow/lora.py:16
↓ 2 callersFunctionsigmoid
(x)
diff2flow/diffusion.py:12
↓ 2 callersMethodstop_training_method
(self)
diff2flow/trainer_module.py:182
↓ 2 callersFunctiontensor2im
Args: tensor: Tensor of shape (..., 3, h, w) in range [-1, 1] or [0, 1] denormalize_zero_one: If True, denormalizes image from ra
diff2flow/visualizer.py:28
↓ 2 callersFunctionun_normalize_ims
Convert from [-1, 1] to [0, 255]
diff2flow/helpers.py:173
↓ 2 callersFunctionzero_module
Zero out the parameters of a module and return it.
diff2flow/models/unet/attention.py:77
↓ 1 callersFunctionDecoder
(latent_channels=4)
diff2flow/tiny_autoencoder.py:39
↓ 1 callersFunctionEncoder
(latent_channels=4)
diff2flow/tiny_autoencoder.py:29
↓ 1 callersMethod__get_sde_diffusion_and_drift
( self, diffusion_form="SBDM", diffusion_norm=1.0, )
diff2flow/flow.py:255
↓ 1 callersMethod__init__
(self, dt, drift, diffusion, sampler_type)
diff2flow/flow.py:187
↓ 1 callersMethod__init__
(self, n_in, n_out)
diff2flow/tiny_autoencoder.py:20
↓ 1 callersMethod__init__
( self, net_cfg: dict, timesteps: int = 1000, beta_schedule: s
diff2flow/diffusion.py:72
↓ 1 callersMethod__init__
(self)
diff2flow/metrics.py:21
↓ 1 callersMethod__init__
(self, key, resolution: int = 512, latent_dim: int = 4)
diff2flow/dataset/image_preprocessing.py:33
↓ 1 callersMethod__init__
(self, model, timestep_map, original_num_steps)
diff2flow/openai_diffusion/respace.py:118
↓ 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 dep
diff2flow/openai_diffusion/gaussian_diffusion.py:789
next →1–100 of 426, ranked by callers