Skip to main content

Structure motif-centric learning framework for inorganic crystalline systems.

Project description


Code base for AMDNet described in


Incorporation of physical principles in a machine learning (ML) architecture is a fundamental step toward the continued development of artificial intelligence for inorganic materials. As inspired by the Pauling's rule, we propose that structure motifs in inorganic crystals can serve as a central input to a machine learning framework. We demonstrated that the presence of structure motifs and their connections in a large set of crystalline compounds can be converted into unique vector representations using an unsupervised learning algorithm. To demonstrate the use of structure motif information, a motif-centric learning framework is created by combining motif information with the atom-based graph neural networks to form an atom-motif dual graph network (AMDNet), which is more accurate in predicting the electronic structures of metal oxides such as bandgaps. The work illustrates the route toward fundamental design of graph neural network learning architecture for complex materials by incorporating beyond-atom physical principles.


AMDNet architecture and materials property predictions. (A) Demonstration of the learning architecture of the proposed atom-motif dual graph network (AMDNet) for the effective learning of electronic structures and other material properties of inorganic crystalline materials. (B) Comparison of predicted and actual bandgaps [from density functional theory (DFT) calculations] and (C) comparison of predicted and actual formation energies (from DFT calculations) in the test dataset with 4515 compounds.

The code is partially base from the paper "Graph Networks as a Universal Machine Learning Framework for Molecules and Crystals" by Chen et al.


To get started, make sure you are using the same tensorflow and keras versions described in requirements.txt. Furthermore, you should manually download the data files because of the large file sizes.

To train AMDNet from scratch, run python --material_file data/material_data.pkl --motif_file data/motif_graph.pkl --save_name save/new_model.hdf5

To test the pretrained network, run python --material_file data/material_data.pkl --motif_file data/motif_graph.pkl --load_name save/new_model.hdf5

Other parameters:
--material_file: dataset with material information
--motif_file: motif information for each material
--save_name: where to save the model
--predict: attribute to predict (band_gap or formation_energy_per_atom)
--epochs: maximum numbers of epochs
--patience: stop training if no improvement for number of epochs
--learning_rate: learning rate in training
--batch_size: batch size during training
--atom_cutoff: cutoff for atom distance that are considered connected in the graph
--motif_cutoff: cutoff for motif distance that are considered connected in the graph
--rbf_edge_dim_atom: dimension of RBF (radial basis function) for atoms
--rbf_edge_dim_motif: dimension of RBF (radial basis function) for motifs

Due to version changes and limited compatibility to older versions of tensorflow and keras, we can not provide the models used to recreate the results in the publication. However, the provided AMD model performs better than the one used in the publication with the same train/validation/test split. We observe an MAE on the test set of 0.41 (an improvement over the published 0.44).

In some cases, the training does not converge and stops after NaN. In this case, the learning rate is reduced and training proceeds from the best solution (this is the same as in the original source code from MEGNet). In cases where this stops the training early (after less than 200 epochs), we recommend reducing the learning rate and retrying from scratch.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amdnet-1.0.10.tar.gz (68.0 MB view hashes)

Uploaded Source

Built Distribution

amdnet-1.0.10-py3-none-any.whl (51.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page