-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
29 lines (23 loc) · 793 Bytes
/
main.py
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
# main.py
import os
from src.model import CoTModel
from src.train import train_model
from src.evaluate import evaluate_model
from src.analyze import plot_predictions, plot_loss
from src.utils import load_data
# Create results directories
os.makedirs('results/analysis_plots', exist_ok=True)
os.makedirs('results/logs', exist_ok=True)
# Load data
X_train, y_train, X_test, y_test = load_data()
# Initialize and train model
model = CoTModel()
losses = train_model(model, X_train, y_train)
# Evaluate model
outputs, cot = evaluate_model(model, X_test, y_test)
print("Chain-of-Thought Reasoning:")
for step in cot[:3]: # Print first 3 CoT steps as an example
print(step)
# Analyze results
plot_predictions(y_test.numpy(), outputs.numpy())
plot_loss(losses)