MCPcopy Create free account

hub / github.com/LTH14/mar / functions

Functions149 in github.com/LTH14/mar

↓ 48 callersFunctionprint
(*args, **kwargs)
util/misc.py:172
↓ 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:865
↓ 6 callersMethod__init__
( self, *, ch=128, out_ch=3, ch_mult=(1, 1, 2, 2, 4), num_res_
models/vae.py:162
↓ 6 callersMethodload_state_dict
(self, state_dict)
util/misc.py:272
↓ 6 callersFunctionmean_flat
Take the mean over all non-batch dimensions.
diffusion/gaussian_diffusion.py:16
↓ 6 callersMethodstate_dict
(self)
util/misc.py:269
↓ 5 callersFunctionNormalize
(in_channels, num_groups=32)
models/vae.py:13
↓ 5 callersFunctionnonlinearity
(x)
models/vae.py:8
↓ 4 callersMethod__init__
(self, target_channels, z_channels, depth, width, num_sampling_steps, grad_checkpointing=False)
models/diffloss.py:11
↓ 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:686
↓ 3 callersMethodencode
(self, x)
models/vae.py:473
↓ 3 callersFunctionevaluate
(model_without_ddp, vae, ema_params, args, epoch, batch_size=16, log_writer=None, cfg=1.0, use_em
engine_mar.py:104
↓ 3 callersFunctionis_dist_avail_and_initialized
()
util/misc.py:183
↓ 3 callersMethodupdate
(self, **kwargs)
util/misc.py:87
↓ 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 callersFunctioncenter_crop_arr
Center cropping implementation from ADM. https://github.com/openai/guided-diffusion/blob/8fb3ad9197f16bbc40620447b2742e13458d2831/guided_diff
util/crop.py:5
↓ 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_diffusion
( timestep_respacing, noise_schedule="linear", use_kl=False, sigma_small=False, predict_x
diffusion/__init__.py:11
↓ 2 callersMethodforward_mae_decoder
(self, x, mask)
models/mar.py:206
↓ 2 callersMethodforward_mae_encoder
(self, x, mask, class_embedding)
models/mar.py:172
↓ 2 callersFunctionget_world_size
()
util/misc.py:191
↓ 2 callersMethodlog_every
(self, iterable, print_freq, header=None)
util/misc.py:119
↓ 2 callersFunctionmodulate
(x, shift, scale)
models/diffloss.py:55
↓ 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 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 callersMethodsample_orders
(self, bsz)
models/mar.py:152
↓ 2 callersFunctionsetup_for_distributed
This function disables printing when not in master process
util/misc.py:166
↓ 2 callersMethodupdate
(self, value, n=1)
util/misc.py:33
↓ 1 callersMethod__init__
(self, model, timestep_map, original_num_steps)
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
diffusion/gaussian_diffusion.py:793
↓ 1 callersMethodadd_meter
(self, name, meter)
util/misc.py:116
↓ 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 callersFunctioncache_latents
(vae, data_loader: Iterable, device: torch.device, args=
engine_mar.py:224
↓ 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 callersMethodddim_sample
Sample x_{t-1} from the model using DDIM. Same usage as p_sample().
diffusion/gaussian_diffusion.py:519
↓ 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:639
↓ 1 callersMethoddecode
(self, z)
models/vae.py:481
↓ 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:47
↓ 1 callersFunctiondownload_pretrained_marb
(overwrite=False)
util/download.py:19
↓ 1 callersFunctiondownload_pretrained_marh
(overwrite=False)
util/download.py:45
↓ 1 callersFunctiondownload_pretrained_marl
(overwrite=False)
util/download.py:32
↓ 1 callersFunctiondownload_pretrained_vae
(overwrite=False)
util/download.py:6
↓ 1 callersFunctionfind_cuda
()
demo/gradio_app.py:9
↓ 1 callersMethodforward
Apply the model to an input batch. :param x: an [N x C] Tensor of inputs. :param t: a 1-D batch of timesteps. :param
models/diffloss.py:217
↓ 1 callersMethodforward_loss
(self, z, target, mask)
models/mar.py:232
↓ 1 callersFunctionget_args_parser
()
main_cache.py:22
↓ 1 callersFunctionget_args_parser
()
main_mar.py:25
↓ 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 callersFunctionget_grad_norm_
(parameters, norm_type: float = 2.0)
util/misc.py:276
↓ 1 callersFunctionget_rank
()
util/misc.py:197
↓ 1 callersMethodinit_from_ckpt
(self, path)
models/vae.py:463
↓ 1 callersMethodinitialize_weights
(self)
models/diffloss.py:194
↓ 1 callersMethodinitialize_weights
(self)
models/mar.py:107
↓ 1 callersFunctionis_main_process
()
util/misc.py:203
↓ 1 callersFunctionmain
(args)
main_cache.py:61
↓ 1 callersFunctionmain
(args)
main_mar.py:136
↓ 1 callersFunctionmask_by_order
(mask_len, order, bsz, seq_len)
models/mar.py:16
↓ 1 callersMethodmax
(self)
util/misc.py:66
↓ 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:422
↓ 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:470
↓ 1 callersMethodpatchify
(self, x)
models/mar.py:131
↓ 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 callersMethodrandom_masking
(self, x, orders)
models/mar.py:162
↓ 1 callersMethodsample
(self)
models/vae.py:412
↓ 1 callersMethodsample
(self, z, temperature=1.0, cfg=1.0)
models/diffloss.py:35
↓ 1 callersMethodsample_tokens
(self, bsz, num_iter=64, cfg=1.0, cfg_schedule="linear", labels=None, temperature=1.0, progress=False)
models/mar.py:262
↓ 1 callersFunctionsave_on_master
(*args, **kwargs)
util/misc.py:207
↓ 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 callersMethodsynchronize_between_processes
(self)
util/misc.py:112
↓ 1 callersMethodtimestep_embedding
Create sinusoidal timestep embeddings. :param t: a 1-D Tensor of N indices, one per batch element. These ma
models/diffloss.py:73
↓ 1 callersFunctiontrain_one_epoch
(model, vae, model_params, ema_params, data_loader: Iterable, optimize
engine_mar.py:32
↓ 1 callersMethodtraining_losses
( self, model, *args, **kwargs )
diffusion/respace.py:94
↓ 1 callersMethodunpatchify
(self, x)
models/mar.py:141
↓ 1 callersFunctionupdate_ema
Update target parameters to be closer to those of source parameters using an exponential moving average. :param target_params: the targe
engine_mar.py:19
Method__call__
(self, x, ts, **kwargs)
diffusion/respace.py:124
Method__call__
(self, loss, optimizer, clip_grad=None, parameters=None, create_graph=False, update_grad=True)
util/misc.py:253
Method__getattr__
(self, attr)
util/misc.py:96
Method__getitem__
Args: index (int): Index Returns: tuple: (sample, target, filename).
util/loader.py:9
Method__getitem__
Args: index (int): Index Returns: tuple: (moments, target).
util/loader.py:40
Method__init__
( self, *, betas, model_mean_type, model_var_type, loss_type
diffusion/gaussian_diffusion.py:153
Method__init__
(self, use_timesteps, **kwargs)
diffusion/respace.py:73
Method__init__
(self, in_channels, with_conv)
models/vae.py:20
Method__init__
(self, in_channels, with_conv)
models/vae.py:36
Method__init__
( self, *, in_channels, out_channels=None, conv_shortcut=False,
models/vae.py:56
Method__init__
(self, in_channels)
models/vae.py:116
Method__init__
( self, *, ch=128, out_ch=3, ch_mult=(1, 1, 2, 2, 4), num_res_
models/vae.py:276
Method__init__
(self, parameters, deterministic=False)
models/vae.py:400
Method__init__
(self, embed_dim, ch_mult, use_variational=True, ckpt_path=None)
models/vae.py:451
Method__init__
(self, hidden_size, frequency_embedding_size=256)
models/diffloss.py:63
Method__init__
( self, channels )
models/diffloss.py:105
Method__init__
(self, model_channels, out_channels)
models/diffloss.py:135
Method__init__
( self, in_channels, model_channels, out_channels, z_channels,
models/diffloss.py:161
Method__init__
(self, img_size=256, vae_stride=16, patch_size=1, encoder_embed_dim=1024, encoder_depth=16, e
models/mar.py:25
next →1–100 of 149, ranked by callers