Graph Neural Networks for Molecular Machine Learning
Project description
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
Release history Release notifications | RSS feed
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.0rc11.tar.gz
(49.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molcraft-0.1.0rc11.tar.gz.
File metadata
- Download URL: molcraft-0.1.0rc11.tar.gz
- Upload date:
- Size: 49.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8edd98836276349035cc367d519c8b0cb258ee68d5740d49c417858ed53d5685
|
|
| MD5 |
b0ff34408688a37d82f21fb098d71039
|
|
| BLAKE2b-256 |
ec4488f80eb9b0c90eb9dfecfd664be79591fd33de5512a9c68f0b1a676d72e9
|
File details
Details for the file molcraft-0.1.0rc11-py3-none-any.whl.
File metadata
- Download URL: molcraft-0.1.0rc11-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dee68d790dba3902bca63bfcf7f4654a2278374237d2b7e929329a1d93d10df7
|
|
| MD5 |
b3ca1ff6692cb01ae466094596c7312a
|
|
| BLAKE2b-256 |
dce4040b911a8612bce4cd30bd007bcab10178e3b330c7f0469dc3584ea4be04
|