Skip to main content

Graph Neural Networks for Molecular Machine Learning

Project description

molcraft-logo

Deep Learning on Molecules: A Minimalistic GNN package for Molecular ML.

[!NOTE]
In progress.

Installation

For CPU users:

pip install molcraft

For GPU users:

pip install molcraft[gpu]

Examples

from molcraft import features
from molcraft import descriptors
from molcraft import featurizers 
from molcraft import layers
from molcraft import models 
import keras

featurizer = featurizers.MolGraphFeaturizer(
    atom_features=[
        features.AtomType(),
        features.NumHydrogens(),
        features.Degree(),
    ],
    bond_features=[
        features.BondType(),
        features.IsRotatable(),
    ],
    super_node=True,
    self_loops=True,
    include_hydrogens=False,
)

graph = featurizer([('N[C@@H](C)C(=O)O', 2.5), ('N[C@@H](CS)C(=O)O', 1.5)])
print(graph)

model = models.GraphModel.from_layers(
    [
        layers.Input(graph.spec),
        layers.NodeEmbedding(dim=128),
        layers.EdgeEmbedding(dim=128),
        layers.GraphConv(units=128),
        layers.GraphConv(units=128),
        layers.GraphConv(units=128),
        layers.GraphConv(units=128),
        layers.Readout(),
        keras.layers.Dense(units=1024, activation='elu'),
        keras.layers.Dense(units=1024, activation='elu'),
        keras.layers.Dense(1)
    ]
)

pred = model(graph)
print(pred)

# featurizers.save_featurizer(featurizer, '/tmp/featurizer.json')
# models.save_model(model, '/tmp/model.keras')

# loaded_featurizer = featurizers.load_featurizer('/tmp/featurizer.json')
# loaded_model = models.load_model('/tmp/model.keras')

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

molcraft-0.1.0rc5.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molcraft-0.1.0rc5-py3-none-any.whl (47.2 kB view details)

Uploaded Python 3

File details

Details for the file molcraft-0.1.0rc5.tar.gz.

File metadata

  • Download URL: molcraft-0.1.0rc5.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for molcraft-0.1.0rc5.tar.gz
Algorithm Hash digest
SHA256 0695cae0f502aa8c29b4d2e593b73b93cb0dfe6356abcde91a8e42229f148e67
MD5 adbc1fd7ecc7645aa4b3039165724f48
BLAKE2b-256 591e066e1b65727197d63ef0584e43d03b2ab217b49e6be5c8216db5736d5bbc

See more details on using hashes here.

File details

Details for the file molcraft-0.1.0rc5-py3-none-any.whl.

File metadata

  • Download URL: molcraft-0.1.0rc5-py3-none-any.whl
  • Upload date:
  • Size: 47.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for molcraft-0.1.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 1c6c4ec5ec6e9531eeb61934363d885f35a652c1cb468c638281f2134cbece9e
MD5 e16e9ca7133fd277996b8a84a0cbc01e
BLAKE2b-256 922d9c9a87ecc477f11e69eda6c21534b4b755ba79ccc40391cba1fa4b343611

See more details on using hashes here.

Supported by

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