- State of Charge (SOC) (%)
- Battery Voltage (V)
- Battery Temperature (C)
- Current Vehicle Speed (km/h or mph)
- Average Speed over the last 5 minutes
- Current draw (A) (can be inferred or included directly)
- State of Health (SOH) (%) (optional, useful for long-term accuracy)
- Range (distance in km/miles)
EVdata = torch.randn(NUM_SAMPLES, INPUT_DIM) # 100 samples, 10 features each
MIN_RANGE = 0
MAX_RANGE = 100
EVrange = torch.FloatTensor(NUM_SAMPLES,1 ).uniform_(MIN_RANGE, MAX_RANGE)
python3 model_trainer.py
It is expected that model weights will not converge during training as randomized data is used.
Model training using flower FL library with pytorch model
Following steps are required to run the demo for EV range model training using Federated Learning
- Use
flwr newto create a template director - Update model architecture and data source for the use case in
./ev_range_pred/task.py- Replace the CIFAR dataset with random data
- Replace
flower_datasetswithtorch DataLoader
Above steps are completed in ./ev_range_pred directory.
Run below commands in different terminals as given in deployment tutorial.
flower-superlink --insecure
flower-supernode \
--insecure \
--superlink 127.0.0.1:9092 \
--clientappio-api-address 127.0.0.1:9094 \
--node-config "partition-id=0 num-partitions=2"
flower-superexec \
--insecure \
--plugin-type clientapp \
--appio-api-address zupernode-1:9094