Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SHI-Labs/Versatile-Diffusion
/ functions
Functions
773 in github.com/SHI-Labs/Versatile-Diffusion
⨍
Functions
773
◇
Types & classes
190
Method
max_position_embeddings
(self)
lib/model_zoo/optimus_models/configuration_gpt2.py:130
Function
mean_flat
Take the mean over all non-batch dimensions.
lib/model_zoo/diffusion_utils.py:169
Method
mode
(self)
lib/model_zoo/distributions.py:9
Method
mode
(self)
lib/model_zoo/distributions.py:61
Method
nll
(self, sample, dims=[1,2,3])
lib/model_zoo/distributions.py:53
Method
nll_iw
compute the importance weighting estimate of the log-likelihood Args: x0, x1: two different tokenization results of x, where x is
lib/model_zoo/optimus.py:296
Function
normal_kl
source: https://github.com/openai/guided-diffusion/blob/27c20a8fab9cb472df5d6bdd6c8d11c8f430b924/guided_diffusion/losses.py#L12 Compute the K
lib/model_zoo/distributions.py:65
Method
num_attention_heads
(self)
lib/model_zoo/optimus_models/configuration_gpt2.py:138
Method
num_hidden_layers
(self)
lib/model_zoo/optimus_models/configuration_gpt2.py:142
Method
on_train_batch_end
(self, *args, **kwargs)
lib/model_zoo/vd.py:326
Method
on_train_batch_start
(self, x)
lib/model_zoo/vd.py:323
Method
pad_token
Padding token (string). Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:103
Method
pad_token_id
Id of the padding token in the vocabulary. Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:183
Method
predict_start_from_noise
(self, x_t, t, noise)
lib/model_zoo/vd.py:214
Method
prepare_dataloader
(self)
lib/utils.py:504
Method
prepare_dataloader
(self)
lib/utils.py:568
Method
prepare_model
(self)
lib/utils.py:537
Method
prepare_model
(self)
lib/utils.py:589
Function
prune_layer
Prune a Conv1D or nn.Linear layer (a model parameters) to keep only entries in index. Return the pruned layer as a new layer with requires_gr
lib/model_zoo/optimus_models/modeling_utils.py:770
Method
q_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
lib/model_zoo/vd.py:202
Method
reconstruct
reconstruct from input x Args: x: (batch, *) decoding_strategy: "beam" or "greedy" or "sample" K: the beam
lib/model_zoo/optimus.py:215
Function
register
(name)
lib/model_zoo/common/get_model.py:96
Function
register
(name)
lib/model_zoo/common/get_scheduler.py:41
Function
register
(name)
lib/model_zoo/common/utils.py:89
Method
resize_token_embeddings
Resize input token embeddings matrix of the model if new_num_tokens != config.vocab_size. Take care of tying weights embeddings afterwards if
lib/model_zoo/optimus_models/modeling_utils.py:138
Method
resize_token_embeddings
(self, new_num_tokens=None)
lib/model_zoo/optimus_models/optimus_gpt2.py:1114
Function
s3_request
Wrapper function for s3 requests in order to create more helpful error messages.
lib/model_zoo/optimus_models/file_utils.py:171
Method
sample
(self)
lib/model_zoo/distributions.py:6
Method
sample
(self)
lib/model_zoo/distributions.py:17
Method
sample_from_posterior
perform MH sampling from model posterior Returns: Tensor Tensor: samples from model posterior with shape (batch_si
lib/model_zoo/optimus.py:415
Method
save_last_model
(self, **para)
lib/utils.py:553
Method
save_last_model
(self, **para)
lib/utils.py:600
Method
save_pretrained
Save a model and its configuration file to a directory, so that it can be re-loaded using the `:func:`~pytorch_transformers.PreTrainedMod
lib/model_zoo/optimus_models/modeling_utils.py:195
Method
save_pretrained
Save a configuration object to the directory `save_directory`, so that it can be re-loaded using the :func:`~pytorch_transformers.Pretrai
lib/model_zoo/optimus_models/configuration_utils.py:59
Method
save_pretrained
Save the tokenizer vocabulary files together with: - added tokens, - special-tokens-to-class-attributes-mapping,
lib/model_zoo/optimus_models/tokenization_utils.py:421
Method
save_vocabulary
Save the tokenizer vocabulary and merge files to a directory.
lib/model_zoo/optimus_models/tokenization_gpt2.py:202
Method
save_vocabulary
Save the tokenizer vocabulary to a directory or file.
lib/model_zoo/optimus_models/tokenization_bert.py:206
Function
scale_module
Scale the parameters of a module and return it.
lib/model_zoo/diffusion_utils.py:161
Method
schedule
(self, n)
lib/model_zoo/common/get_scheduler.py:248
Method
sep_token
Separation token (string). E.g. separate context and query in an input sequence. Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:96
Method
sep_token_id
Id of the separation token in the vocabulary. E.g. separate context and query in an input sequence. Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:178
Method
set_lr
Set Each parameter_groups in optim with new_lr New_lr can be find according to the idx. pg_lrscale tells how to scale each pg
lib/model_zoo/common/get_scheduler.py:54
Function
singleton
(class_)
lib/cfg_holder.py:3
Function
singleton
(class_)
lib/sync.py:17
Function
singleton
(class_)
lib/model_zoo/common/get_model.py:11
Function
singleton
(class_)
lib/model_zoo/common/get_scheduler.py:8
Function
singleton
(class_)
lib/model_zoo/common/utils.py:15
Function
singleton
(class_)
lib/model_zoo/common/get_optimizer.py:6
Method
special_tokens_map
A dictionary mapping special token class attribute (cls_token, unk_token...) to their values ('<unk>', '<cls>'...)
lib/model_zoo/optimus_models/tokenization_utils.py:776
Method
split_on_token
(tok, text)
lib/model_zoo/optimus_models/tokenization_utils.py:583
Method
split_on_tokens
(tok_list, text)
lib/model_zoo/optimus_models/tokenization_utils.py:601
Function
swish
(x)
lib/model_zoo/optimus_models/optimus_bert.py:131
Method
t2y0_semf_wrapper
(t0, y00, t1, y01)
app.py:63
Method
t2y0_styf_wrapper
(t0, y00, t1, y01)
app.py:75
Method
tokenize
Tokenizes a piece of text into its word pieces. This uses a greedy longest-match-first algorithm to perform tokenization using the gi
lib/model_zoo/optimus_models/tokenization_bert.py:368
Function
torch_to_numpy
(*argv)
lib/utils.py:607
Function
torch_to_numpy
(*argv)
lib/log_service.py:144
Function
uniq
(arr)
lib/model_zoo/attention.py:15
Method
unk_token
Unknown token (string). Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:89
Method
unk_token_id
Id of the unknown token in the vocabulary. Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:173
Method
validation_step
(self, batch, batch_idx)
lib/model_zoo/autokl.py:89
Function
vanilla_d_loss
(logits_real, logits_fake)
lib/model_zoo/autokl_utils.py:288
Method
vocab_size
(self)
lib/model_zoo/optimus_models/tokenization_gpt2.py:132
Method
vocab_size
(self)
lib/model_zoo/optimus_models/tokenization_bert.py:164
Method
vocab_size
Size of the base vocabulary (without the added tokens)
lib/model_zoo/optimus_models/tokenization_utils.py:472
Function
weights_init
(m)
lib/model_zoo/autokl_utils.py:93
Function
wrapper
(url, *args, **kwargs)
lib/model_zoo/optimus_models/file_utils.py:178
Function
wrapper
(class_)
lib/model_zoo/common/get_model.py:97
Function
wrapper
(class_)
lib/model_zoo/common/get_scheduler.py:42
Function
wrapper
(class_)
lib/model_zoo/common/utils.py:90
Method
x2y_semf_wrapper
(x0, x1, y1)
app.py:69
Method
x2y_styf_wrapper
(x0, x1, y1)
app.py:81
Function
zero_module
Zero out the parameters of a module and return it.
lib/model_zoo/diffusion_utils.py:153
← previous
701–773 of 773, ranked by callers