Downloads · 30 days
10
10% of all-time downloads
abderrahmane802/battery-soh-lstm
battery-soh-lstm is a machine learning model from abderrahmane802. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
LSTM-based model for predicting the State of Health (SoH) of electric vehicle batteries.
Downloads · 30 days
10
10% of all-time downloads
All-time downloads
102
Public
Repo size
1.4 MB
Likes
0
Public
Click a slice to open those files.
.pt1.1 MB · 80%
From the Hugging Face model README
LSTM-based model for predicting the State of Health (SoH) of electric vehicle batteries.
Architecture based on:
| Metric | Value |
|---|---|
| MAE | 0.005013 |
| RMSE | 0.006177 |
| MAPE | 0.51% |
| R² | 0.8846 |
import torch
import json
from model import BatterySoHLSTM
# Load model
checkpoint = torch.load('battery_soh_lstm.pt', map_location='cpu')
config = checkpoint['config']
model = BatterySoHLSTM(
n_features=config['n_features'],
embed_dim=config['embed_dim'],
intra_layers=config['intra_layers'],
lstm_hidden=config['lstm_hidden'],
lstm_layers=config['lstm_layers'],
dropout=config['dropout'],
bidirectional=config['bidirectional']
)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
# Predict SoH from 20 consecutive cycles of features
# Input: (batch, 20, 8) - 20 cycles, 8 features each
x = torch.randn(1, 20, 8) # replace with real data
with torch.no_grad():
soh = model(x)
print(f"Predicted SoH: {soh.item():.4f}")