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
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:303
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:333
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:365
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:380
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:397
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:416
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:426
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:436
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:563
Method
__init__
(self, config, latent_size)
lib/model_zoo/optimus_models/optimus_bert.py:668
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:781
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:853
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:922
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:986
Method
__init__
(self, config, latent_size)
lib/model_zoo/optimus_models/optimus_bert.py:1064
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:1146
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:1218
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_bert.py:1298
Method
__init__
(self, config, latent_size)
lib/model_zoo/optimus_models/optimus_bert.py:1349
Method
__init__
(self, nx, n_ctx, config, scale=False)
lib/model_zoo/optimus_models/optimus_gpt2.py:104
Method
__init__
(self, n_ctx, config, scale=False)
lib/model_zoo/optimus_models/optimus_gpt2.py:226
Method
__init__
(self, *inputs, **kwargs)
lib/model_zoo/optimus_models/optimus_gpt2.py:258
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_gpt2.py:353
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_gpt2.py:557
Method
__init__
(self, config, latent_size=32, latent_as_gpt_emb=True, latent_as_gpt_memory=True)
lib/model_zoo/optimus_models/optimus_gpt2.py:643
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_gpt2.py:763
Method
__init__
(self, config)
lib/model_zoo/optimus_models/optimus_gpt2.py:814
Method
__init__
(self, config, latent_size=32, latent_as_gpt_emb=True,
lib/model_zoo/optimus_models/optimus_gpt2.py:1026
Method
__init__
(self, vocab_size_or_config_json_file=30522, hidden_size=768,
lib/model_zoo/optimus_models/configuration_bert.py:77
Method
__init__
Constructs a BertTokenizer. Args: **vocab_file**: Path to a one-wordpiece-per-line vocabulary file **do_lower_case**:
lib/model_zoo/optimus_models/tokenization_bert.py:123
Method
__init__
Constructs a BasicTokenizer. Args: **do_lower_case**: Whether to lower case the input. **never_split**: (`optional`)
lib/model_zoo/optimus_models/tokenization_bert.py:227
Method
__init__
(self, vocab, unk_token, max_input_chars_per_word=100)
lib/model_zoo/optimus_models/tokenization_bert.py:363
Method
__init__
Constructs GPT2Config. Args: vocab_size_or_config_json_file: Vocabulary size of `inputs_ids` in `GPT2Model` or a configuration js
lib/model_zoo/optimus_models/configuration_gpt2.py:55
Method
__init__
(self, **kwargs)
lib/model_zoo/optimus_models/configuration_utils.py:51
Method
__init__
(self, max_len=None, **kwargs)
lib/model_zoo/optimus_models/tokenization_utils.py:202
Method
__init__
(self)
lib/model_zoo/common/get_model.py:35
Method
__init__
(self, step)
lib/model_zoo/common/get_scheduler.py:48
Method
__init__
(self, lr, step)
lib/model_zoo/common/get_scheduler.py:72
Method
__init__
(self, start_lr, end_lr, power, step)
lib/model_zoo/common/get_scheduler.py:83
Method
__init__
(self, start_lr, end_lr, step)
lib/model_zoo/common/get_scheduler.py:98
Method
__init__
(self, schedulers)
lib/model_zoo/common/get_scheduler.py:128
Method
__init__
(self, base_lr, warm_up_steps, lr_min, lr_max, lr_start,
lib/model_zoo/common/get_scheduler.py:155
Method
__init__
(self, base_lr, warm_up_steps, f_min, f_max, f_start, cyc
lib/model_zoo/common/get_scheduler.py:197
Method
__init__
(self)
lib/model_zoo/common/utils.py:42
Method
__init__
(self, alpha=0.1, gain=1, clamp=None)
lib/model_zoo/common/utils.py:123
Method
__init__
(self, in_dim, out_dim, sigma = 6, cat_
lib/model_zoo/common/utils.py:154
Method
__init__
(self, in_dim, out_dim, sigma = 6, cat_
lib/model_zoo/common/utils.py:218
Method
__init__
(self)
lib/model_zoo/common/get_optimizer.py:15
Method
__len__
Size of the full vocabulary with the added tokens
lib/model_zoo/optimus_models/tokenization_utils.py:477
Method
__repr__
(self)
lib/model_zoo/optimus_models/configuration_utils.py:190
Method
__repr__
(self,)
lib/model_zoo/common/utils.py:105
Method
__repr__
(self,)
lib/model_zoo/common/utils.py:145
Method
_convert_id_to_token
Converts an index (integer) in a token (string/unicode) using the vocab.
lib/model_zoo/optimus_models/tokenization_gpt2.py:192
Method
_convert_id_to_token
Converts an index (integer) in a token (string/unicode) using the vocab.
lib/model_zoo/optimus_models/tokenization_bert.py:181
Method
_convert_token_to_id
Converts a token (str/unicode) in an id using the vocab.
lib/model_zoo/optimus_models/tokenization_bert.py:177
Method
_forward
(self, x, emb)
lib/model_zoo/openaimodel.py:254
Method
_forward
(self, x)
lib/model_zoo/openaimodel.py:317
Method
_forward
(self, x, emb)
lib/model_zoo/openaimodel.py:2134
Method
_forward
(self, x, context=None)
lib/model_zoo/attention.py:214
Method
_forward
(self, x)
lib/model_zoo/attention.py:289
Method
_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/modeling_utils.py:88
Method
_init_weights
Initialize the weights
lib/model_zoo/optimus_models/optimus_bert.py:456
Method
_init_weights
Initialize the weights
lib/model_zoo/optimus_models/optimus_bert.py:1367
Method
_init_weights
Initialize the weights.
lib/model_zoo/optimus_models/optimus_gpt2.py:261
Method
_init_weights
Initialize the weights.
lib/model_zoo/optimus_models/optimus_gpt2.py:1050
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
lib/model_zoo/optimus_models/optimus_bert.py:685
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base class PreTraine
lib/model_zoo/optimus_models/optimus_bert.py:1385
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
lib/model_zoo/optimus_models/optimus_gpt2.py:379
Method
_prune_heads
Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer}
lib/model_zoo/optimus_models/optimus_gpt2.py:863
Method
_resize_token_embeddings
(self, new_num_tokens)
lib/model_zoo/optimus_models/optimus_bert.py:679
Method
_resize_token_embeddings
(self, new_num_tokens)
lib/model_zoo/optimus_models/optimus_bert.py:1379
Method
_resize_token_embeddings
(self, new_num_tokens)
lib/model_zoo/optimus_models/optimus_gpt2.py:859
Method
_tokenize
Tokenize a string.
lib/model_zoo/optimus_models/tokenization_gpt2.py:176
Method
_tokenize
(self, text)
lib/model_zoo/optimus_models/tokenization_bert.py:167
Method
add_code
A new main code is reached and its name is added.
lib/cfg_holder.py:23
Function
add_end_docstrings
(*docstr)
lib/model_zoo/optimus_models/file_utils.py:64
Method
add_special_tokens_sentences_pair
Adds special tokens to a sequence pair for sequence classification tasks. A BERT sequence pair has the following format: [CLS] A [SEP
lib/model_zoo/optimus_models/tokenization_bert.py:197
Method
add_special_tokens_single_sentence
Adds special tokens to the a sequence for sequence classification tasks. A BERT sequence has the following format: [CLS] X [SEP]
lib/model_zoo/optimus_models/tokenization_bert.py:190
Function
add_start_docstrings
(*docstr)
lib/model_zoo/optimus_models/file_utils.py:58
Method
additional_special_tokens
All the additional special tokens you may want to use (list of strings). Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:124
Method
additional_special_tokens_ids
Ids of all the additional special tokens in the vocabulary (list of integers). Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:198
Method
all_special_ids
List the vocabulary indices of the special tokens ('<unk>', '<cls>'...) mapped to class attributes (cls_token, unk_token...).
lib/model_zoo/optimus_models/tokenization_utils.py:800
Method
all_special_tokens
List all the special tokens ('<unk>', '<cls>'...) mapped to class attributes (cls_token, unk_token...).
lib/model_zoo/optimus_models/tokenization_utils.py:788
Method
backward
(ctx, *output_grads)
lib/model_zoo/diffusion_utils.py:112
Function
betas_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 = [
lib/model_zoo/diffusion_utils.py:61
Method
bos_token
Beginning of sentence token (string). Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:75
Method
bos_token_id
Id of the beginning of sentence token in the vocabulary. Log an error if used while not having been set.
lib/model_zoo/optimus_models/tokenization_utils.py:163
Method
broadcast_r0
(self, data=None)
lib/sync.py:163
Method
calc_au
compute the number of active units
lib/model_zoo/optimus.py:587
Method
calc_infer_mean
Returns: Tensor1 Tensor1: the mean of inference distribution, with shape [batch, nz]
lib/model_zoo/optimus.py:468
Method
calc_mi
(self, test_data_batch, args)
lib/model_zoo/optimus.py:504
Method
calc_model_posterior_mean
compute the mean value of model posterior, i.e. E_{z ~ p(z|x)}[z] Args: grid_z: different z points that will be evaluated, with
lib/model_zoo/optimus.py:451
Method
cls_token
Classification token (string). E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of the model. Log an err
lib/model_zoo/optimus_models/tokenization_utils.py:110
Method
cls_token_id
Id of the classification token in the vocabulary. E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of th
lib/model_zoo/optimus_models/tokenization_utils.py:188
Method
configure_optimizers
(self)
lib/model_zoo/autokl.py:103
Function
convert_module_to_f16
(x)
lib/model_zoo/openaimodel.py:22
Function
convert_module_to_f32
(x)
lib/model_zoo/openaimodel.py:25
Method
convert_to_fp16
Convert the torso of the model to float16.
lib/model_zoo/openaimodel.py:728
Method
convert_to_fp16
Convert the torso of the model to float16.
lib/model_zoo/openaimodel.py:958
Method
convert_to_fp32
Convert the torso of the model to float32.
lib/model_zoo/openaimodel.py:736
← previous
next →
401–500 of 773, ranked by callers