Views
No views yet
| Version | File | RMSE | MAE | Params |
|---|---|---|---|---|
| v0.1 | ev_charger_lstm_v0.1.safetensors | 240.55 kWh | 186.11 kWh | 4,513 |
| v0.2 | ev_charger_lstm_multilocation.safetensors | 221.31 kWh | 137.98 kWh | 50,753 |
| v0.3 | ev_charger_lstm_v03.safetensors | 218.98 kWh | 136.09 kWh | 52,801 |
input_size = 10 # [kWh_scaled, day_of_week, loc_0...loc_7]
hidden_size = 64
num_layers = 2
dropout = 0.2
window_size = 14 # days of lookback
output = scalar # next-day kWh| Model | RMSE | MAE |
|---|---|---|
| Prophet | 260.05 kWh | 206.22 kWh |
| LSTM v0.3 | 218.98 kWh | 136.09 kWh |
1import torch
2from safetensors.torch import load_file
3
4class EVChargerLSTM(torch.nn.Module):
5 def __init__(self, input_size, hidden_size, num_layers):
6 super().__init__()
7 self.lstm = torch.nn.LSTM(input_size, hidden_size, num_layers, batch_first=True, dropout=0.2)
8 self.fc = torch.nn.Linear(hidden_size, 1)
9 def forward(self, x):
10 out, _ = self.lstm(x)
11 return self.fc(out[:, -1, :]).squeeze(1)
12
13model = EVChargerLSTM(input_size=10, hidden_size=64, num_layers=2)
14state_dict = load_file("ev_charger_lstm_v03.safetensors")
15model.load_state_dict(state_dict)
16model.eval()
17
18# Input: (batch, 14, 10) — [kWh_scaled, day_of_week, loc_0...loc_7]
19# Output: (batch,) predicted kWh (scaled) — inverse_transform with per-location scaler