molgraph


Namemolgraph JSON
Version 0.7.11 PyPI version JSON
download
home_pagehttps://github.com/akensert/molgraph
SummaryGraph Neural Networks for Molecular Machine Learning
upload_time2024-11-29 17:13:27
maintainerNone
docs_urlNone
authorAlexander Kensert
requires_python==3.10.*
licenseMIT
keywords machine-learning deep-learning graph-neural-networks molecular-machine-learning graphs molecular-graphs chemistry biology chemometrics cheminformatics bioinformatics computational-chemistry computational-biology
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/akensert/molgraph/blob/main/docs/source/_static/molgraph-logo-pixel.png" alt="molgraph-title" width="90%">

**Graph Neural Networks** with **TensorFlow** and **Keras**. Focused on **Molecular Machine Learning**.

## Quick start
Benchmark the performance of MolGraph [here](https://github.com/akensert/molgraph/blob/main/examples/GNN-Benchmarking.ipynb), and implement a complete model pipeline with MolGraph [here](https://github.com/akensert/molgraph/blob/main/examples/QSAR-GNN-Tutorial.ipynb). 


## Highlights
Build a Graph Neural Network with Keras' [Sequential](https://www.tensorflow.org/api_docs/python/tf/keras/Sequential) API:

```python
from molgraph import GraphTensor
from molgraph import layers
from tensorflow import keras

g = GraphTensor(node_feature=[[4.], [2.]], edge_src=[0], edge_dst=[1])

model = keras.Sequential([
    layers.GNNInput(type_spec=g.spec),
    layers.GATv2Conv(units=32),
    layers.GATv2Conv(units=32),
    layers.Readout(),
    keras.layers.Dense(units=1),
])

pred = model(g)

# Save and load Keras model
model.save('/tmp/gatv2_model.keras')
loaded_model = keras.models.load_model('/tmp/gatv2_model.keras')
loaded_pred = loaded_model(g)
assert pred == loaded_pred
```

Combine outputs of GNN layers to improve predictive performance:

```python
model = keras.Sequential([
    layers.GNNInput(type_spec=g.spec),
    layers.GNN([
        layers.FeatureProjection(units=32),
        layers.GINConv(units=32),
        layers.GINConv(units=32),
        layers.GINConv(units=32),
    ]),
    layers.Readout(),
    keras.layers.Dense(units=128),
    keras.layers.Dense(units=1),
])

model.summary()
```

## Installation
For **CPU** users:
<pre>
pip install molgraph
</pre>
For **GPU** users:
<pre>
pip install molgraph[gpu]
</pre>

## Implementations
- **Tensors**
    - [Graph tensor](http://github.com/akensert/molgraph/tree/main/molgraph/tensors/graph_tensor.py)
        - A composite tensor holding graph data; compatible with `tf.data.Dataset`, `keras.Sequential` and much more.
- **Layers**
    - [Graph convolutional layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/convolutional/)
    - [Graph attentional layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/attentional/)
    - [Graph message passing layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/message_passing/)
    - [Graph readout layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/readout/)
    - [Preprocessing layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/preprocessing/)
    - [Postprocessing layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/postprocessing/)
    - [Positional encoding layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/positional_encoding)
- **Models**
    - [Graph neural networks](https://github.com/akensert/molgraph/tree/main/molgraph/models/)
    - [Saliency mapping](https://github.com/akensert/molgraph/tree/main/molgraph/models/interpretability/)

## Overview 
<img src="https://github.com/akensert/molgraph/blob/main/docs/source/_static/molgraph-overview.png" alt="molgraph-overview" width="90%">

## Documentation
See [readthedocs](https://molgraph.readthedocs.io/en/latest/)

## Papers
- [MolGraph: a Python package for the implementation of molecular graphs and graph neural networks with TensorFlow and Keras](https://doi.org/10.48550/arXiv.2208.09944)
- [A hands-on tutorial on quantitative structure-activity relationships using fully expressive graph neural networks](https://doi.org/10.1016/j.aca.2024.343046)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/akensert/molgraph",
    "name": "molgraph",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "==3.10.*",
    "maintainer_email": null,
    "keywords": "machine-learning, deep-learning, graph-neural-networks, molecular-machine-learning, graphs, molecular-graphs, chemistry, biology, chemometrics, cheminformatics, bioinformatics, computational-chemistry, computational-biology",
    "author": "Alexander Kensert",
    "author_email": "alexander.kensert@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/60/31/a7cd329fbd0728eadc246d1de67fd0c73068f3f20fbd9979253d1f3d18dc/molgraph-0.7.11.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/akensert/molgraph/blob/main/docs/source/_static/molgraph-logo-pixel.png\" alt=\"molgraph-title\" width=\"90%\">\n\n**Graph Neural Networks** with **TensorFlow** and **Keras**. Focused on **Molecular Machine Learning**.\n\n## Quick start\nBenchmark the performance of MolGraph [here](https://github.com/akensert/molgraph/blob/main/examples/GNN-Benchmarking.ipynb), and implement a complete model pipeline with MolGraph [here](https://github.com/akensert/molgraph/blob/main/examples/QSAR-GNN-Tutorial.ipynb). \n\n\n## Highlights\nBuild a Graph Neural Network with Keras' [Sequential](https://www.tensorflow.org/api_docs/python/tf/keras/Sequential) API:\n\n```python\nfrom molgraph import GraphTensor\nfrom molgraph import layers\nfrom tensorflow import keras\n\ng = GraphTensor(node_feature=[[4.], [2.]], edge_src=[0], edge_dst=[1])\n\nmodel = keras.Sequential([\n    layers.GNNInput(type_spec=g.spec),\n    layers.GATv2Conv(units=32),\n    layers.GATv2Conv(units=32),\n    layers.Readout(),\n    keras.layers.Dense(units=1),\n])\n\npred = model(g)\n\n# Save and load Keras model\nmodel.save('/tmp/gatv2_model.keras')\nloaded_model = keras.models.load_model('/tmp/gatv2_model.keras')\nloaded_pred = loaded_model(g)\nassert pred == loaded_pred\n```\n\nCombine outputs of GNN layers to improve predictive performance:\n\n```python\nmodel = keras.Sequential([\n    layers.GNNInput(type_spec=g.spec),\n    layers.GNN([\n        layers.FeatureProjection(units=32),\n        layers.GINConv(units=32),\n        layers.GINConv(units=32),\n        layers.GINConv(units=32),\n    ]),\n    layers.Readout(),\n    keras.layers.Dense(units=128),\n    keras.layers.Dense(units=1),\n])\n\nmodel.summary()\n```\n\n## Installation\nFor **CPU** users:\n<pre>\npip install molgraph\n</pre>\nFor **GPU** users:\n<pre>\npip install molgraph[gpu]\n</pre>\n\n## Implementations\n- **Tensors**\n    - [Graph tensor](http://github.com/akensert/molgraph/tree/main/molgraph/tensors/graph_tensor.py)\n        - A composite tensor holding graph data; compatible with `tf.data.Dataset`, `keras.Sequential` and much more.\n- **Layers**\n    - [Graph convolutional layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/convolutional/)\n    - [Graph attentional layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/attentional/)\n    - [Graph message passing layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/message_passing/)\n    - [Graph readout layers](http://github.com/akensert/molgraph/tree/main/molgraph/layers/readout/)\n    - [Preprocessing layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/preprocessing/)\n    - [Postprocessing layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/postprocessing/)\n    - [Positional encoding layers](https://github.com/akensert/molgraph/tree/main/molgraph/layers/positional_encoding)\n- **Models**\n    - [Graph neural networks](https://github.com/akensert/molgraph/tree/main/molgraph/models/)\n    - [Saliency mapping](https://github.com/akensert/molgraph/tree/main/molgraph/models/interpretability/)\n\n## Overview \n<img src=\"https://github.com/akensert/molgraph/blob/main/docs/source/_static/molgraph-overview.png\" alt=\"molgraph-overview\" width=\"90%\">\n\n## Documentation\nSee [readthedocs](https://molgraph.readthedocs.io/en/latest/)\n\n## Papers\n- [MolGraph: a Python package for the implementation of molecular graphs and graph neural networks with TensorFlow and Keras](https://doi.org/10.48550/arXiv.2208.09944)\n- [A hands-on tutorial on quantitative structure-activity relationships using fully expressive graph neural networks](https://doi.org/10.1016/j.aca.2024.343046)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Graph Neural Networks for Molecular Machine Learning",
    "version": "0.7.11",
    "project_urls": {
        "Homepage": "https://github.com/akensert/molgraph"
    },
    "split_keywords": [
        "machine-learning",
        " deep-learning",
        " graph-neural-networks",
        " molecular-machine-learning",
        " graphs",
        " molecular-graphs",
        " chemistry",
        " biology",
        " chemometrics",
        " cheminformatics",
        " bioinformatics",
        " computational-chemistry",
        " computational-biology"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8180ae4993955502c8c2876747dbc2a9d22f810af93ae042cc02b890d71b9aad",
                "md5": "61cb028d57d59f871fa7d06a9fb508ea",
                "sha256": "605bc178623607f0299597d67b62f9c9cdb996ef142720c21faef88b19f138b9"
            },
            "downloads": -1,
            "filename": "molgraph-0.7.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61cb028d57d59f871fa7d06a9fb508ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "==3.10.*",
            "size": 211430,
            "upload_time": "2024-11-29T17:12:57",
            "upload_time_iso_8601": "2024-11-29T17:12:57.941872Z",
            "url": "https://files.pythonhosted.org/packages/81/80/ae4993955502c8c2876747dbc2a9d22f810af93ae042cc02b890d71b9aad/molgraph-0.7.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6031a7cd329fbd0728eadc246d1de67fd0c73068f3f20fbd9979253d1f3d18dc",
                "md5": "560f21f0232be8fc07a7b024e3243528",
                "sha256": "be664bc467ff7578043a88af6168a30978a7bc961d479e4ca928b808e65923d2"
            },
            "downloads": -1,
            "filename": "molgraph-0.7.11.tar.gz",
            "has_sig": false,
            "md5_digest": "560f21f0232be8fc07a7b024e3243528",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "==3.10.*",
            "size": 114699,
            "upload_time": "2024-11-29T17:13:27",
            "upload_time_iso_8601": "2024-11-29T17:13:27.735162Z",
            "url": "https://files.pythonhosted.org/packages/60/31/a7cd329fbd0728eadc246d1de67fd0c73068f3f20fbd9979253d1f3d18dc/molgraph-0.7.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-29 17:13:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "akensert",
    "github_project": "molgraph",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "molgraph"
}
        
Elapsed time: 0.39987s