MCPcopy Create free account

hub / github.com/SHI-Labs/Versatile-Diffusion / functions

Functions773 in github.com/SHI-Labs/Versatile-Diffusion

↓ 70 callersMethodto
(self, device)
lib/model_zoo/vd.py:114
↓ 35 callersMethodregister_buffer
(self, name, attr)
lib/model_zoo/ddim.py:17
↓ 29 callersFunctionconv_nd
Create a 1D, 2D, or 3D convolution module.
lib/model_zoo/diffusion_utils.py:193
↓ 24 callersMethod__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:317
↓ 24 callersFunctionlinear
Create a linear module.
lib/model_zoo/diffusion_utils.py:205
↓ 23 callersFunctionnormalization
Make a standard normalization layer. :param channels: number of input channels. :return: an nn.Module for normalization.
lib/model_zoo/diffusion_utils.py:175
↓ 22 callersMethod__init__
( self, channels, emb_channels, dropout, out_channels=None, us
lib/model_zoo/openaimodel.py:2085
↓ 22 callersFunctionprint_log
(*console_info)
lib/log_service.py:15
↓ 19 callersMethodload
(module, prefix='')
lib/model_zoo/optimus_models/modeling_utils.py:368
↓ 18 callersFunctionzero_module
Zero out the parameters of a module and return it.
lib/model_zoo/attention.py:67
↓ 16 callersMethodadd_data_layer
(self, layer)
lib/model_zoo/openaimodel.py:2760
↓ 15 callersMethod__init__
(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, attn_resolutions, dropout=0.0, resam
lib/model_zoo/diffusion_modules.py:217
↓ 15 callersMethod__init__
(self, *, ch, out_ch, ch_mult=(1,2,4,8), num_res_blocks, attn_resolutions, dropout=0.0, resam
lib/model_zoo/autokl_modules.py:217
↓ 14 callersMethodconvert_tokens_to_ids
Converts a single token, or a sequence of tokens, (str/unicode) in a single integer id (resp. a sequence of ids), using the vocabulary.
lib/model_zoo/optimus_models/tokenization_utils.py:636
↓ 14 callersMethodctx_encode
(self, x, which, **kwargs)
lib/model_zoo/vd.py:301
↓ 14 callersFunctiontimestep_embedding
Create sinusoidal timestep embeddings. :param timesteps: a 1-D Tensor of N indices, one per batch element. These may be
lib/model_zoo/diffusion_utils.py:131
↓ 11 callersMethodinit_weights
Initialize and prunes weights if needed.
lib/model_zoo/optimus_models/optimus_bert.py:1358
↓ 11 callersMethodregister
(self, name, unitf,)
lib/model_zoo/common/utils.py:57
↓ 10 callersFunctionnonlinearity
(x)
lib/model_zoo/diffusion_modules.py:33
↓ 10 callersFunctionnonlinearity
(x)
lib/model_zoo/autokl_modules.py:33
↓ 10 callersMethodsave
(self, net, itern=None, epochn=None, samplen=None, is_init=False, is_best=False, is_last=False,
lib/utils.py:326
↓ 9 callersFunctionNormalize
(in_channels, num_groups=32)
lib/model_zoo/diffusion_modules.py:38
↓ 9 callersFunctionNormalize
(in_channels, num_groups=32)
lib/model_zoo/autokl_modules.py:38
↓ 9 callersMethod__init__
(self, dim_in, dim_out)
lib/model_zoo/attention.py:38
↓ 9 callersMethod__init__
(self, n_state, config)
lib/model_zoo/optimus_models/optimus_gpt2.py:211
↓ 8 callersFunctioncfg_solve
(cfg, cfg_root)
lib/cfg_helper.py:84
↓ 8 callersMethodsample
(self, steps, shape, x_info, c_info,
lib/model_zoo/ddim.py:59
↓ 7 callersMethod__init__
Conv1D layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2) Basically works like a Linear layer but the weights are
lib/model_zoo/optimus_models/modeling_utils.py:409
↓ 7 callersMethodbarrier
(self)
lib/sync.py:160
↓ 7 callersMethodencode
(self, text)
lib/model_zoo/bert.py:108
↓ 7 callersFunctionextract_into_tensor
(a, t, x_shape)
lib/model_zoo/diffusion_utils.py:79
↓ 7 callersFunctionget_example
(mode)
app.py:942
↓ 7 callersFunctionget_instruction
(mode)
app.py:203
↓ 7 callersFunctionmake_attn
(in_channels, attn_type="vanilla")
lib/model_zoo/diffusion_modules.py:205
↓ 7 callersFunctionmake_attn
(in_channels, attn_type="vanilla")
lib/model_zoo/autokl_modules.py:205
↓ 6 callersMethod__init__
(self, requires_grad=False, pretrained=True)
lib/model_zoo/autokl_utils.py:179
↓ 6 callersMethodadd_context_layer
(self, layer)
lib/model_zoo/openaimodel.py:2767
↓ 6 callersFunctioncheckpoint
Evaluate a function without caching intermediate activations, allowing for reduced memory at the expense of extra compute in the backward pas
lib/model_zoo/diffusion_utils.py:84
↓ 6 callersMethodfrom_pretrained
(cls, name="vgg_lpips")
lib/model_zoo/autokl_utils.py:250
↓ 6 callersMethodget_d_head_n_heads
(self, ch)
lib/model_zoo/openaimodel.py:2751
↓ 6 callersMethodreparameterize
sample from posterior Gaussian family Args: mu: Tensor Mean of gaussian distribution with shape (batch, nz)
lib/model_zoo/optimus.py:91
↓ 6 callersMethodvae_decode
(self, z, which, **kwargs)
lib/model_zoo/vd.py:292
↓ 5 callersFunctionNormalize
(in_channels)
lib/model_zoo/attention.py:76
↓ 5 callersMethod__init__
(self, n_embed, n_layer, vocab_size=30522, max_seq_len=77, ckpt_path=None, ignore_keys=[], de
lib/model_zoo/bert.py:75
↓ 5 callersMethod_get_resized_embeddings
Build a resized Embedding Module from a provided token Embedding Module. Increasing the size will add newly initialized vectors at the en
lib/model_zoo/optimus_models/optimus_gpt2.py:996
↓ 5 callersFunctionget_obj_from_str
(string, reload=False)
lib/utils.py:630
↓ 5 callersMethodinit_weights
Initialize and prunes weights if needed.
lib/model_zoo/optimus_models/optimus_gpt2.py:837
↓ 5 callersFunctionprune_linear_layer
Prune a linear layer (a model parameters) to keep only entries in index. Return the pruned layer as a new layer with requires_grad=True.
lib/model_zoo/optimus_models/modeling_utils.py:721
↓ 5 callersMethodsplit_heads
(self, x, k=False)
lib/model_zoo/optimus_models/optimus_gpt2.py:173
↓ 4 callersMethod__init__
(self)
lib/model_zoo/common/get_scheduler.py:18
↓ 4 callersMethod_convert_token_to_id
(self, token)
lib/model_zoo/optimus_models/tokenization_utils.py:663
↓ 4 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of weither we are using TorchScript or not
lib/model_zoo/optimus_models/optimus_gpt2.py:1063
↓ 4 callersFunctionalign_batch_size
(bs, bs_per_gpu)
lib/cfg_helper.py:456
↓ 4 callersMethoddestroy
(self)
lib/sync.py:73
↓ 4 callersMethodeval_complete_ll
compute log p(z,x) Args: x: Tensor input with shape [batch, seq_len] z: Tensor evaluat
lib/model_zoo/optimus.py:350
↓ 4 callersFunctionexists
(val)
lib/model_zoo/attention.py:11
↓ 4 callersMethodget_last_layer
(self)
lib/model_zoo/autokl.py:114
↓ 4 callersMethodprune_heads
(self, heads)
lib/model_zoo/optimus_models/optimus_bert.py:257
↓ 4 callersMethodprune_heads
(self, heads)
lib/model_zoo/optimus_models/optimus_gpt2.py:122
↓ 4 callersMethodset_model
(self, net, mode)
lib/utils.py:53
↓ 4 callersMethodtokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
lib/model_zoo/optimus_models/tokenization_bert.py:247
↓ 4 callersMethodtokenize
Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based vocabulary or sub-words for sub-wo
lib/model_zoo/optimus_models/tokenization_utils.py:576
↓ 3 callersMethod__init__
(self, freq, gain=1)
lib/model_zoo/common/utils.py:96
↓ 3 callersMethod_encode
(self, images)
lib/model_zoo/clip.py:88
↓ 3 callersMethodapply_model
(self, x_info, timesteps, c_info)
lib/model_zoo/vd.py:330
↓ 3 callersFunctioncached_path
Given something that might be a URL (or might be a local path), determine which. If it's a URL, download the file and cache it, and retur
lib/model_zoo/optimus_models/file_utils.py:125
↓ 3 callersMethodcontext_mixing
(self, x, emb, context_module_list, context_info_list, mixing_type)
lib/model_zoo/vd.py:383
↓ 3 callersFunctiondefault
(val, d)
lib/model_zoo/attention.py:19
↓ 3 callersMethodencode
(self, text, max_length=77)
lib/model_zoo/optimus.py:729
↓ 3 callersMethodencode
Converts a string in a sequence of ids (integer), using the tokenizer and vocabulary. Same as doing ``self.convert_tokens_to
lib/model_zoo/optimus_models/tokenization_utils.py:666
↓ 3 callersMethodget_model_list
(self, cfg_list)
lib/model_zoo/vd.py:118
↓ 3 callersFunctionis_ddp
()
lib/sync.py:25
↓ 3 callersMethodmain
(self, **paras)
lib/utils.py:309
↓ 3 callersMethodmixed_run
(self, inet, tnet, x, emb, context, xtype, ctype)
lib/model_zoo/openaimodel.py:2506
↓ 3 callersMethodmixed_run_dc
(self, inet, tnet, x, emb, c0, c1, xtype, c0_type, c1_type, mixed_ratio)
lib/model_zoo/openaimodel.py:2548
↓ 3 callersMethodmode
(self)
lib/model_zoo/distributions.py:20
↓ 3 callersFunctionprune_conv1d_layer
Prune a Conv1D layer (a model parameters) to keep only entries in index. A Conv1D work as a Linear layer (see e.g. BERT) but the weights are
lib/model_zoo/optimus_models/modeling_utils.py:746
↓ 3 callersMethodq_sample
(self, x_start, t, noise=None)
lib/model_zoo/vd.py:221
↓ 3 callersMethodregister
(self, optim, name)
lib/model_zoo/common/get_optimizer.py:21
↓ 3 callersFunctionstr2value
(v)
lib/model_zoo/common/utils.py:23
↓ 3 callersMethodtensorboard_log
(self, step, data, mode='train', **extra)
lib/log_service.py:84
↓ 3 callersMethodtie_weights
Make sure we are sharing the input and output embeddings. Export to TorchScript can't handle parameter sharing so we are cloning them ins
lib/model_zoo/optimus_models/optimus_bert.py:862
↓ 3 callersMethodtranspose_for_scores
(self, x)
lib/model_zoo/optimus_models/optimus_bert.py:195
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
lib/model_zoo/optimus_models/tokenization_bert.py:94
↓ 2 callersMethod__init__
(self)
lib/model_zoo/clip.py:11
↓ 2 callersMethod_convert_id_to_token
(self, index)
lib/model_zoo/optimus_models/tokenization_utils.py:723
↓ 2 callersMethod_convert_token_to_id_with_added_voc
(self, token)
lib/model_zoo/optimus_models/tokenization_utils.py:655
↓ 2 callersMethod_init_weights
Initialize the weights.
lib/model_zoo/optimus_models/optimus_gpt2.py:846
↓ 2 callersMethod_tie_or_clone_weights
Tie or clone module weights depending of weither we are using TorchScript or not
lib/model_zoo/optimus_models/modeling_utils.py:122
↓ 2 callersMethod_tokenize
Converts a string in a sequence of tokens (string), using the tokenizer. Split in words for word-based vocabulary or sub-words for sub-wo
lib/model_zoo/optimus_models/tokenization_utils.py:627
↓ 2 callersMethodadd_special_tokens
Add a dictionary of special tokens (eos, pad, cls...) to the encoder and link them to class attributes. If special tokens are NOT in
lib/model_zoo/optimus_models/tokenization_utils.py:522
↓ 2 callersMethodadd_tokens
Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to it with indices start
lib/model_zoo/optimus_models/tokenization_utils.py:482
↓ 2 callersFunctionadopt_weight
(weight, global_step, threshold=0, value=0.)
lib/model_zoo/autokl_utils.py:277
↓ 2 callersMethodapply_model_multicontext
context_info_list: [[context_type, context, ratio]] for 'attention'
lib/model_zoo/vd.py:404
↓ 2 callersFunctioncfg_solvef
(cmd, root)
lib/cfg_helper.py:21
↓ 2 callersMethodclean_up_tokenization
Clean up a list of simple English tokenization artifacts like spaces before punctuations and abreviated forms.
lib/model_zoo/optimus_models/tokenization_utils.py:809
↓ 2 callersMethodclear
(self)
lib/log_service.py:133
↓ 2 callersMethodconvert_ids_to_tokens
Converts a single index or a sequence of indices (integers) in a token " (resp.) a sequence of tokens (str/unicode), using the vocabulary
lib/model_zoo/optimus_models/tokenization_utils.py:701
↓ 2 callersMethodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string. The most simple way to do it is ' '.join(self.convert_ids_to_tokens(token_ids)
lib/model_zoo/optimus_models/tokenization_utils.py:726
↓ 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
lib/model_zoo/openaimodel.py:326
next →1–100 of 773, ranked by callers