Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Hzfinfdu/Diffusion-BERT
/ functions
Functions
340 in github.com/Hzfinfdu/Diffusion-BERT
⨍
Functions
340
◇
Types & classes
93
↳
Endpoints
3
↓ 22 callers
Method
__init__
(self, config)
models/modeling_bert.py:469
↓ 22 callers
Method
__init__
(self, config)
models/modeling_bert_new_timestep.py:484
↓ 17 callers
Method
__init__
(self, config)
models/modeling_roberta.py:385
↓ 7 callers
Method
transpose_for_scores
(self, x: torch.Tensor)
models/modeling_bert.py:276
↓ 7 callers
Method
transpose_for_scores
(self, x: torch.Tensor)
models/modeling_roberta.py:187
↓ 7 callers
Method
transpose_for_scores
(self, x: torch.Tensor)
models/modeling_bert_new_timestep.py:291
↓ 6 callers
Method
my_load
(self, task_name, splits)
dataloader.py:19
↓ 5 callers
Method
sample
(self, logits, x_0)
sample.py:14
↓ 4 callers
Method
__init__
(self, tokenizer, return_source_length=False)
dataloader.py:116
↓ 3 callers
Method
_get_mask
(self)
diffusion_word_freq.py:391
↓ 3 callers
Method
_get_mask
(self)
diffusion_condition.py:426
↓ 3 callers
Method
get
Returns the transition matrix q(x_{t+1} | x_t).
diffusion_word_freq.py:128
↓ 3 callers
Method
get
Returns the transition matrix q(x_{t+1} | x_t).
diffusion_condition.py:128
↓ 3 callers
Method
supports_efficient_inference
(self)
diffusion_word_freq.py:367
↓ 3 callers
Method
supports_efficient_inference
(self)
diffusion_condition.py:374
↓ 2 callers
Function
cosine_fn
(step)
diffusion_word_freq.py:522
↓ 2 callers
Function
cosine_fn
(step)
diffusion_condition.py:557
↓ 2 callers
Function
denoise_fn
(targets, timestep, attention_mask)
predict.py:133
↓ 2 callers
Function
get_bleu
(recover, reference)
compute_metric.py:35
↓ 2 callers
Method
get_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 callers
Method
get_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 callers
Function
p_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 callers
Function
p_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 callers
Method
qt_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 callers
Method
qt_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 callers
Method
sample_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 callers
Method
sample_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 callers
Method
sample_t
Samples batches of time steps to use.
diffusion_word_freq.py:46
↓ 2 callers
Method
supports_efficient_get
(self)
diffusion_word_freq.py:467
↓ 2 callers
Method
supports_efficient_get
(self)
diffusion_condition.py:502
↓ 2 callers
Method
update_keys_to_ignore
Remove some keys from ignore list
models/modeling_roberta.py:615
↓ 1 callers
Method
_create_state
Initializes values used by the get function.
diffusion_word_freq.py:336
↓ 1 callers
Method
_create_state
Initializes values used by the get function.
diffusion_condition.py:343
↓ 1 callers
Method
_load
(self, task_name, split)
dataloader.py:12
↓ 1 callers
Method
_load
(self, split)
dataloader.py:54
↓ 1 callers
Method
_warmed_up
(self)
diffusion_condition.py:400
↓ 1 callers
Function
compute_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 callers
Function
compute_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 callers
Function
compute_prior_kl
Computes KL divergence between q(x_T) and the true distribution.
diffusion_word_freq.py:618
↓ 1 callers
Function
compute_prior_kl
Computes KL divergence between q(x_T) and the true distribution.
diffusion_condition.py:652
↓ 1 callers
Function
create_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 callers
Method
create_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 callers
Method
custom_product_fn
Returns q(x_t | x_0), the product of the first t matrices.
diffusion_word_freq.py:132
↓ 1 callers
Method
custom_product_fn
Returns q(x_t | x_0), the product of the first t matrices.
diffusion_condition.py:132
↓ 1 callers
Function
dist1
(hypn, n=1)
compute_metric.py:10
↓ 1 callers
Function
div4
(hypn, n=4)
compute_metric.py:22
↓ 1 callers
Method
get_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 callers
Method
get_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 callers
Method
get_qt_matrix
Returns the matrix Q = q(x_t | x_0) materialized over all x_0.
diffusion_word_freq.py:153
↓ 1 callers
Method
get_qt_matrix
Returns the matrix Q = q(x_t | x_0) materialized over all x_0.
diffusion_condition.py:153
↓ 1 callers
Function
layer_schedule_fn
(timestep)
compute_elbo.py:116
↓ 1 callers
Method
noise_fn
(self, q0, t, word_freq_logits)
diffusion_word_freq.py:345
↓ 1 callers
Method
noise_fn
(self, q0, t, word_freq_logits)
diffusion_condition.py:352
↓ 1 callers
Function
parse_args
()
DDP_main.py:30
↓ 1 callers
Function
parse_args
()
DDP_main_conditional.py:30
↓ 1 callers
Function
process_fn_in_collate
(wf)
DDP_main.py:106
↓ 1 callers
Function
process_fn_in_collate
(wf)
compute_elbo.py:144
↓ 1 callers
Method
prune_heads
(self, heads)
models/modeling_bert.py:397
↓ 1 callers
Method
prune_heads
(self, heads)
models/modeling_roberta.py:310
↓ 1 callers
Method
prune_heads
(self, heads)
models/modeling_bert_new_timestep.py:412
↓ 1 callers
Method
sample_stationary
(self, size)
diffusion_word_freq.py:375
↓ 1 callers
Function
selectBest
(sentences)
MBR_decoding.py:5
↓ 1 callers
Function
self_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 callers
Function
set_seed
(args)
DDP_main.py:22
↓ 1 callers
Function
set_seed
(args)
DDP_main_conditional.py:22
↓ 1 callers
Method
stationary_probs
(self, size)
diffusion_word_freq.py:370
↓ 1 callers
Method
stationary_probs
(self, size)
diffusion_condition.py:377
↓ 1 callers
Function
word_freq_preprocess_fn
(wf)
predict.py:82
↓ 1 callers
Function
word_freq_preprocess_fn
(wf)
DDP_main.py:98
↓ 1 callers
Function
word_freq_preprocess_fn
(wf)
predict_downstream_condition.py:74
↓ 1 callers
Function
word_freq_preprocess_fn
(wf)
compute_elbo.py:63
↓ 1 callers
Function
word_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