Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ant-louis/belgpt2
/ functions
Functions
256 in github.com/ant-louis/belgpt2
⨍
Functions
256
◇
Types & classes
35
Function
build_model
Build model.
scripts/tools/xlm/model/__init__.py:106
Function
check_data_params
Check datasets parameters.
scripts/tools/xlm/data/loader.py:231
Function
check_model_params
Check models parameters.
scripts/tools/xlm/model/__init__.py:20
Method
clm_step
Next word prediction step (causal prediction). CLM objective.
scripts/tools/xlm/trainer.py:713
Function
collate
(examples: List[torch.Tensor])
scripts/tools/run_language_modeling.py:244
Method
end_epoch
End the epoch.
scripts/tools/xlm/trainer.py:645
Method
extra_repr
(self)
scripts/tools/xlm/model/memory/query.py:76
Method
forward
Compute the loss, and optionally the scores.
scripts/tools/xlm/model/transformer.py:128
Method
forward
Self-attention (if kv is None) or attention over source sentence (provided by kv).
scripts/tools/xlm/model/transformer.py:168
Method
forward
(self, input)
scripts/tools/xlm/model/transformer.py:233
Method
forward
Read from the memory.
scripts/tools/xlm/model/memory/memory.py:138
Method
forward
(self, input)
scripts/tools/xlm/model/memory/query.py:72
Method
forward
(self, input)
scripts/tools/xlm/model/memory/query.py:104
Method
forward
Generate queries from hidden states by either repeating them or creating some shuffled version.
scripts/tools/xlm/model/memory/query.py:126
Method
forward
Compute queries using either grouped 1D convolutions or ModuleList + concat.
scripts/tools/xlm/model/memory/query.py:186
Method
forward
(self, input)
scripts/tools/xlm/model/memory/query.py:239
Function
gelu
GELU activation https://arxiv.org/abs/1606.08415 https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.p
scripts/tools/xlm/model/transformer.py:73
Function
get_gaussian_keys
Generate random Gaussian keys.
scripts/tools/xlm/model/memory/utils.py:16
Method
get_indices
Generate scores and indices given unnormalized queries.
scripts/tools/xlm/model/memory/memory.py:499
Method
get_indices
Generate scores and indices given unnormalized queries.
scripts/tools/xlm/model/memory/memory.py:616
Method
get_iterator
Return a sentences iterator.
scripts/tools/xlm/data/dataset.py:67
Method
get_iterator
Return a sentences iterator.
scripts/tools/xlm/data/dataset.py:197
Method
get_iterator
Return a sentences iterator.
scripts/tools/xlm/data/dataset.py:365
Function
get_knn_pytorch
Input: - matrix of size (m, d) (keys) - matrix of size (n, d) (queries) - number of nearest neighbors - distance
scripts/tools/xlm/model/memory/utils.py:84
Function
get_uniform_keys
Generate random uniform keys (same initialization as nn.Linear).
scripts/tools/xlm/model/memory/utils.py:27
Function
init_distributed_mode
Handle single and multi-GPU / multi-node / SLURM jobs. Initialize the following variables: - n_nodes - node_id - loca
scripts/tools/xlm/slurm.py:46
Method
init_keys
Initialize keys.
scripts/tools/xlm/model/memory/memory.py:416
Method
init_keys
Initialize keys.
scripts/tools/xlm/model/memory/memory.py:558
Function
init_signal_handler
Handle signals sent by SLURM for time limit / pre-emption.
scripts/tools/xlm/slurm.py:37
Function
initialize_exp
Initialize the experience: - dump parameters - create a logger
scripts/tools/xlm/utils.py:47
Method
iter
End of iteration.
scripts/tools/xlm/trainer.py:264
Function
load_data
Load monolingual data. The returned dictionary contains: - dico (dictionary) - vocab (FloatTensor) - train / valid /
scripts/tools/xlm/data/loader.py:330
Method
mlm_step
Masked word prediction step. MLM objective is lang2 is None, TLM objective otherwise.
scripts/tools/xlm/trainer.py:753
Method
mt_step
Machine translation step. Can also be used for denoising auto-encoding.
scripts/tools/xlm/trainer.py:876
Method
pc_step
Parallel classification step. Predict if pairs of sentences are mutual translations of each other.
scripts/tools/xlm/trainer.py:788
Function
read_codepage
Keep only characters belonging to the character set of a language Args: -- text: input text -- code page: for each language. Ex
scripts/tools/clean_text.py:37
Method
register_args
Register memory parameters
scripts/tools/xlm/model/memory/memory.py:229
Method
reload
Create a sentence embedder from a pretrained model.
scripts/tools/xlm/model/embedder.py:26
Function
reset_time
()
scripts/tools/xlm/logger.py:62
Method
run
Run GLUE training / evaluation.
scripts/tools/xlm/evaluation/glue.py:68
Method
run
Run XNLI training / evaluation.
scripts/tools/xlm/evaluation/xnli.py:53
Method
run
Run training/evaluation
scripts/tools/xlm/evaluation/flue.py:82
Method
run_all_evals
Run all evaluations.
scripts/tools/xlm/evaluation/evaluator.py:240
Method
save_best_model
Save best models according to given validation metrics.
scripts/tools/xlm/trainer.py:629
Method
save_periodic
Save the models periodically.
scripts/tools/xlm/trainer.py:620
Function
save_weights
(path, model)
scripts/tools/utils.py:4
Method
select_data
Only select a subset of the dataset.
scripts/tools/xlm/data/dataset.py:52
Function
set_sampling_probs
Set the probability of sampling specific languages / language pairs during training.
scripts/tools/xlm/utils.py:185
Method
shape
projection
scripts/tools/xlm/model/transformer.py:184
Function
shuf_order
Randomize training order.
scripts/tools/xlm/utils.py:254
Function
sig_handler
(signum, frame)
scripts/tools/xlm/slurm.py:20
Method
step
(self, closure=None)
scripts/tools/xlm/optim.py:135
Method
step
(self, closure=None)
scripts/tools/xlm/optim.py:204
Function
term_handler
(signum, frame)
scripts/tools/xlm/slurm.py:32
Method
train
(self)
scripts/tools/xlm/model/embedder.py:72
Method
unshape
compute context
scripts/tools/xlm/model/transformer.py:188
← previous
201–256 of 256, ranked by callers