MCPcopy Create free account

hub / github.com/YuchuanTian/DiC / functions

Functions186 in github.com/YuchuanTian/DiC

↓ 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
diffusion/gaussian_diffusion.py:861
↓ 11 callersMethodload
(cls, path: str, arr_name: str)
evaluator.py:499
↓ 10 callersMethod__init__
( self, input_size=32, in_channels=4, hidden_size=1152, depth=[2*
dic_models.py:342
↓ 6 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diffusion/gaussian_diffusion.py:16
↓ 4 callersMethod__init__
( self, input_size=32, patch_size=2, in_channels=4, hidden_size=1152,
models.py:149
↓ 4 callersMethod_wrap_model
(self, model)
diffusion/respace.py:105
↓ 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
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)
diffusion/gaussian_diffusion.py:232
↓ 3 callersMethod_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
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
diffusion/gaussian_diffusion.py:682
↓ 3 callersFunctioncreate_diffusion
( timestep_respacing, noise_schedule="linear", use_kl=False, sigma_small=False, predict_x
diffusion/__init__.py:10
↓ 3 callersFunctionextract_parser
(unparsed, d)
utils/parser_setter.py:32
↓ 3 callersFunctionmodulate
(x, shift, scale)
models.py:19
↓ 3 callersFunctionprintopt
(opt, level=0)
utils/parser_setter.py:56
↓ 2 callersFunction_batch_pairwise_distances
Compute pairwise distances between two batches of feature vectors.
evaluator.py:414
↓ 2 callersFunction_download_inception_model
()
evaluator.py:573
↓ 2 callersMethod_predict_xstart_from_eps
(self, x_t, t, eps)
diffusion/gaussian_diffusion.py:334
↓ 2 callersFunction_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
diffusion/gaussian_diffusion.py:58
↓ 2 callersFunctionapprox_standard_normal_cdf
A fast approximation of the cumulative distribution function of the standard normal.
diffusion/diffusion_utils.py:39
↓ 2 callersMethodcompute_activations
Compute image features for downstream evals. :param batches: a iterator over NHWC numpy arrays in [0, 255]. :return: a tuple
evaluator.py:142
↓ 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
diffusion/gaussian_diffusion.py:358
↓ 2 callersFunctioncreate_logger
Create a logger that writes to a log file and stdout.
train.py:66
↓ 2 callersFunctiondownload_model
Downloads a pre-trained DiT model from the web.
download.py:32
↓ 2 callersMethodevaluate_pr
Evaluate precision and recall efficiently. :param features_1: [N1 x D] feature vectors for reference batch. :param radii_1:
evaluator.py:325
↓ 2 callersMethodfrechet_distance
Compute the Frechet distance between two sets of statistics.
evaluator.py:72
↓ 2 callersFunctionget_1d_sincos_pos_embed_from_grid
embed_dim: output dimension for each position pos: a list of positions to be encoded: size (M,) out: (M, D)
models.py:303
↓ 2 callersMethodmanifold_radii
(self, features: np.ndarray)
evaluator.py:248
↓ 2 callersFunctionnorm_cdf
(x)
dic_models.py:52
↓ 2 callersFunctionnormal_kl
Compute the KL divergence between two gaussians. Shapes are automatically broadcasted, so batches can be compared to scalars, among other
diffusion/diffusion_utils.py:10
↓ 2 callersMethodpairwise_distances
Evaluate pairwise distances between two batches of feature vectors.
evaluator.py:393
↓ 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
diffusion/gaussian_diffusion.py:215
↓ 2 callersMethodread_activations
(self, npz_path: str)
evaluator.py:138
↓ 2 callersMethodread_statistics
( self, npz_path: str, activations: Tuple[np.ndarray, np.ndarray] )
evaluator.py:164
↓ 2 callersMethodsample
Importance-sample timesteps for a batch. :param batch_size: the number of timesteps. :param device: the torch device to save
diffusion/timestep_sampler.py:44
↓ 2 callersMethodtraining_losses
( self, model, *args, **kwargs )
diffusion/respace.py:94
↓ 2 callersFunctionupdate_ema
Step the EMA model towards the current model.
train.py:39
↓ 2 callersFunctionupdate_ema
Step the EMA model towards the current model.
train_accelerate.py:48
↓ 1 callersFunctionDiC_XL
(**kwargs)
dic_models.py:589
↓ 1 callersMethod__init__
(self, model, timestep_map, original_num_steps)
diffusion/respace.py:118
↓ 1 callersFunction_create_feature_graph
(input_batch)
evaluator.py:586
↓ 1 callersFunction_create_softmax_graph
(input_batch)
evaluator.py:603
↓ 1 callersFunction_no_grad_trunc_normal_
(tensor, mean, std, a, b)
dic_models.py:48
↓ 1 callersFunction_numpy_partition
(arr, kth, **kwargs)
evaluator.py:636
↓ 1 callersFunction_open_npy_file
(path: str, arr_name: str)
evaluator.py:564
↓ 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
diffusion/gaussian_diffusion.py:789
↓ 1 callersFunction_read_bytes
Copied from: https://github.com/numpy/numpy/blob/fb215c76967739268de71aa4bda55dd1b062bc2e/numpy/lib/format.py#L788-L886 Read from file-like
evaluator.py:534
↓ 1 callersFunction_update_shapes
(pool3)
evaluator.py:617
↓ 1 callersMethod_warmed_up
(self)
diffusion/timestep_sampler.py:149
↓ 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 = [
diffusion/gaussian_diffusion.py:125
↓ 1 callersFunctioncenter_crop_arr
Center cropping implementation from ADM. https://github.com/openai/guided-diffusion/blob/8fb3ad9197f16bbc40620447b2742e13458d2831/guided_diff
train.py:84
↓ 1 callersFunctioncenter_crop_arr
Center cropping implementation from ADM. https://github.com/openai/guided-diffusion/blob/8fb3ad9197f16bbc40620447b2742e13458d2831/guided_diff
train_accelerate.py:83
↓ 1 callersFunctioncleanup
End DDP training.
train.py:59
↓ 1 callersMethodcompute_inception_score
(self, activations: np.ndarray, split_size: int = 5000)
evaluator.py:179
↓ 1 callersMethodcompute_prec_recall
( self, activations_ref: np.ndarray, activations_sample: np.ndarray )
evaluator.py:194
↓ 1 callersMethodcompute_statistics
(self, activations: np.ndarray)
evaluator.py:174
↓ 1 callersMethodcondition_mean
Compute the mean for the previous step, given a function cond_fn that computes the gradient of a conditional log probability with res
diffusion/gaussian_diffusion.py:346
↓ 1 callersFunctioncreate_logger
Create a logger that writes to a log file and stdout.
train_accelerate.py:69
↓ 1 callersFunctioncreate_npz_from_sample_folder
Builds a single .npz file from a folder of .png samples.
sample_ddp.py:37
↓ 1 callersMethodddim_sample
Sample x_{t-1} from the model using DDIM. Same usage as p_sample().
diffusion/gaussian_diffusion.py:513
↓ 1 callersMethodddim_sample_loop_progressive
Use DDIM to sample from the model and yield intermediate samples from each timestep of DDIM. Same usage as p_sample_loop_prog
diffusion/gaussian_diffusion.py:633
↓ 1 callersFunctiondiscretized_gaussian_log_likelihood
Compute the log-likelihood of a Gaussian distribution discretizing to a given image. :param x: the target images. It is assumed that this
diffusion/diffusion_utils.py:62
↓ 1 callersFunctionfind_model
Finds a pre-trained DiT model, downloading it if necessary. Alternatively, loads a model from a local path.
download.py:18
↓ 1 callersMethodforward
Forward pass of DiT. x: (N, C, H, W) tensor of spatial inputs (images or latent representations of images) t: (N,) tensor of
models.py:233
↓ 1 callersMethodforward
(self, x, t, y)
dic_models.py:498
↓ 1 callersMethodgen_fn
()
evaluator.py:443
↓ 1 callersFunctionget_2d_sincos_pos_embed
grid_size: int of the grid height and width return: pos_embed: [grid_size*grid_size, embed_dim] or [1+grid_size*grid_size, embed_dim] (w/
models.py:274
↓ 1 callersFunctionget_2d_sincos_pos_embed_from_grid
(embed_dim, grid)
models.py:292
↓ 1 callersFunctionget_beta_schedule
This is the deprecated API for creating beta schedules. See get_named_beta_schedule() for the new library of schedules.
diffusion/gaussian_diffusion.py:65
↓ 1 callersMethodinitialize_weights
(self)
models.py:182
↓ 1 callersMethodinitialize_weights
(self)
dic_models.py:433
↓ 1 callersFunctionkey_dealer
Insert s without opt_
utils/parser_setter.py:28
↓ 1 callersMethodless_thans
(self, batch_1, radii_1, batch_2, radii_2)
evaluator.py:402
↓ 1 callersFunctionmain
Trains a new DiT model.
train.py:109
↓ 1 callersFunctionmain
()
evaluator.py:27
↓ 1 callersFunctionmain
Trains a new DiT model.
train_accelerate.py:108
↓ 1 callersFunctionmain
Run sampling.
sample_ddp.py:54
↓ 1 callersFunctionmodulate
(x, shift, scale)
dic_models.py:111
↓ 1 callersFunctionopen_npz_array
(path: str, arr_name: str)
evaluator.py:517
↓ 1 callersFunctionopt_setter
(d, key, value)
utils/parser_setter.py:16
↓ 1 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
diffusion/gaussian_diffusion.py:376
↓ 1 callersMethodp_sample_loop
Generate samples from the model. :param model: the model module. :param shape: the shape of the samples, (N, C, H, W).
diffusion/gaussian_diffusion.py:419
↓ 1 callersMethodp_sample_loop_progressive
Generate samples from the model and yield intermediate samples from each timestep of diffusion. Arguments are the same as p_s
diffusion/gaussian_diffusion.py:464
↓ 1 callersMethodq_mean_variance
Get the distribution q(x_t | x_0). :param x_start: the [N x C x ...] tensor of noiseless inputs. :param t: the number of diff
diffusion/gaussian_diffusion.py:203
↓ 1 callersMethodread_batch
(self, batch_size: int)
evaluator.py:435
↓ 1 callersMethodread_batches
(self, batch_size: int)
evaluator.py:442
↓ 1 callersMethodremaining
(self)
evaluator.py:439
↓ 1 callersFunctionrequires_grad
Set requires_grad flag for all parameters in a model.
train.py:51
↓ 1 callersFunctionrequires_grad
Set requires_grad flag for all parameters in a model.
train_accelerate.py:61
↓ 1 callersFunctionspace_timesteps
Create a list of timesteps to use from an original diffusion process, given the number of timesteps we want to take from equally-sized portio
diffusion/respace.py:12
↓ 1 callersMethodtimestep_embedding
Create sinusoidal timestep embeddings. :param t: a 1-D Tensor of N indices, one per batch element. These ma
models.py:41
↓ 1 callersMethodtimestep_embedding
Create sinusoidal timestep embeddings. :param t: a 1-D Tensor of N indices, one per batch element. These
dic_models.py:132
↓ 1 callersMethodtoken_drop
Drops labels to enable classifier-free guidance.
models.py:78
↓ 1 callersMethodtoken_drop
Drops labels to enable classifier-free guidance.
dic_models.py:169
↓ 1 callersMethodunpatchify
x: (N, T, patch_size**2 * C) imgs: (N, H, W, C)
models.py:218
↓ 1 callersMethodupdate_with_all_losses
Update the reweighting using losses from a model. Sub-classes should override this method to update the reweighting using los
diffusion/timestep_sampler.py:106
↓ 1 callersMethodwarmup
(self)
evaluator.py:135
↓ 1 callersMethodweights
Get a numpy array of weights, one per diffusion step. The weights needn't be normalized, but must be positive.
diffusion/timestep_sampler.py:38
FunctionDiC_B
(**kwargs)
dic_models.py:592
FunctionDiC_H
(**kwargs)
dic_models.py:586
FunctionDiC_S
(**kwargs)
dic_models.py:595
next →1–100 of 186, ranked by callers