MCPcopy Create free account

hub / github.com/Hzfinfdu/Diffusion-BERT / functions

Functions340 in github.com/Hzfinfdu/Diffusion-BERT

↓ 22 callersMethod__init__
(self, config)
models/modeling_bert.py:469
↓ 22 callersMethod__init__
(self, config)
models/modeling_bert_new_timestep.py:484
↓ 17 callersMethod__init__
(self, config)
models/modeling_roberta.py:385
↓ 7 callersMethodtranspose_for_scores
(self, x: torch.Tensor)
models/modeling_bert.py:276
↓ 7 callersMethodtranspose_for_scores
(self, x: torch.Tensor)
models/modeling_roberta.py:187
↓ 7 callersMethodtranspose_for_scores
(self, x: torch.Tensor)
models/modeling_bert_new_timestep.py:291
↓ 6 callersMethodmy_load
(self, task_name, splits)
dataloader.py:19
↓ 5 callersMethodsample
(self, logits, x_0)
sample.py:14
↓ 4 callersMethod__init__
(self, tokenizer, return_source_length=False)
dataloader.py:116
↓ 3 callersMethod_get_mask
(self)
diffusion_word_freq.py:391
↓ 3 callersMethod_get_mask
(self)
diffusion_condition.py:426
↓ 3 callersMethodget
Returns the transition matrix q(x_{t+1} | x_t).
diffusion_word_freq.py:128
↓ 3 callersMethodget
Returns the transition matrix q(x_{t+1} | x_t).
diffusion_condition.py:128
↓ 3 callersMethodsupports_efficient_inference
(self)
diffusion_word_freq.py:367
↓ 3 callersMethodsupports_efficient_inference
(self)
diffusion_condition.py:374
↓ 2 callersFunctioncosine_fn
(step)
diffusion_word_freq.py:522
↓ 2 callersFunctioncosine_fn
(step)
diffusion_condition.py:557
↓ 2 callersFunctiondenoise_fn
(targets, timestep, attention_mask)
predict.py:133
↓ 2 callersFunctionget_bleu
(recover, reference)
compute_metric.py:35
↓ 2 callersMethodget_qt_given_q0
Get q(x_t), the n-step posterior. For example, for t = 0, it returns q0 unchanged. Args: q0: an array of floats specifying a
diffusion_word_freq.py:168
↓ 2 callersMethodget_qt_given_q0
Get q(x_t), the n-step posterior. For example, for t = 0, it returns q0 unchanged. Args: q0: an array of floats specifying a
diffusion_condition.py:168
↓ 2 callersFunctionp_forward
Returns probabilities from the reverse process p(x_{t-1} | x_t). Args: denoise_fn: the reverse process. Must support embed, call, and attend.
diffusion_word_freq.py:533
↓ 2 callersFunctionp_forward
Returns probabilities from the reverse process p(x_{t-1} | x_t). Args: denoise_fn: the reverse process. Must support embed, call, and attend.
diffusion_condition.py:568
↓ 2 callersMethodqt_reverse
Get q(x_{t+1} | x_t), the one-step posterior efficiently. Args: qt_plus_1: an array of floats specifying a distribution over p(x_0).
diffusion_word_freq.py:136
↓ 2 callersMethodqt_reverse
Get q(x_{t+1} | x_t), the one-step posterior efficiently. Args: qt_plus_1: an array of floats specifying a distribution over p(x_0).
diffusion_condition.py:136
↓ 2 callersMethodsample_and_compute_posterior_q
Samples from q(x_{t+1} | x_0), then computes q(x_t | x_{t+1}, x_0). Args: x_0: an array containing x_0 samples. These are expected t
diffusion_word_freq.py:86
↓ 2 callersMethodsample_and_compute_posterior_q
Samples from q(x_{t+1} | x_0), then computes q(x_t | x_{t+1}, x_0). Args: x_0: an array containing x_0 samples. These are expected t
diffusion_condition.py:86
↓ 2 callersMethodsample_t
Samples batches of time steps to use.
diffusion_word_freq.py:46
↓ 2 callersMethodsupports_efficient_get
(self)
diffusion_word_freq.py:467
↓ 2 callersMethodsupports_efficient_get
(self)
diffusion_condition.py:502
↓ 2 callersMethodupdate_keys_to_ignore
Remove some keys from ignore list
models/modeling_roberta.py:615
↓ 1 callersMethod_create_state
Initializes values used by the get function.
diffusion_word_freq.py:336
↓ 1 callersMethod_create_state
Initializes values used by the get function.
diffusion_condition.py:343
↓ 1 callersMethod_load
(self, task_name, split)
dataloader.py:12
↓ 1 callersMethod_load
(self, split)
dataloader.py:54
↓ 1 callersMethod_warmed_up
(self)
diffusion_condition.py:400
↓ 1 callersFunctioncompute_kl_reverse_process
Returns the KL for one term in the ELBO (time t) (loss L_t). This assumes x_start is a sample from x_0, from which we draw samples from q(x_t
diffusion_word_freq.py:636
↓ 1 callersFunctioncompute_kl_reverse_process
Returns the KL for one term in the ELBO (time t) (loss L_t). This assumes x_start is a sample from x_0, from which we draw samples from q(x_t
diffusion_condition.py:670
↓ 1 callersFunctioncompute_prior_kl
Computes KL divergence between q(x_T) and the true distribution.
diffusion_word_freq.py:618
↓ 1 callersFunctioncompute_prior_kl
Computes KL divergence between q(x_T) and the true distribution.
diffusion_condition.py:652
↓ 1 callersFunctioncreate_position_ids_from_input_ids
Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols are ignored. This is modifi
models/modeling_roberta.py:1569
↓ 1 callersMethodcreate_position_ids_from_inputs_embeds
We are provided embeddings directly. We cannot infer which are padded so just generate sequential position ids. Args: in
models/modeling_roberta.py:141
↓ 1 callersMethodcustom_product_fn
Returns q(x_t | x_0), the product of the first t matrices.
diffusion_word_freq.py:132
↓ 1 callersMethodcustom_product_fn
Returns q(x_t | x_0), the product of the first t matrices.
diffusion_condition.py:132
↓ 1 callersFunctiondist1
(hypn, n=1)
compute_metric.py:10
↓ 1 callersFunctiondiv4
(hypn, n=4)
compute_metric.py:22
↓ 1 callersMethodget_qt_given_q0
Get q(x_t), the n-step posterior. Can do efficiently for masks. For example, for t = 0, it returns q0 unchanged. Args:
diffusion_word_freq.py:431
↓ 1 callersMethodget_qt_given_q0
Get q(x_t), the n-step posterior. Can do efficiently for masks. For example, for t = 0, it returns q0 unchanged. Args:
diffusion_condition.py:466
↓ 1 callersMethodget_qt_matrix
Returns the matrix Q = q(x_t | x_0) materialized over all x_0.
diffusion_word_freq.py:153
↓ 1 callersMethodget_qt_matrix
Returns the matrix Q = q(x_t | x_0) materialized over all x_0.
diffusion_condition.py:153
↓ 1 callersFunctionlayer_schedule_fn
(timestep)
compute_elbo.py:116
↓ 1 callersMethodnoise_fn
(self, q0, t, word_freq_logits)
diffusion_word_freq.py:345
↓ 1 callersMethodnoise_fn
(self, q0, t, word_freq_logits)
diffusion_condition.py:352
↓ 1 callersFunctionparse_args
()
DDP_main.py:30
↓ 1 callersFunctionparse_args
()
DDP_main_conditional.py:30
↓ 1 callersFunctionprocess_fn_in_collate
(wf)
DDP_main.py:106
↓ 1 callersFunctionprocess_fn_in_collate
(wf)
compute_elbo.py:144
↓ 1 callersMethodprune_heads
(self, heads)
models/modeling_bert.py:397
↓ 1 callersMethodprune_heads
(self, heads)
models/modeling_roberta.py:310
↓ 1 callersMethodprune_heads
(self, heads)
models/modeling_bert_new_timestep.py:412
↓ 1 callersMethodsample_stationary
(self, size)
diffusion_word_freq.py:375
↓ 1 callersFunctionselectBest
(sentences)
MBR_decoding.py:5
↓ 1 callersFunctionself_bleu
This function is only used to evaluate the self-BLEU score in conditional generation tasks to align with the implementation in https://github
compute_metric.py:38
↓ 1 callersFunctionset_seed
(args)
DDP_main.py:22
↓ 1 callersFunctionset_seed
(args)
DDP_main_conditional.py:22
↓ 1 callersMethodstationary_probs
(self, size)
diffusion_word_freq.py:370
↓ 1 callersMethodstationary_probs
(self, size)
diffusion_condition.py:377
↓ 1 callersFunctionword_freq_preprocess_fn
(wf)
predict.py:82
↓ 1 callersFunctionword_freq_preprocess_fn
(wf)
DDP_main.py:98
↓ 1 callersFunctionword_freq_preprocess_fn
(wf)
predict_downstream_condition.py:74
↓ 1 callersFunctionword_freq_preprocess_fn
(wf)
compute_elbo.py:63
↓ 1 callersFunctionword_freq_preprocess_fn
(wf)
DDP_main_conditional.py:97
Method__call__
(self, step)
diffusion_word_freq.py:26
Method__call__
(self, step)
diffusion_condition.py:26
Method__init__
(self, tokenizer)
dataloader.py:9
Method__init__
(self, tokenizer, return_source_length=False)
dataloader.py:33
Method__init__
(self, tokenizer, return_source_length=False)
dataloader.py:103
Method__init__
(self, tokenizer, return_source_length=False)
dataloader.py:128
Method__init__
(self, tokenizer, return_source_length=False)
dataloader.py:139
Method__init__
(self, model_tokenizer, electra_tokenizer, electra_model)
dataloader.py:151
Method__init__
(self, tokenizer)
sample.py:19
Method__init__
(self, schedule_fn, num_steps, is_constant=False)
diffusion_word_freq.py:21
Method__init__
A simple scheduler for masking policies. Args: dim: int, the dimensionality of the state space. schedule: a DiffusionSched
diffusion_word_freq.py:307
Method__init__
(self, schedule_fn, num_steps, is_constant=False)
diffusion_condition.py:21
Method__init__
A simple scheduler for masking policies. Args: dim: int, the dimensionality of the state space. schedule: a DiffusionSched
diffusion_condition.py:307
Method__init__
(self, config)
models/modeling_bert.py:185
Method__init__
(self, config, position_embedding_type=None)
models/modeling_bert.py:250
Method__init__
(self, config)
models/modeling_bert.py:377
Method__init__
(self, config, position_embedding_type=None)
models/modeling_bert.py:391
Method__init__
(self, config)
models/modeling_bert.py:440
Method__init__
(self, config)
models/modeling_bert.py:455
Method__init__
(self, config)
models/modeling_bert.py:555
Method__init__
(self, config)
models/modeling_bert.py:652
Method__init__
(self, config)
models/modeling_bert.py:667
Method__init__
(self, config)
models/modeling_bert.py:684
Method__init__
(self, config)
models/modeling_bert.py:704
Method__init__
(self, config)
models/modeling_bert.py:714
Method__init__
(self, config)
models/modeling_bert.py:724
Method__init__
(self, config, add_pooling_layer=True)
models/modeling_bert.py:885
Method__init__
(self, config)
models/modeling_bert.py:1058
next →1–100 of 340, ranked by callers