Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/McGill-NLP/length-generalization
/ functions
Functions
942 in github.com/McGill-NLP/length-generalization
⨍
Functions
942
◇
Types & classes
118
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/lego_instance_processor.py:54
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/data_instance_processor.py:694
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/addition_instance_processor.py:49
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/clutrr_instance_processor.py:52
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/parity_instance_processor.py:52
↓ 1 callers
Method
_create_prompt
(self, example: Dict[str, Any])
src/data/data_instance_processor/sum_instance_processor.py:126
↓ 1 callers
Method
_create_sbatch_launch_script
( self, compute_script_path: Path, persistent_key: str )
scripts/launcher.py:305
↓ 1 callers
Method
_create_targets
(self, answer: str)
src/data/data_instance_processor/lego_instance_processor.py:70
↓ 1 callers
Method
_create_targets
(self, answer: Any)
src/data/data_instance_processor/data_instance_processor.py:702
↓ 1 callers
Method
_create_targets
(self, answer: int)
src/data/data_instance_processor/addition_instance_processor.py:60
↓ 1 callers
Method
_create_targets
(self, answer: str)
src/data/data_instance_processor/clutrr_instance_processor.py:61
↓ 1 callers
Method
_create_targets
(self, answer: str)
src/data/data_instance_processor/parity_instance_processor.py:63
↓ 1 callers
Method
_create_targets
(self, answer: Any)
src/data/data_instance_processor/sum_instance_processor.py:136
↓ 1 callers
Function
_dict_generator
(input_dict, prefixes=None)
src/common/py_utils.py:120
↓ 1 callers
Method
_dump_config_obj
(self, config)
src/main.py:204
↓ 1 callers
Method
_embed_spans
Returns the span embeddings computed in many different ways.
src/modules/span_extractors/span_extractor_with_span_width_embedding.py:161
↓ 1 callers
Function
_expand_mask
Expands attention_mask from `[batch_size, src_length]` to `[batch_size, 1, tgt_length, src_length]`.
src/models/custom_t5_decoder_only.py:578
↓ 1 callers
Method
_find_optimal_batch_size
Find the optimal batch size for training. Borrowed from https://github.com/Lightning-AI/lightning/blob/master/src/lightning/pytorch/tuner/batc
src/analyzers/runtime_analyzer.py:334
↓ 1 callers
Function
_flatten_low_entropy
For dict, list and set objects_ calls itself on the elements and for other types assigns the object_ to the corresponding key
src/common/nest.py:204
↓ 1 callers
Method
_get_batch_size
(self, stage)
src/data/base_dl_factory.py:109
↓ 1 callers
Method
_get_category
(self, example: Dict[str, Any])
src/data/data_instance_processor/data_instance_processor.py:67
↓ 1 callers
Method
_get_category
(self, example: Dict[str, Any])
src/data/data_instance_processor/data_instance_processor.py:706
↓ 1 callers
Method
_get_config_for_manual_sweep
(self, config: JsonDict)
src/main.py:168
↓ 1 callers
Method
_get_config_for_sweep
(self, config: JsonDict)
src/main.py:85
↓ 1 callers
Method
_get_group_fn
(self)
src/data/s2s_dl_factory.py:382
↓ 1 callers
Method
_get_hash_key
(self)
src/data/data_instance_processor/data_instance_processor.py:205
↓ 1 callers
Function
_get_suggestion
(name: str, available: List[str])
src/common/registrable.py:312
↓ 1 callers
Method
_get_sweep_run_id_and_dir
(self, config: JsonDict)
src/main.py:107
↓ 1 callers
Method
_get_tokenize_function
( self, add_special_tokens: bool = True, is_training: bool = True )
src/data/sequence_classification_dl_factory.py:89
↓ 1 callers
Method
_get_tokenize_function
( self, add_special_tokens: bool = True, is_training: bool = True )
src/data/token_classification_dl_factory.py:77
↓ 1 callers
Method
_get_tokenize_function_for_decoder_only
( self, add_special_tokens: bool = True, is_training: bool = True )
src/data/sequence_classification_dl_factory.py:103
↓ 1 callers
Method
_get_tokenize_function_for_decoder_only
( self, add_special_tokens: bool = True, is_training: bool = True )
src/data/s2s_dl_factory.py:329
↓ 1 callers
Method
_get_tokenize_function_for_encoder_decoder
( self, add_special_tokens: bool = True )
src/data/s2s_dl_factory.py:282
↓ 1 callers
Method
_get_tokenize_function_for_encoder_only
( self, add_special_tokens: bool = True, is_training: bool = True )
src/data/sequence_classification_dl_factory.py:149
↓ 1 callers
Function
_is_dict_free
Returns False if obj is a dict, or if it's a list with an element that _has_dict.
src/common/params.py:152
↓ 1 callers
Function
_is_encodable
We need to filter out environment variables that can't be unicode-encoded to avoid a "surrogates not allowed" error in jsonnet.
src/common/params.py:75
↓ 1 callers
Method
_load_config_obj
(self, filenames: List[str])
src/main.py:211
↓ 1 callers
Method
_log_examples
(self, ds: Dataset, name: str)
src/data/s2s_dl_factory.py:404
↓ 1 callers
Function
_make_causal_mask
Make causal mask used for self-attention.
src/models/custom_t5_decoder_only.py:553
↓ 1 callers
Method
_measure_gpu_time
( compute_fn: Callable, repeat: int, num_warm_ups: int = 20 )
src/analyzers/runtime_analyzer.py:280
↓ 1 callers
Method
_patch_config_obj_for_di
(self, config)
src/main.py:198
↓ 1 callers
Method
_rel_shift
(self, x)
src/models/custom_t5_decoder_only.py:207
↓ 1 callers
Function
_replace_none
(params: Any)
src/common/params.py:573
↓ 1 callers
Method
_replace_target_tokens
(self, targets: str)
src/data/data_instance_processor/scan_instance_processor.py:34
↓ 1 callers
Method
_save_predictions
(self, state: TrainerState, tokenizer: PreTrainedTokenizer)
src/callbacks/save_predictions_callback.py:74
↓ 1 callers
Method
_save_predictions
(self, state: TrainerState, tokenizer: PreTrainedTokenizer)
src/callbacks/cartography_measure_callback.py:79
↓ 1 callers
Method
_to_params
Returns a dictionary of parameters that, when turned into a `Params` object and then fed to `.from_params()`, will recreate this obje
src/common/from_params.py:838
↓ 1 callers
Method
_write_predictions_to_file
(self, output_test_preds_file, preds, tokenizer)
src/callbacks/save_predictions_callback.py:103
↓ 1 callers
Method
_write_predictions_to_file_for_sequence_classification
( self, output_test_preds_file, preds, tokenizer )
src/callbacks/save_predictions_callback.py:137
↓ 1 callers
Function
add_python_paths
()
scripts/create_run_script.py:7
↓ 1 callers
Function
add_source_code
(art)
scripts/upload_experiment.py:461
↓ 1 callers
Function
add_sys_path
(new_path)
notebooks/utils.py:2
↓ 1 callers
Function
add_sys_path
(new_path)
src/common/wandb_utils.py:82
↓ 1 callers
Function
aggregate_group_fn
(runs: List[Run])
notebooks/plotting/training_plots.py:225
↓ 1 callers
Method
analyze
(self, config_filenames: str, load_best: bool = True)
src/runtime/seq2seq_runtime.py:1016
↓ 1 callers
Method
analyze_all_evaluation_steps
(self)
src/analyzers/seq_cls_analyzer.py:40
↓ 1 callers
Method
analyze_all_evaluation_steps
(self)
src/analyzers/seq2seq_analyzer.py:46
↓ 1 callers
Method
as_ordered_dict
Returns Ordered Dict of Params from list of partial order preferences. # Parameters preference_orders: `List[List[str]]`, o
src/common/params.py:483
↓ 1 callers
Function
batched_index_select
The given `indices` of size `(batch_size, d_1, ..., d_n)` indexes into the sequence dimension (dimension 2) of the target, which has size `(b
src/modules/span_extractors/self_attentive_span_extractor.py:79
↓ 1 callers
Function
batched_span_select
The given `spans` of size `(batch_size, num_spans, 2)` indexes into the sequence dimension (dimension 2) of the target, which has size `(batc
src/modules/span_extractors/self_attentive_span_extractor.py:130
↓ 1 callers
Function
bucket_values
Places the given values (designed for distances) into `num_total_buckets`semi-logscale buckets, with `num_identity_buckets` of these capturin
src/modules/span_extractors/span_extractor_with_span_width_embedding.py:12
↓ 1 callers
Function
build_alibi_tensor
Link to paper: https://arxiv.org/abs/2108.12409 Alibi tensor is not causal as the original paper mentions, it relies on a translation invaria
src/models/custom_t5_decoder_only.py:589
↓ 1 callers
Method
build_dataset
( self, path: Path, stage: ExperimentStage, **kwargs )
src/data/base_dl_factory.py:134
↓ 1 callers
Function
check_if_numbers_are_consecutive
Returns True if numbers in the list are consecutive :param list_: list of integers :return: Boolean
src/common/nest.py:19
↓ 1 callers
Function
compute_distance_two_matrix
(m1: torch.Tensor, m2: torch.Tensor)
src/analyzers/attention_kl_analyzer.py:34
↓ 1 callers
Function
compute_jsd_two_matrix
(m1: torch.Tensor, m2: torch.Tensor)
src/analyzers/attention_kl_analyzer.py:47
↓ 1 callers
Function
compute_max_attention_indices
(attn_map: torch.Tensor)
src/analyzers/attention_aggregate_analyzer.py:20
↓ 1 callers
Function
compute_mean_kl_distance_two_score_matrix
( score_matrix1: np.ndarray, score_matrix2: np.ndarray )
src/analyzers/attention_aggregate_analyzer.py:31
↓ 1 callers
Method
compute_metrics
(eval_preds: EvalPrediction)
src/data/s2s_dl_factory.py:591
↓ 1 callers
Function
construct_arg
The first two parameters here are only used for logging if we encounter an error.
src/common/from_params.py:446
↓ 1 callers
Method
constructor
(self)
src/common/lazy.py:61
↓ 1 callers
Method
create_compute_script
(self, tmp_exp_dir: Path, persistent_key: str)
scripts/launcher.py:336
↓ 1 callers
Method
create_corpus2
Creates a corpus of Shuffle-n sequences.
scripts/dataset_builders/make_dyck_pred_dataset.py:174
↓ 1 callers
Method
create_launch_script
(self, job_body)
scripts/launcher.py:246
↓ 1 callers
Function
create_md5_hash
(inp: str)
src/common/py_utils.py:230
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/lego_instance_processor.py:78
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/addition_instance_processor.py:68
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/clutrr_instance_processor.py:69
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/poly_instance_processor.py:73
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/parity_instance_processor.py:71
↓ 1 callers
Method
create_scratchpad_steps_from_data_instance
( self, data_instance: Dict[str, Any] )
src/data/data_instance_processor/sum_instance_processor.py:144
↓ 1 callers
Method
create_scratchpad_str
( self, scratchpad_steps: List[UnifedScratchpadStep] )
src/data/data_instance_processor/data_instance_processor.py:218
↓ 1 callers
Function
create_sweep_config_obj
(config_filenames: List[str])
scripts/manual_sweep.py:22
↓ 1 callers
Method
det_hash_object
(self)
src/common/from_params.py:848
↓ 1 callers
Function
download_all_dataset_bundles
(wandb_api: wandb.Api, download_root: Path)
scripts/wandb_download_all_bundles.py:79
↓ 1 callers
Function
download_and_load_results
( tags: List[str], force_download: bool = False, key: str = None, )
src/common/wandb_utils.py:405
↓ 1 callers
Function
download_and_save_code_bundle
( bundle_id: str, wandb_api: wandb.Api, download_root: Path )
scripts/wandb_download_all_bundles.py:42
↓ 1 callers
Function
download_bundle
(exp_key: str, output_dir: Path)
scripts/launch_experiment.py:617
↓ 1 callers
Function
download_file
Download a file from a remote host to the local machine.
notebooks/plotting/attention_analysis.py:96
↓ 1 callers
Function
download_remote_dir
Download a file from a remote host to the local machine.
notebooks/plotting/attention_analysis_utils.py:148
↓ 1 callers
Function
download_the_entire_run
(localhost: str, run: Run, root_dir: Path = None)
scripts/download_nope_runs_to_local.py:121
↓ 1 callers
Function
download_trained_model_on_ava
(args: argparse.Namespace)
scripts/launch_experiment.py:574
↓ 1 callers
Function
download_trained_model_on_cc
(args: argparse.Namespace)
scripts/launch_experiment.py:562
↓ 1 callers
Function
download_trained_model_on_mila
(args: argparse.Namespace)
scripts/launch_experiment.py:555
↓ 1 callers
Method
evaluate
(self, split: str = "test", load_best: bool = True)
src/runtime/seq2seq_runtime.py:692
↓ 1 callers
Function
evaluate_file
(filename: str, **_kwargs)
src/common/params.py:19
↓ 1 callers
Method
evaluate_parsed_scratchpad
( self, predicted_scratchpad_steps: List[UnifedScratchpadStep], failed_steps: List[str
src/data/data_instance_processor/data_instance_processor.py:491
↓ 1 callers
Function
evaluate_snippet
(_filename: str, expr: str, **_kwargs)
src/common/params.py:26
↓ 1 callers
Method
execute_job
(self, job_body)
scripts/launcher.py:67
↓ 1 callers
Method
extract_answer_from_final_output
(self, final_output: str)
src/data/data_instance_processor/lego_instance_processor.py:137
← previous
next →
201–300 of 942, ranked by callers