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
Function
discrete_diffusion_predict_fn
Predict an image or text from a diffusion model. Args: params: a PyTree of parameters for the model. rng_key: an RNG key. targets: igno
diffusion_condition.py:863
Function
elbo_body_fn
(state, _)
diffusion_word_freq.py:787
Function
elbo_body_fn
(state, _)
diffusion_condition.py:805
Method
feed_forward_chunk
(self, attention_output)
models/modeling_bert.py:548
Method
feed_forward_chunk
(self, attention_output)
models/modeling_roberta.py:464
Method
feed_forward_chunk
(self, attention_output)
models/modeling_bert_new_timestep.py:576
Function
fori_loop
(lower, upper, body_fun, init_val)
utils.py:5
Method
forward
( self, input_ids: Optional[torch.LongTensor] = None, token_type_ids: Optional[torch.L
models/modeling_bert.py:205
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert.py:281
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_bert.py:383
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert.py:415
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert.py:448
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_bert.py:461
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert.py:483
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert.py:561
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert.py:657
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert.py:676
Method
forward
(self, hidden_states)
models/modeling_bert.py:697
Method
forward
(self, sequence_output: torch.Tensor)
models/modeling_bert.py:708
Method
forward
(self, pooled_output)
models/modeling_bert.py:718
Method
forward
(self, sequence_output, pooled_output)
models/modeling_bert.py:729
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_bert.py:918
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked lan
models/modeling_bert.py:1075
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_bert.py:1191
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked language mo
models/modeling_bert.py:1331
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the next sequence prediction (classifi
models/modeling_bert.py:1423
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
models/modeling_bert.py:1541
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the multiple choice classification los
models/modeling_bert.py:1641
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the token classificati
models/modeling_bert.py:1742
Method
forward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
models/modeling_bert.py:1827
Method
forward
( self, input_ids=None, token_type_ids=None, position_ids=None, inputs_embeds=None, past_key_values_le
models/modeling_roberta.py:99
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_roberta.py:192
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_roberta.py:295
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_roberta.py:328
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_roberta.py:362
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_roberta.py:376
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_roberta.py:399
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_roberta.py:478
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_roberta.py:575
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_roberta.py:748
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_roberta.py:911
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked language mo
models/modeling_roberta.py:1074
Method
forward
(self, features, **kwargs)
models/modeling_roberta.py:1146
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
models/modeling_roberta.py:1191
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the multiple choice classification los
models/modeling_roberta.py:1288
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the token classificati
models/modeling_roberta.py:1388
Method
forward
(self, features, **kwargs)
models/modeling_roberta.py:1454
Method
forward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
models/modeling_roberta.py:1494
Method
forward
( self, input_ids: Optional[torch.LongTensor] = None, token_type_ids: Optional[torch.L
models/modeling_bert_new_timestep.py:223
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert_new_timestep.py:296
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_bert_new_timestep.py:398
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert_new_timestep.py:430
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert_new_timestep.py:463
Method
forward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
models/modeling_bert_new_timestep.py:476
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert_new_timestep.py:504
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
models/modeling_bert_new_timestep.py:589
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert_new_timestep.py:688
Method
forward
(self, hidden_states: torch.Tensor)
models/modeling_bert_new_timestep.py:707
Method
forward
(self, hidden_states)
models/modeling_bert_new_timestep.py:728
Method
forward
(self, sequence_output: torch.Tensor)
models/modeling_bert_new_timestep.py:739
Method
forward
(self, pooled_output)
models/modeling_bert_new_timestep.py:749
Method
forward
(self, sequence_output, pooled_output)
models/modeling_bert_new_timestep.py:760
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_bert_new_timestep.py:949
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked lan
models/modeling_bert_new_timestep.py:1107
Method
forward
r""" encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*): Sequence of h
models/modeling_bert_new_timestep.py:1223
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked language mo
models/modeling_bert_new_timestep.py:1363
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the next sequence prediction (classifi
models/modeling_bert_new_timestep.py:1455
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
models/modeling_bert_new_timestep.py:1573
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the multiple choice classification los
models/modeling_bert_new_timestep.py:1673
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the token classificati
models/modeling_bert_new_timestep.py:1774
Method
forward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
models/modeling_bert_new_timestep.py:1859
Method
get
(self, t)
diffusion_word_freq.py:394
Method
get
(self, t)
diffusion_condition.py:429
Method
get_input_embeddings
(self)
models/modeling_bert.py:897
Method
get_input_embeddings
(self)
models/modeling_roberta.py:726
Method
get_input_embeddings
(self)
models/modeling_bert_new_timestep.py:928
Method
get_output_embeddings
(self)
models/modeling_bert.py:1067
Method
get_output_embeddings
(self)
models/modeling_bert.py:1178
Method
get_output_embeddings
(self)
models/modeling_bert.py:1316
Method
get_output_embeddings
(self)
models/modeling_roberta.py:903
Method
get_output_embeddings
(self)
models/modeling_roberta.py:1058
Method
get_output_embeddings
(self)
models/modeling_bert_new_timestep.py:1099
Method
get_output_embeddings
(self)
models/modeling_bert_new_timestep.py:1210
Method
get_output_embeddings
(self)
models/modeling_bert_new_timestep.py:1348
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:66
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:66
Function
get_timestep_embedding
Create sinusoidal timestep embeddings. :param timesteps: a 1-D Tensor of N indices, one per batch element. These may be
models/modeling_bert_new_timestep.py:181
Function
kl_divergence_with_probs
Compute the KL between two categorical distributions from their probabilities. Args: p: [..., dim] array with probs for the first distribution
losses.py:6
Method
load_original
(self, split)
dataloader.py:47
Function
load_tf_weights_in_bert
Load tf checkpoints in a pytorch model.
models/modeling_bert.py:109
Function
load_tf_weights_in_bert
Load tf checkpoints in a pytorch model.
models/modeling_bert_new_timestep.py:109
Function
min_max_norm
(t, dim)
utils.py:28
Method
my_load
(self, splits)
dataloader.py:69
Method
new_convert_to_features
(example_batch, model_tokenizer, electra_tokenizer, electra_model)
dataloader.py:164
Method
post_process_sample_in_prediction
(self, sample, x_0)
sample.py:9
Method
post_process_sample_in_prediction
(self, sample, x_0)
sample.py:34
Method
prepare_inputs_for_generation
(self, input_ids, past=None, attention_mask=None, **model_kwargs)
models/modeling_bert.py:1276
Method
prepare_inputs_for_generation
(self, input_ids, attention_mask=None, **model_kwargs)
models/modeling_bert.py:1390
Method
prepare_inputs_for_generation
(self, input_ids, past=None, attention_mask=None, **model_kwargs)
models/modeling_roberta.py:1015
Method
prepare_inputs_for_generation
(self, input_ids, past=None, attention_mask=None, **model_kwargs)
models/modeling_bert_new_timestep.py:1308
← previous
next →
201–300 of 340, ranked by callers