Giter Site home page Giter Site logo

adosar / retnet Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 4.63 MB

A 3D ConvNet for Reticular Chemistry.

Home Page: https://www.nature.com/articles/s41598-023-50309-8

Python 100.00%
3d-cnn chemistry convolutional-neural-networks deep-learning machine-learning materials-science metal-organic-frameworks porous-materials

retnet's Introduction

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 ↩

retnet's People

Contributors

adosar avatar

Watchers

 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.