Git Product home page Git Product logo

tinnet's Introduction

Theory Infused Neural Network (TinNet)

The TinNet software package is adapted from Crystal Graph Convolutional Neural Networks (CGCNN) codes of Jeffrey C. Grossman and Zachary W. Ulissi.

The package provides three major functions:

  • Train a TinNet model with an user-defined physical model and dataset.
  • Predict material properties and parameters of user-defined physical model of new crystals with a pre-trained TinNet model.
  • Extract physical trends and phenomena from predicted parameters of user-defined physical model.

The following paper describes the details of the TinNet framework:

[Infusing Theory into Machine Learning for Interpretable Reactivity Prediction](URL TBD)

Table of Contents

  • [How to cite]
  • [Prerequisites]
  • [Usage]
    • [Load images and properties]
    • [Tune hyperparameters]
    • [Train a TinNet model]
    • [Predict material properties with a pre-trained TinNet model]
  • [Data]
  • [Authors]
  • [License]

How to cite

Please cite the following work if you want to use TinNet.

''' @article{} '''

Prerequisites

This package requires:

*Note: The package is built in the PyTorch v1.3.1 environment.

Usage

To use the TinNet package, you need to load images and properties in the Python script. There are three examples of TinNet models in the repository: 'Main/Tuning_Hyperparameters.py', 'Main/Training.py' and 'Main/Test.py'.

arguments:

(1) task = {'train', 'test'}

(2) data_format = {'regular', 'nested', 'test'}

(3) phys_model = {'gcnn', 'newns_anderson_semi', 'user-defined'}

Load images and properties

Images should be one of Atomic Simulation Environment (ASE) formats (e.g. traj, cif, xyz) (https://wiki.fysik.dtu.dk/ase/ase/io/io.html). Properties contain the major property (e.g. adsorption energy, formation energy) and extra information (e.g. orbital information)(optional).

Tune hyperparameters

Set the range of hyperparameters you want to tune.

In directory 'Main', you can tune hyperparameters by:

''' python Tuning_Hyperparameters.py '''

After tuning hyperparameters, you will get four files in 'Main' directory.

  • 'final_ans_test_mae_HYPERPARAMETERS.txt': stores mean absolute errors (MAE) of different test dataset with HYPERPARAMETERS.
  • 'final_ans_test_mse_HYPERPARAMETERS.txt': stores mean absolute errors (MSE) of different test dataset with HYPERPARAMETERS.
  • 'final_ans_val_mae_HYPERPARAMETERS.txt': stores mean absolute errors (MAE) of different validation dataset with HYPERPARAMETERS.
  • 'final_ans_val_mse_HYPERPARAMETERS.txt': stores mean absolute errors (MSE) of different validation dataset with HYPERPARAMETERS.

Train a TinNet model

Use optimized hyperparameters to train models.

In directory 'Main', you can train by:

''' python Training.py '''

After training, you will get one file in 'Main' directory.

  • 'model_best_train_idx_val_X_idx_test_Y.pth.tar': stores the TinNet model with the best validation accuracy. (X and Y represent the fold of the validation dataset and the test dataset, respectively.)

Predict material properties with a pre-trained TinNet model

Once you have a pre-trained TinNet model, you can use it to predict material properties of structures that you are interested

In directory 'Main', you can predict material properties of structures by:

''' python Test.py '''

After predicting, you will get six files in 'Main' directory:

  • 'test_results_idx_val_X_idx_test_Y.csv': stores the 'ID', target value, and predicted value for each image in test dataset.
  • 'train_results_idx_val_X_idx_test_Y.csv': stores the 'ID', target value, and predicted value for each image in train dataset.
  • 'validation_results_idx_val_X_idx_test_Y.csv': stores the 'ID', target value, and predicted value for each image in validation dataset.
  • 'parm_test_idx_val_X_idx_test_Y.txt': stores parameters of user-defined physical model for each image in test dataset.
  • 'parm_train_idx_val_X_idx_test_Y.txt': stores parameters of user-defined physical model for each image in train dataset.
  • 'parm_validation_idx_val_X_idx_test_Y.txt': stores parameters of user-defined physical model for each image in validation dataset.

Data

To reproduce our paper, you can download the corresponding datasets following the instruction. https://github.com/hlxin/tinnet/tree/master/data

Authors

This software was primarily written by [Shih-Han Wang] who was advised by [Prof. Luke E. K. Achenie] and [Prof. Hongliang Xin].

License

TinNet is released under the MIT License.

tinnet's People

Contributors

dogs1231992 avatar hlxin 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.