Code Monkey home page Code Monkey logo

batlinet's Introduction

Official Implementation for BatLiNet

This repository provide the complete code for reproducing the results of paper "Accurate battery lifetime prediction across diverse aging conditions with deep learning".

NOTE: To build features for MIX-100, you will need at least 128 GB memory. Also, to achieve efficiency, you need at least one GPU device for feature smoothing and learning algorithm.

Environment Setup

Docker

We recommend using our Docker image to reproduce our work. It includes all preprocessed data, code, and environment variables. You can pull the Docker image to your local environment using the following command:

docker pull batteryml/batlinet:latest

After pulling the Docker image and running the Docker container, you can execute the scripts mentioned in the Experiment Reproduction section to reproduce our experiments.

Conda

To start from a fresh installation of Ubuntu with GPU, first install conda and create a conda environment:

conda create -n nmi_reproduction
conda activate nmi_reproduction

Install PyTorch following the official instructions and then install the rest dependencies:

pip install -r requirements.txt

Install Microsoft font for figures:

$ apt install ttf-mscorefonts-installer && fc-cache -f
Arial.ttf: "Arial" "Regular"

Dataset preparation

In our experiments, we used the following public datasets:

  • MATR-1
  • MATR-2
  • SNL
  • UL_PUR
  • CLO
  • HNEI
  • RWTH
  • CALCE

Simply run the following script to download the raw data files and preprocess them:

export PYTHONPATH=.:$PYTHONPATH
python scripts/download.py --output-path ./data/raw
python scripts/preprocess.py --input-path ./data/raw --output-path ./data/processed

Experiment Reproduction

We run all our experiments by providing a config file to our CLI tool. You can find all the config files here. To accelerate training and evaluation, as well as reducing the memory footprint, you can first build the cache for all configs:

./scripts/build_cache.sh

This will load the datasets and build features for different configs with different train-test split, feature definition, etc.

To run a single config file, substitude the file path to the config file you would like to run and execute the following command:

PYTHONPATH=. python scripts/pipeline.py YOUR_CONFIG_FILE --train True --evaluate True

To run a config with $n$ seeds starting from 0, run the following command:

./scripts/run_pipeline_with_n_seeds.sh YOUR_CONFIG_FILE NUMBER_OF_SEEDS

To execute all BatLiNet experiments across all datasets using 8 seeds, please utilize the command provided below:

./scripts/run_batlinet.sh

To run all experiments sequentially (for a comprehensive reproduction of our experiments including comparisons with other models), use the following command:

./scripts/run_all_configs.sh

Figures and Tables

For a more comprehensive understanding of our work, we have provided Jupyter notebooks that are instrumental in creating nearly all of the tables and figures presented in our research paper.

These notebooks are conveniently located in the notebooks directory of our repository. We encourage you to explore these resources to gain deeper insights into our methodologies and results.

Citation

If you find our code or algorithm useful in your research, please cite:

@article{zhang2023accurate,
  title={Accurate battery lifetime prediction across diverse aging conditions with deep learning},
  author={Zhang, Han and Li, Yuqi and Zheng, Shun and Lu, Ziheng and Gui, Xiaofan and Xu, Wei and Bian, Jiang},
  journal={arXiv e-prints},
  pages={arXiv--2310},
  year={2023}
}

batlinet's People

Contributors

fingertap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.