Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/amazon-science/controlling-llm-memorization
/ functions
Functions
12 in github.com/amazon-science/controlling-llm-memorization
⨍
Functions
12
◇
Types & classes
1
↓ 1 callers
Method
initialize_embedding
initializes learned embedding Args: same as __init__ Returns: torch.float: initialized using original scheme
src/my_utils.py:129
↓ 1 callers
Function
main
()
src/baseline.py:22
↓ 1 callers
Function
main
()
src/promptLearn_defense.py:23
↓ 1 callers
Function
main
()
src/promptLearn_attack.py:23
Method
__init__
appends learned embedding to Args: wte (nn.Embedding): original transformer word embedding n_tokens (int, optional):
src/my_utils.py:108
Function
compute_reconstruct_rate
compute fractional and exact reconstruction rates
src/my_utils.py:16
Function
evaluate
get inference loss on supplied data loader
src/my_utils.py:43
Function
evaluate_distributed
get inference loss on supplied data loader (for distributed training)
src/my_utils.py:82
Method
forward
run forward pass Args: tokens (torch.long): input tokens before encoding Returns: torch.float: encoding of t
src/my_utils.py:148
Function
generate_suffixes
generate suffixes from the supplied data loader
src/my_utils.py:24
Function
generate_suffixes_distributed
generate suffixes from the supplied data loader (for distributed training)
src/my_utils.py:60
Function
load_prompts
Loads prompts from the file pointed to prompt_path
src/my_utils.py:11