-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
61 lines (57 loc) · 1.47 KB
/
__init__.py
File metadata and controls
61 lines (57 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
LT-MIA: Large-scale Transferable Membership Inference Attack
A framework for membership inference attacks on language models using
per-token feature extraction and transformer-based classification.
"""
__version__ = "0.1.0"
from .utils import set_seed, get_device, load_config
from .data import (
load_data_splits,
CombinedMIADataset,
CombinedMIADatasetSimple,
)
from .models import (
prepare_tokenizer_and_models,
apply_lora_if_enabled,
create_mia_model,
)
from .training import finetune_model_on_texts, train_mia_model
from .evaluation import MIAEvaluator, EvalResults, compute_curve_metrics
from .features import (
extract_per_token_features_both,
save_features,
load_features_mmap,
ExtractionMetadata,
ManifestEntry,
load_manifest,
save_manifest,
update_manifest,
make_combo_id,
)
from .config import build_extraction_config
__all__ = [
"set_seed",
"get_device",
"load_config",
"load_data_splits",
"CombinedMIADataset",
"CombinedMIADatasetSimple",
"prepare_tokenizer_and_models",
"apply_lora_if_enabled",
"create_mia_model",
"finetune_model_on_texts",
"train_mia_model",
"MIAEvaluator",
"EvalResults",
"compute_curve_metrics",
"extract_per_token_features_both",
"save_features",
"load_features_mmap",
"ExtractionMetadata",
"ManifestEntry",
"load_manifest",
"save_manifest",
"update_manifest",
"make_combo_id",
"build_extraction_config",
]