-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
34 lines (26 loc) · 849 Bytes
/
run.py
File metadata and controls
34 lines (26 loc) · 849 Bytes
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
"""
Convenience entrypoint: run experiments directly from the project root.
Usage (in PowerShell):
# Main experiment (single-parameter evaluation)
python run.py detect --ds_name AIDS
# Hyperparameter search
python run.py detect --ds_name REDDIT-BINARY --mode search
"""
import sys
import os
# Ensure the protoglad package is importable.
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
if __name__ == '__main__':
if len(sys.argv) < 2:
print(__doc__)
sys.exit(0)
task = sys.argv[1]
if task == 'detect':
# Forward to run_detection.py.
sys.argv = [sys.argv[0]] + sys.argv[2:]
from protoglad.experiments.run_detection import main
main()
else:
print(f"Unsupported task: {task}")
print("Only 'detect' is supported.")
sys.exit(1)