-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathquick_start.py
More file actions
executable file
·79 lines (66 loc) · 3.01 KB
/
Copy pathquick_start.py
File metadata and controls
executable file
·79 lines (66 loc) · 3.01 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
"""
Quick start script for FireGNN framework.
Runs a simple example with OrganCMNIST dataset.
"""
import os
import sys
import subprocess
def main():
print("FireGNN Quick Start")
print("=" * 50)
# Check if we have the required graph file
graph_file = "datasets/G_Organcmnist_inductive.gpickle"
if not os.path.exists(graph_file):
print(f"Graph file {graph_file} not found!")
print("Please ensure you have the required graph files in the datasets/ directory.")
print("You can copy them from the S-XAI/Models/ directory or build them using:")
print("python data_processing/build_graphs.py --dataset organcmnist")
return
print(f"Found graph file: {graph_file}")
# Run a simple baseline training
print("\nTraining GCN baseline model...")
cmd = f"python models/train_baseline.py --model gcn --dataset organcmnist --graph_file {graph_file} --output_dir results --epochs 50 --n_folds 2"
try:
result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
print("✓ GCN baseline training completed!")
if result.stdout:
print("Output:", result.stdout[-500:]) # Last 500 chars
except subprocess.CalledProcessError as e:
print(f"✗ Error training GCN baseline: {e}")
if e.stderr:
print("Error:", e.stderr)
return
# Run fuzzy model training
print("\nTraining GCN fuzzy model...")
cmd = f"python fuzzy_models/train_fuzzy.py --model gcn --dataset organcmnist --graph_file {graph_file} --output_dir results --epochs 50 --n_folds 2"
try:
result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
print("✓ GCN fuzzy training completed!")
if result.stdout:
print("Output:", result.stdout[-500:]) # Last 500 chars
except subprocess.CalledProcessError as e:
print(f"✗ Error training GCN fuzzy: {e}")
if e.stderr:
print("Error:", e.stderr)
return
# Run auxiliary model training
print("\nTraining GCN auxiliary model...")
cmd = f"python auxiliary_models/train_auxiliary.py --model gcn --dataset organcmnist --graph_file {graph_file} --output_dir results --epochs 50 --n_folds 2"
try:
result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
print("✓ GCN auxiliary training completed!")
if result.stdout:
print("Output:", result.stdout[-500:]) # Last 500 chars
except subprocess.CalledProcessError as e:
print(f"✗ Error training GCN auxiliary: {e}")
if e.stderr:
print("Error:", e.stderr)
return
print("\n" + "=" * 50)
print("Quick start completed!")
print("Check the results/ directory for outputs.")
print("\nTo run the full pipeline, use:")
print("python run_pipeline.py --dataset organcmnist --train_baselines --train_fuzzy --train_auxiliary")
if __name__ == '__main__':
main()