MCPcopy Create free account

hub / github.com/apple/ml-4m / functions

Functions1,193 in github.com/apple/ml-4m

↓ 4 callersMethodpostprocess
(self, sample)
fourm/data/modality_transforms.py:240
↓ 4 callersFunctionprepare_inputs
Resize images, extract features, etc. Args: x: Input dict. domain: Domain we are training on. feature_extractor: Optiona
run_training_vqvae.py:881
↓ 4 callersMethodpreprocess
(self, sample)
fourm/data/modality_transforms.py:226
↓ 4 callersMethodsample_tokens
(self, logits, temperature=1.0, top_k=0.0, top_p=0.0)
fourm/models/generate.py:361
↓ 4 callersMethodsample_tokens_batched
(self, logits, temperature=1.0, top_k=0.0, top_p=0.0)
fourm/models/generate.py:373
↓ 4 callersFunctionsetup_sampling_mod_info
(dataset_config, modality_info)
fourm/data/pretrain_utils.py:29
↓ 4 callersFunctionsoftmax1
(tensor)
fourm/models/fm_utils.py:28
↓ 4 callersFunctiontrunc_normal_
r"""Fills the input Tensor with values drawn from a truncated normal distribution. The values are effectively drawn from the normal distributi
fourm/vq/models/vit_models.py:91
↓ 4 callersFunctionvisualize_bboxes
Visualizes bounding boxes on the image. Args: img (np.array): Image to draw bounding boxes on. bboxes_str (str): String cont
fourm/utils/plotting_utils.py:1042
↓ 3 callersMethod__init__
( self, input_dim: int, hidden_dim: int, num_hidden_layers: int, outpu
fourm/utils/hmr2_utils/hmr2/models/components/t_cond_mlp.py:145
↓ 3 callersMethod__init__
(self, image_size: int = 224, image_size_enc: Optional[int] = None,
fourm/vq/vqvae.py:78
↓ 3 callersMethod__init__
(self, use_dropout=True)
fourm/vq/percept_losses/lpips.py:68
↓ 3 callersMethod__init__
(self, num_channels: int, patch_size: Union[int, Tuple[int,int]],
fourm/models/encoder_embeddings.py:229
↓ 3 callersMethod_get_variance
(self, t, predicted_variance=None, variance_type=None)
fourm/vq/scheduling/scheduling_ddpm.py:222
↓ 3 callersMethodattention
(self, x: torch.Tensor)
fourm/utils/clip/model.py:199
↓ 3 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 = [
fourm/vq/scheduling/scheduling_pndm.py:30
↓ 3 callersFunctionbuild_1d_sincos_posemb
Sine-cosine positional embeddings from MoCo-v3, adapted back to 1d Returns positional embedding of shape (1, N, D)
fourm/models/fm_utils.py:32
↓ 3 callersFunctionbuild_2d_sincos_posemb
Sine-cosine positional embeddings as used in MoCo-v3 Returns positional embedding of shape (1, N, D) where N = W*H
fourm/models/fm_utils.py:46
↓ 3 callersFunctionbuild_wds_divae_dataloader
( data_path, modality_info, modality_transforms, image_augmenter, num_gpus, num_workers, batch_size,
fourm/data/unified_datasets.py:398
↓ 3 callersFunctioncreate_raymond_lights
Return raymond light nodes for the scene.
fourm/utils/hmr2_utils/hmr2/utils/renderer.py:113
↓ 3 callersMethoddecode_quant
Decodes quantized latent codes back to an image. Args: quant: Quantized latent code of shape B D_Q H_Q W_Q Returns:
fourm/vq/vqvae.py:346
↓ 3 callersFunctioneval_image_log
(model, data_loader, device, domain, eval_size, noise_schedule, num_diffusion_steps, dtype
run_training_vqcontrolnet.py:1192
↓ 3 callersFunctioneval_image_log
Log several reconstructed images to wandb. Args: model: Model to evaluate. data_loader: Validation set data loader. devic
run_training_divae.py:1497
↓ 3 callersFunctioneval_image_log
Log several reconstructed images to wandb. Args: model: Model to evaluate. feature_extractor: Optional feature extractor.
run_training_vqvae.py:1653
↓ 3 callersFunctioneval_metrics
(model, data_loader, device, domain, eval_size, noise_schedule, num_diffusion_steps, dtype=t
run_training_vqcontrolnet.py:1077
↓ 3 callersFunctioneval_metrics
Compute validation image metrics (FID, LPIPS, Inception, MS-SSIM, PSNR, MSE) using torchmetrics and compute codebook usage stats. Args:
run_training_divae.py:1283
↓ 3 callersFunctioneval_metrics
Compute validation image metrics (FID, LPIPS, Inception, MS-SSIM, PSNR, MSE) using torchmetrics and compute codebook usage stats. Args:
run_training_vqvae.py:1427
↓ 3 callersFunctionevaluate
(model, data_loader, device, domain, train_res_choices, prediction_type, loss_fn, codebook_weigh
run_training_vqcontrolnet.py:1018
↓ 3 callersFunctionevaluate
Perform one evaluation epoch and return stats. As during training, the resolution is randomly sampled from train_res_choices. Args:
run_training_divae.py:1188
↓ 3 callersFunctionevaluate
Perform one evaluation epoch and return stats. As during training, the resolution is randomly sampled from train_res_choices. Args:
run_training_vqvae.py:1344
↓ 3 callersMethodforward_mask_decoder_autoregressive
(self, mod_dict, target_mod, seed=None)
fourm/models/generate.py:516
↓ 3 callersMethodfrom_pretrained
(cls, name="vgg_lpips")
fourm/vq/percept_losses/lpips.py:88
↓ 3 callersMethodget_alpha_sigma_sqrts
(self, timesteps, device, dtype, shape)
fourm/vq/scheduling/scheduling_ddpm.py:392
↓ 3 callersMethodget_alpha_sigma_sqrts
(self, timesteps, device, dtype, shape)
fourm/vq/scheduling/scheduling_ddim.py:373
↓ 3 callersMethodhflip
Horizontal flipping the instances in a sample.
fourm/data/modality_transforms.py:507
↓ 3 callersMethodimage_augment
(self, img, crop_coords: Tuple, flip: bool, orig_size: Tuple, target_size: Tuple, rand_
fourm/data/modality_transforms.py:234
↓ 3 callersFunctionis_dist_avail_and_initialized
()
fourm/utils/dist.py:46
↓ 3 callersFunctionis_main_process
()
fourm/utils/dist.py:66
↓ 3 callersFunctionlinear
Create a linear module.
fourm/vq/models/unet/nn.py:48
↓ 3 callersFunctionlinear_norm_activ_dropout
( input_dim: int, output_dim: int, activation: torch.nn.Module = torch.nn.ReLU(), bias: bool =
fourm/utils/hmr2_utils/hmr2/models/components/t_cond_mlp.py:67
↓ 3 callersFunctionmerge_span_masking
(input_seq, decoder_seq, sentinel_ids)
fourm/utils/tokenizer/text_tokenizer.py:127
↓ 3 callersFunctionremove_spines
Removes the spines from the given axis. Args: ax (matplotlib.axes.Axes): Axis to remove spines from
fourm/utils/plotting_utils.py:851
↓ 3 callersFunctionsample_uniform
Sample a value from a uniform distribution between min_val and max_val Args: min_val: Minimum value max_val: Maximum value R
fourm/data/masking.py:44
↓ 3 callersMethodselect_tokens_batched
(self, logits, num_select, temperature=1.0, top_k=0.0, top_p=0.0, return_all_samples=False)
fourm/models/generate.py:393
↓ 3 callersMethodtop_k_top_p_filtering
(self, logits, top_k=0.0, top_p=0.0)
fourm/models/generate.py:332
↓ 2 callersMethod__init__
(self, in_channels, cond_channels, sd_pipeline, image_size, freez
fourm/vq/models/controlnet.py:103
↓ 2 callersMethod__init__
(self, dim_in, dim_out, widths)
fourm/vq/models/mlp_models.py:36
↓ 2 callersMethod__init__
( self, dim, codebook_size, codebook_dim = None, heads = 1, de
fourm/vq/quantizers/quantize_lucid.py:433
↓ 2 callersFunction_add_submodule
(module, name, submodule)
fourm/utils/timm/model.py:207
↓ 2 callersMethod_compute_norms
(self, grad_scale=1.0)
fourm/vq/models/unet/fp16_util.py:230
↓ 2 callersMethod_encode_prompt
(self, prompt)
fourm/vq/models/controlnet.py:229
↓ 2 callersMethod_erase
(self, img, chan, img_h, img_w, dtype)
fourm/utils/timm/random_erasing.py:73
↓ 2 callersFunction_find_modules
Find all modules of a certain class (or union of classes) that are direct or indirect descendants of other modules of a certain class (or uni
fourm/models/lora_utils.py:84
↓ 2 callersMethod_freeze_stages
Freeze parameters.
fourm/utils/hmr2_utils/hmr2/models/backbones/vit.py:264
↓ 2 callersFunction_freeze_unfreeze
Freeze or unfreeze parameters of the specified modules and those of all their hierarchical descendants. This is done in place. Args:
fourm/utils/timm/model.py:171
↓ 2 callersMethod_get_pipeline
Creates a conditional diffusion pipeline with the given scheduler. Args: scheduler: Scheduler to use for the diffusion pipeline.
fourm/vq/vqvae.py:642
↓ 2 callersMethod_get_prev_sample
(self, sample, timestep, prev_timestep, model_output)
fourm/vq/scheduling/scheduling_pndm.py:401
↓ 2 callersMethod_load_checkpoint
(self, checkpoint_path)
fourm/utils/timm/model_ema.py:53
↓ 2 callersMethod_params_per_batch
(self)
fourm/utils/timm/mixup.py:146
↓ 2 callersFunction_transform
(n_px)
fourm/utils/clip/clip.py:83
↓ 2 callersMethod_update
(self, model, update_fn)
fourm/utils/timm/model_ema.py:121
↓ 2 callersMethodadd_lighting
(self, scene, cam_node, color=np.ones(3), intensity=1.0)
fourm/utils/hmr2_utils/hmr2/utils/renderer.py:367
↓ 2 callersMethodadd_point_lighting
(self, scene, cam_node, color=np.ones(3), intensity=1.0)
fourm/utils/hmr2_utils/hmr2/utils/renderer.py:383
↓ 2 callersFunctionalpha_bar
(time_step)
fourm/vq/scheduling/scheduling_utils.py:68
↓ 2 callersFunctionalpha_bar_fn
(t)
fourm/vq/scheduling/scheduling_pndm.py:55
↓ 2 callersMethodautoregressive_step_batched
(self, mod_dict, target_mod, temperature, top_k: Union[float, int], top_p: float,
fourm/models/generate.py:850
↓ 2 callersMethodbackward
(ctx, *output_grads)
fourm/vq/models/unet/nn.py:162
↓ 2 callersFunctionbuild_2d_sincos_posemb
Sine-cosine positional embeddings as used in MoCo-v3 Returns positional embedding of shape [B, H, W, D]
fourm/vq/models/uvit.py:51
↓ 2 callersFunctionbuild_2d_sincos_posemb
Sine-cosine positional embeddings as used in MoCo-v3
fourm/vq/models/vit_models.py:38
↓ 2 callersFunctionbuild_fm_pretraining_dataset
Builds the FourM pre-training dataset based on the given arguments. This function should mainly used for smaller datasets (e.g. validation sets),
fourm/data/unified_datasets.py:48
↓ 2 callersFunctionbuild_huggingface_pretraining_dataloader
( data_path, all_domains, modality_info, modality_transforms, image_augmenter, text_tokenizer
fourm/data/unified_datasets.py:445
↓ 2 callersFunctionbuild_mixture_dataloader
(data_iters, weights, modality_info, batch_size, num_workers, epoch_size, num_gpus)
fourm/data/unified_datasets.py:549
↓ 2 callersFunctionbuild_mlp
Constructs an MLP model from a model ID string, see "Scaling MLPs: A Tale of Inductive Bias" (https://arxiv.org/abs/2306.13575). Args:
fourm/vq/models/mlp_models.py:118
↓ 2 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
fourm/utils/clip/simple_tokenizer.py:21
↓ 2 callersMethodcat_encoder_tensors
Concatenate encoder tensors from different modalities. Args: mod_dict (dict): A dictionary containing information for each modali
fourm/models/fm.py:245
↓ 2 callersFunctioncheckpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
fourm/vq/models/unet/nn.py:134
↓ 2 callersFunctioncompute_codebook_usage
Computes the codebook usage for a given set of encoded tokens, by computing the percentage of unique tokens in windows of a given size. The windo
fourm/vq/vq_utils.py:18
↓ 2 callersFunctioncompute_reconst_loss
Reconstruction loss computation. Args: model_output: Model predictions. images: Target. loss_fn: Loss function to use. Ca
run_training_vqvae.py:961
↓ 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
fourm/vq/models/unet/unet.py:325
↓ 2 callersFunctioncreate_model
Create a model Args: model_name (str): name of model to instantiate pretrained (bool): load pretrained ImageNet-1k weights if tru
fourm/utils/timm/model_builder.py:27
↓ 2 callersFunctiondecode_tok_rgb
Decodes a sequence of RGB tokens from a model dictionary into an RGB image. Args: mod_dict (dict): Model output dictionary.
fourm/utils/plotting_utils.py:105
↓ 2 callersFunctiondefault
(val, d)
fourm/utils/hmr2_utils/hmr2/models/components/pose_transformer.py:26
↓ 2 callersFunctiondrop_path
Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks). This is the same as the DropConnect impl I created for Ef
fourm/vq/models/uvit.py:70
↓ 2 callersFunctionenforce_zero_terminal_snr
Scales the noise schedule betas so that last time step has zero SNR. See https://arxiv.org/abs/2305.08891 Args: betas: the initial di
fourm/vq/scheduling/scheduling_utils.py:19
↓ 2 callersFunctionexists
(val)
fourm/vq/quantizers/quantize_lucid.py:26
↓ 2 callersMethodfn
(x, xn)
fourm/data/modality_transforms.py:429
↓ 2 callersMethodfreeze_params_except_specific_embeddings
(self, frozen_embedding_domain)
fourm/models/fm.py:766
↓ 2 callersMethodfreeze_shared_params
(self)
fourm/models/fm.py:762
↓ 2 callersMethodget_bbox
Gets bounding box of the given instance
fourm/data/modality_transforms.py:391
↓ 2 callersFunctionget_ckpt_path
(name, root, check=False)
fourm/vq/percept_losses/lpips.py:56
↓ 2 callersFunctionget_crop_size
Returns the crop heights and widths from the crop coordinates.
run_training_divae.py:86
↓ 2 callersFunctionget_grad_norm_
(parameters, norm_type: float = 2.0)
fourm/utils/native_scaler.py:56
↓ 2 callersFunctionget_light_poses
(n_lights=5, elevation=np.pi / 3, dist=12)
fourm/utils/hmr2_utils/hmr2/utils/renderer.py:32
↓ 2 callersMethodget_noise
( self, sample: torch.FloatTensor, velocity: torch.FloatTensor, timesteps: torch.IntTensor )
fourm/vq/scheduling/scheduling_ddpm.py:423
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
fourm/utils/clip/simple_tokenizer.py:43
↓ 2 callersFunctionget_param_groups_and_shapes
(named_model_params)
fourm/vq/models/unet/fp16_util.py:102
↓ 2 callersMethodget_params
Get parameters for ``crop`` for a random sized crop. Args: img (PIL Image): Image to be cropped. scale (tuple): range
fourm/utils/timm/transforms.py:96
↓ 2 callersFunctionget_rank
()
fourm/utils/dist.py:60
↓ 2 callersFunctionget_train_dataloader
(dataset_config, modality_info, sampling_weights, text_tokenizer, input_size, num_in
fourm/data/pretrain_utils.py:84
↓ 2 callersFunctionget_transform
(mod_name, transforms_dict)
fourm/data/modality_transforms.py:46
← previousnext →101–200 of 1,193, ranked by callers