Views
No views yet
1import torch
2from model import TabularModel # Ensure this matches your module structure
3
4# Load model checkpoint
5checkpoint = torch.load('ev_classifier_model.pth')
6model = TabularModel(input_size=9, hidden_sizes=[128, 64, 32], output_size=2)
7model.load_state_dict(checkpoint['model_state_dict'])
8model.eval()
9
10# Example inference
11sample = torch.tensor([[0.5, 0.3, 2022, 250, 35000, 1, 0, 0.8, 0.6]]) # Replace with actual feature values
12output = model(sample)
13predicted_class = torch.argmax(output, dim=1)
14print("Predicted class:", predicted_class.item()) # 0 = BEV, 1 = PHEV