Skip to main content
pGNN-logo

pGNN

Overview

pGNN is a featurizer tool that leverages pretrained graph-neural networks (GNNs) to extract valuable information from materials structures. It aims to enhance the performance of materials property prediction models by generating highly meaningful features that can be used in a variety of machine learning tasks.

Available Featurizers

pGNN offers multiple types of feature extraction tools to provide flexibility for various use cases:

  • MVLFeaturizer: The MVLFeaturizer provides features extracted from various pretrained MEGNet models. These models have been trained on diverse datasets and offer reliable features for a wide range of properties. Users can choose between different intermediate layers to extract features from the regression head of the MEGNet models with either a 16-neuron or 32-neuron configuration.

  • CustomMEGNetFeaturizer: The CustomMEGNetFeaturizer allows users to load custom models from the custom_models/ directory. These models can incorporate encoded chemical information derived from extensive featurizers such as MatMiner (l-MM, MatMinerEncoded\_v1 model) and Orbital Field Matrix (l-OFM, OFMEncoded\_v1 model), providing tailored feature extraction for diverse use cases.

  • AdjacentMEGNetFeaturizer: The AdjacentMEGNetFeaturizer is designed to train a MEGNet model on the fly for the user's dataset. This is particularly useful for ensuring that the features extracted are closely aligned with the dataset at hand, thus reducing potential bias and improving model accuracy. Similar to the other featurizers, users can choose to extract features from either the 16-neuron or 32-neuron layer.

Installation

To install pGNN, clone the repository and use the following command:

pip install -r requirements.txt

Ensure you have all the necessary dependencies installed, including TensorFlow, scikit-learn, and the necessary MEGNet libraries.

Usage

Basic Example

Here's an example of how to use pGNN to extract features from a list of structures:

from pgnn import MVLFeaturizer, AdjacentMEGNetFeaturizer
from pgnn import get_Custom_MEGNetFeatures

# Initialize featurizers
mvl32 = MVLFeaturizer(layer_name='layer32')
mvl16 = MVLFeaturizer(layer_name='layer16')
adj_megnet = AdjacentMEGNetFeaturizer(layer_name='layer32')

# Example structures
structures = pd.DataFrame({'structure': [...]})  # Replace '...' with your actual list of structures

# Extract features using MVLFeaturizer
features_32 = mvl32.get_features(structures)
features_16 = mvl16.get_features(structures)

# Train the AdjacentMEGNetFeaturizer on the fly
# Provide in 'targets' some property values corresponding to these structures
adj_megnet.train_adjacent_megnet(structures, targets=[...])

# Extract features using the trained AdjacentMEGNetFeaturizer
features_adj = adj_megnet.get_features(structures)

# Load features using custom model
features = get_Custom_MEGNetFeatures(structures, model_type='OFMEncoded_v1')

Contributions

We welcome contributions to improve the pGNN tool, including adding more pretrained models or enhancing the featurization techniques. Please feel free to submit pull requests or create issues for discussion.

License

This project is licensed under the MIT License.

Acknowledgments

The pGNN tool is built on top of the MEGNet framework, leveraging its pretrained models to provide state-of-the-art features for materials science research. We thank the Materials Virtual Lab for making the pretrained models publicly available.

Metadata

Release files for pgnn 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgnn 0.1.0
File Size Uploaded
pgnn-0.1.0.tar.gz 5.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgnn 0.1.0
File Interpreter ABI Platform
pgnn-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 MB

Release files / pgnn-0.1.0.tar.gz

Download URL pgnn-0.1.0.tar.gz
Size 5.0 MB
Tags Source
SHA-256 checksum
How to use checksums
2d070dbb42f116cf66661c6ee62515fbe642294ff1cd8127c32c5a122a1881be
BLAKE2b-256 checksum
How to use checksums
e289f0b0239f6cb7cba32bd2c0f8fdede46216474456fd6ea11fdc2aa6c976b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.16

Release files / pgnn-0.1.0-py3-none-any.whl

Download URL pgnn-0.1.0-py3-none-any.whl
Size 5.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
69bf46b65c6368f474c0a009951fa2eabec26439ada981a5ecc89a661fe278c5
BLAKE2b-256 checksum
How to use checksums
4169293c5d08c62c7465326067c0d95bc644facc3a89a5d45896f640e049d1f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page