MCPcopy Create free account

hub / github.com/JonasGeiping/cramming / functions

Functions411 in github.com/JonasGeiping/cramming

Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:81
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:108
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:235
Methodforward
x: (batch, seqlen, hidden_dim) (where hidden_dim = num heads * head dim) key_padding_mask: bool tensor of shape (batch, seqlen) Retur
cramming/architectures/attention.py:302
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:343
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:440
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:478
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:518
Methodforward
Forward will take an attention mask but ignore it!
cramming/architectures/attention.py:548
Methodforward
Forward will take an attention mask but ignore it!
cramming/architectures/attention.py:604
Methodforward
(self, inputs, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:684
Methodforward
(self, inputs, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/attention.py:706
Methodforward
Sequence-scaled input.
cramming/architectures/attention.py:729
Methodforward
Sequence-scaled input cumulative sum.
cramming/architectures/attention.py:742
Methodforward
Sequence-scaled input cumulative sum.
cramming/architectures/attention.py:755
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/sanity_check.py:14
Methodforward
(self, states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/recurrent_transformers.py:72
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/recurrent_transformers.py:112
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/recurrent_transformers.py:185
Methodforward
(self, states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/recurrent_transformers.py:286
Methodforward
r"""Inputs of forward function Args: x: the sequence fed to the positional encoder model (required). Shape: x:
cramming/architectures/embeddings.py:28
Methodforward
r"""Inputs of forward function Args: x: the sequence fed to the positional encoder model (required). Shape: x:
cramming/architectures/embeddings.py:48
Methodforward
This is a batch-first implementation
cramming/architectures/embeddings.py:69
Methodforward
(self, query_layer: torch.Tensor, key_layer: torch.Tensor)
cramming/architectures/embeddings.py:118
Methodforward
(self, query_layer: torch.Tensor, key_layer: torch.Tensor)
cramming/architectures/embeddings.py:164
Methodforward
(self, q: torch.Tensor, k: torch.Tensor, seq_dimension: int = -2)
cramming/architectures/embeddings.py:226
Methodforward
(self, states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/fixed_cramlm.py:51
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/fixed_cramlm.py:72
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/fixed_cramlm.py:111
Methodforward
(self, input_ids, attention_mask: Optional[torch.Tensor] = None, labels: Optional[torch.Tensor] = None)
cramming/architectures/fixed_cramlm.py:169
Methodforward
(self, input_ids)
cramming/architectures/components.py:41
Methodforward
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/components.py:61
Methodforward
(self, hidden_states)
cramming/architectures/components.py:82
Methodforward
(self, states, attention_mask: Optional[torch.Tensor] = None, res_scale=1)
cramming/architectures/components.py:134
Methodforward
(self, states, attention_mask: Optional[torch.Tensor] = None, res_scale=1)
cramming/architectures/components.py:168
Methodforward
A variety of pooling options. Some ignore the cls token. Input needs to be B S H.
cramming/architectures/components.py:184
Methodforward
(self, hidden_states)
cramming/architectures/components.py:214
Methodforward
(self, inputs)
cramming/architectures/components.py:275
Methodforward
This is the same eps clipping as in the original ScaleNorm implementation.
cramming/architectures/components.py:300
Methodforward
This is the same eps clipping as in the original ScaleNorm implementation.
cramming/architectures/components.py:313
Methodforward
(self, states, *args, **kwargs)
cramming/architectures/components.py:326
Functionget_backend_config
Return default hydra config for a given attack.
cramming/__init__.py:38
Functionget_budget_constant_scheduler
Time-based scheduler with optional warmup and cooldown (so technically a trapezoidal shape)
cramming/backend/optimizers/schedulers.py:291
Functionget_budget_cosine_half_cycles_with_warmup
Follows the huggingface transformers scheduler with the same name, but gets an additional arg hour_budget
cramming/backend/optimizers/schedulers.py:334
Functionget_budget_cosine_schedule_with_warmup
Follows the huggingface transformers scheduler with the same name, but gets an additional arg hour_budget
cramming/backend/optimizers/schedulers.py:320
Functionget_budget_dive
Constant, then linear decay. plot min(1, 1/0.5 - x / (1000 * 0.5)) from 0 to 1000 in the plot range 0 to 1
cramming/backend/optimizers/schedulers.py:427
Functionget_budget_inv_cosine_schedule
An inverse cosine schedule, with limited budget.
cramming/backend/optimizers/schedulers.py:392
Functionget_budget_inv_sqrt_scheduler
Time-based scheduler as described in Iszak et al. plus inv_sqrt. Takes in num_warmup_steps and num_training_steps as normal, but actually squeezes
cramming/backend/optimizers/schedulers.py:268
Functionget_budget_linear_schedule_with_warmup
Follows the huggingface transformers scheduler with the same name, but gets an additional arg hour_budget
cramming/backend/optimizers/schedulers.py:307
Functionget_budget_multi_cycle
Simple multi-cycle scheduler. Not including paper/fastai three-phase things or asymmetry.
cramming/backend/optimizers/schedulers.py:362
Functionget_budget_one_cycle
Simple single-cycle scheduler. Not including paper/fastai three-phase things or asymmetry.
cramming/backend/optimizers/schedulers.py:348
Functionget_budget_polynomial_decay_with_warmup
Follows the huggingface transformers scheduler with the same name, but gets an additional arg hour_budget
cramming/backend/optimizers/schedulers.py:443
Functionget_budget_ramp
to the moon.
cramming/backend/optimizers/schedulers.py:377
Functionget_budget_triangle
Linear increase from a percentage of the base learning rate, then linear decay. plot min(0.5 + x * (1 - 0.5)/(1-0.25) / 1000, 1/0.25 - x / (1000
cramming/backend/optimizers/schedulers.py:410
Functionget_config
Return default hydra config.
cramming/__init__.py:22
Methodget_cos_sin_cache
(self, x: torch.Tensor)
cramming/architectures/embeddings.py:146
Functionget_inverse_sqrt_scheduler
Decay the LR based on the inverse square root of the update number. We also support a warmup phase where we linearly increase the learning rate
cramming/backend/optimizers/schedulers.py:200
Functionget_model_config
Return default hydra config for a given attack.
cramming/__init__.py:30
Functionget_one_cycle
Simple single-cycle scheduler. Not including paper/fastai three-phase things or asymmetry.
cramming/backend/optimizers/schedulers.py:231
Functionget_ramp
to the MOON.
cramming/backend/optimizers/schedulers.py:243
Functiongradinit
(self, dataloader, config)
cramming/backend/deepspeed_integration.py:100
Functiongroup_texts
(examples)
cramming/data/pretraining_preparation.py:238
Functionload_backend
(model, dataset, tokenizer, cfg_train, cfg_impl, setup=_default_setup)
cramming/backend/prepare_backend.py:10
Functionload_pretraining_corpus
Load (and optionally stage) a pre-processed corpus. Create one if it doesn't exist.
cramming/data/pretraining_preparation.py:30
Functionlr_lambda
(current_step: int)
cramming/backend/optimizers/schedulers.py:220
Functionmain_downstream_process
This function controls the central routine.
eval.py:19
Functionmain_launcher
This is boiler-plate code for a launcher.
cramming/utils.py:33
Functionmain_load_process
This function controls the central routine.
load_local_model.py:22
Functionmain_training_process
This function controls the central training loop.
pretrain.py:17
Functionnamed_entity_simplification
(examples)
cramming/data/pretraining_preparation.py:371
Functionno_whitespaces
(examples)
cramming/data/pretraining_preparation.py:382
Functionnum_processes
()
cramming/utils.py:167
Methodparameter_count
(self)
cramming/backend/optimizers/shampoo/shampoo_utils.py:140
Methodparameter_count
(self)
cramming/backend/optimizers/shampoo/shampoo_utils.py:640
Methodprecondition
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:125
Methodprecondition
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:200
Methodprecondition
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:648
Methodprecondition
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:673
Methodprecondition_and_update
( self, param, grad: Tensor, lr: Union[float, Tensor], )
cramming/backend/optimizers/shampoo/shampoo_utils.py:128
Methodprecondition_and_update
( self, param, grad: Tensor, lr: Union[float, Tensor], )
cramming/backend/optimizers/shampoo/shampoo_utils.py:205
Methodprecondition_and_update
(self, param, grad: Tensor, lr: Union[float, Tensor])
cramming/backend/optimizers/shampoo/shampoo_utils.py:464
Methodprecondition_and_update
( self, param, grad: Tensor, lr: Union[Tensor, float], )
cramming/backend/optimizers/shampoo/shampoo_utils.py:599
Methodprecondition_and_update
(self, param, grad: Tensor, lr: Union[float, Tensor])
cramming/backend/optimizers/shampoo/shampoo_utils.py:654
Methodprecondition_and_update
(self, param, grad: Tensor, lr: Union[float, Tensor])
cramming/backend/optimizers/shampoo/shampoo_utils.py:679
Functionprepare_task_dataloaders
Load all datasets in eval.tasks for finetuning and testing.
cramming/data/downstream_task_preparation.py:17
Functionpreprocess_function
(examples)
cramming/data/downstream_task_preparation.py:37
Functionreturn_seq_prob
(examples)
cramming/data/curriculum_sorting.py:33
Functionsandwich_layer_structure
(states, outputs, alpha, residual_scale, prob: float = 0.1, training: bool = False)
cramming/architectures/fused_layers.py:37
Functionsave_final_model
This checkpoint can be used for downstream tasks. The default behavior is to save this checkpoint to a checkpoints folder under base_directory/nam
cramming/backend/deepspeed_integration.py:82
Functionsave_summary
Save two summary tables. A detailed table of iterations/loss+acc and a summary of the end results.
cramming/utils.py:223
Functionsave_training_checkpoint
Path, identifier and additional client state. This checkpoint can be used to resume training. The default behavior is to save this checkpoint rela
cramming/backend/deepspeed_integration.py:75
Functionscaled_layer_eval
(states, outputs, alpha, residual_scale, prob: float = 0.1)
cramming/architectures/fused_layers.py:33
Functionscaled_layer_training
(states, outputs, alpha, residual_scale, prob: float = 0.1)
cramming/architectures/fused_layers.py:29
Functionscheduler_fn
(optimizer)
cramming/backend/optimizers/schedulers.py:182
Functionsimplified_layer_eval
(states, outputs, alpha, residual_scale, prob: float = 0.1)
cramming/architectures/fused_layers.py:50
Functionsimplified_layer_training
(states, outputs, alpha, residual_scale, prob: float = 0.1)
cramming/architectures/fused_layers.py:46
Methodsingle_forward
For cases where shapes of Q and K do not match.
cramming/architectures/embeddings.py:175
Functionstep
(self, batch)
cramming/backend/deepspeed_integration.py:59
Methodstep
(Maybe) performs a single optimization step.
cramming/backend/optimizers/progressive_batching.py:33
Methodstep
Performs a single optimization step. Arguments: gradsH: The gradient used to compute Hessian vector product. closure (
cramming/backend/optimizers/adahessian.py:119
← previousnext →301–400 of 411, ranked by callers