Skip to content

adosar/retnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RetNet Architecture

Requires Python 3.11+ Requires PyTorch 2.1.0+|2.0.1+cu118 Static Badge Static Badge

💎 RetNet

A 3D ConvNet that takes energy voxels as input and ouputs gas adsorption properties.

This repository contains a PyTorch implementation of RetNet, which can be found on model.py module.

🚀 Training RetNet

The following example is used to train RetNet on the University of Ottawa database1 for predicting CO2 uptake.

Important

It is strongly recommended to run all the scripts inside a virtual environment.

Clone the repository

git clone https://github.com/frudakis-research-group/retnet
cd retnet

Dependencies

  1. Create a virtual environment:
    python -m venv <venvir_name>
  2. Activate it:
    source <venvir_name>/bin/activate
  3. Install the dependencies:
    (<venvir_name>) pip install -r requirements.txt

Collect the data

The following directory structure is required prior to training:

data/
├── MOFs
   ├── all_MOFs_screening_data.csv
   ├── batch_train
   │   ├── clean_names.json
   │   └── clean_voxels.npy
   └── batch_val_test
       ├── clean_names.json
       └── clean_voxels.npy

To achieve that:

  1. Get the inputs:
    wget -O- 'https://figshare.com/ndownloader/files/43220463' | tar -xzvf-

Warning

If you use any of this data in your research work, you should cite the original work2.

  1. Get the labels:
    wget -O- 'https://archive.materialscloud.org/record/file?filename=screening_data.tar.gz&record_id=62' | tar -xzvf- -C data/MOFs

Warning

If you use any of this data in your research work, you should cite the original work1.

Train the model

Check the comments in training.py to customize the training phase on your needs.

(<venvir_name>) python training.py
  • GPU training time: 40s per epoch on Nvidia GTX 1650 Super
  • CPU training time: 257s per epoch on Intel i5 8400

Tip

If you want to use a GPU but the VRAM is not enough:

  1. Decrease the training batch size to a value smaller than 64.
  2. Remove some Conv layers or decrease the number of Conv filters.

📰 Citing

If you use the RetNet architecture in your research work or any of the scripts of this repository, please consider citing:

@article{Sarikas2024,
  title = {Gas adsorption meets deep learning: voxelizing the potential energy surface of metal-organic frameworks},
  volume = {14},
  ISSN = {2045-2322},
  url = {http://dx.doi.org/10.1038/s41598-023-50309-8},
  DOI = {10.1038/s41598-023-50309-8},
  number = {1},
  journal = {Scientific Reports},
  publisher = {Springer Science and Business Media LLC},
  author = {Sarikas,  Antonios P. and Gkagkas,  Konstantinos and Froudakis,  George E.},
  year = {2024},
  month = jan 
}

Footnotes

  1. Boyd, P.G., Chidambaram, A., García-Díez, E. et al. Data-driven design of metal–organic frameworks for wet flue gas CO2 capture. Nature 576, 253–256 (2019). https://doi.org/10.1038/s41586-019-1798-7 2

  2. Sarikas, A.P., Gkagkas, K. & Froudakis, G.E. Gas adsorption meets deep learning: voxelizing the potential energy surface of metal-organic frameworks. Sci Rep 14, 2242 (2024). https://doi.org/10.1038/s41598-023-50309-8