long-live-the-battery
Predicting total battery cycle life time with machine learning.
https://github.com/dsr-18/long-live-the-battery
Last synced: over 1 year ago
JSON representation
Acceptance Criteria
- Revelant topics? false
- External users? true
- Open source license? false
- Active? false
- Fork? false
Repository metadata
Predicting total battery cycle life time with machine learning
- Host: GitHub
- URL: https://github.com/dsr-18/long-live-the-battery
- Owner: dsr-18
- Created: 2019-05-16T13:14:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-25T00:14:50.000Z (about 2 years ago)
- Last Synced: 2024-01-20T03:34:06.338Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 1.1 MB
- Stars: 84
- Watchers: 6
- Forks: 44
- Open Issues: 6
- Releases: 0
-
Metadata Files:
- Readme: README.md
README.md
long-live-the-battery
Predicting total battery cycle life time with TensorFlow 2. We're going to publish a blog post describing the project in-depth soon.
This project is based on the work done in the paper 'Data driven prediciton of battery cycle life before capacity degradation' by K.A. Severson, P.M. Attia, et al., and uses the corresponding data set. The original instructions for how to load the data can be found here.
Setup
We recommend to set up a virtual environment using a tool like Virtualenv.
Clone this repo
git clone https://github.com/dsr-18/long-live-the-battery
and install dependencies.
pip install -r requirements.txt
You can download the processed dataset here and jump to Train Model. If you want to reproduce the data preprocessing step, go ahead with Generate Local Data.
Generate Local Data
Before running the model, generate local data:
- Download the original three batch files here into a data directory like this:
long-live-the-battery
├── data
| ├── 2017-05-12_batchdata_updated_struct_errorcorrect.mat
| ├── 2018-04-12_batchdata_updated_struct_errorcorrect.mat
| └── 2017-06-30_batchdata_updated_struct_errorcorrect.mat
- Make sure data is empty otherwise. Then from the base directory run
python -m trainer.data_preprocessing
to create a processed_data.pkl file.
- Then run
python -m trainer.data_pipeline
to recreate the .tfrecord files.
Train Model
Make sure the .tfrecord files are saved in this structure:
long-live-the-battery
├── data
| ├── tfrecords
| | ├── scaling_factors.csv
| | ├── train
| | ├── test
| | └── secondary_test
To start training the model, run this command from the base directory:
python -m trainer.task
The default is set to three epochs which is okay for testing, but too short to train a reasonably fit model. Use the above command with the --num-epochs flag to set a higher number. To get a list of other parameters, use the --help flag.
To run the model in Google Cloud Platform (team members only):
- Make sure you have access to the ion-age project.
- Install GCloud SDK.
- Run from base directory (with -h to see configurable options):
./train.sh
Follow the output URL to stream logs.
Predict
Every training run saves a TensorBoard logfile and at least one model checkpoint by default in the Graph directory. One way to test your model's performance without writing your own TensorFlow Keras code is to start a local Flask server that serves predictions:
- Copy any model from a checkpoints directory within Graph to the server directory.
- Rename that model folder to saved_model.
- Create sample data to predict on:
python generate_json_samples.py
- Go into the server and start it from there:
cd server
python server.py
- Now visit "localhost:5000" in your browser and you should see the start page with a prompt to upload battery data in json-format. The site also lets you select the sample data randomly.
Owner metadata
- Name: dsr-18
- Login: dsr-18
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/50706126?v=4
- Repositories: 2
- Last ynced at: 2023-03-08T23:14:12.179Z
- Profile URL: https://github.com/dsr-18
GitHub Events
Total
- Issues event: 6
- Watch event: 91
- Delete event: 7
- Issue comment event: 12
- Push event: 252
- Pull request review comment event: 3
- Pull request event: 73
- Fork event: 44
- Create event: 15
Last Year
- Create event: 1
- Delete event: 1
- Fork event: 3
- Issue comment event: 1
- Pull request event: 2
- Watch event: 23
Committers metadata
Last synced: over 1 year ago
Total Commits: 283
Total Committers: 3
Avg Commits per committer: 94.333
Development Distribution Score (DDS): 0.459
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Adem Frenk | a****k@g****m | 153 |
Rubbedikatz | b****l@w****e | 74 |
moxkari | c****y@g****m | 56 |
Committer domains:
Issue and Pull Request metadata
Last synced: over 1 year ago
Total issues: 5
Total pull requests: 39
Average time to close issues: 11 days
Average time to close pull requests: 18 days
Total issue authors: 5
Total pull request authors: 5
Average comments per issue: 0.8
Average comments per pull request: 0.26
Merged pull request: 31
Bot issues: 0
Bot pull requests: 7
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 1
Top Issue Authors
- intelljames (1)
- janoroelandt (1)
- leon224 (1)
- SunnyHong36 (1)
- yusufkenanturak23 (1)
Top Pull Request Authors
- Rubbedikatz (16)
- AdemFr (10)
- dependabot[bot] (7)
- moxkari (5)
- RaghaVdot24 (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (7)
Dependencies
- flask >=1.0.3
- google-cloud-storage >=1.16.1
- h5py >=2.9.0
- jupyter >=1.0.0
- numpy >=1.16
- pandas >=0.24
- plotly >=3.10.0
- scipy >=1.2.1
- sklearn *
- tensorboard *
- tensorflow >=2.0.0
- flask *
- numpy *
- plotly *
- tensorflow ==2.0.0
Score: 5.598421958998375