Skip to content

Commit

Permalink
refactoring for keras 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PatReis committed Oct 24, 2023
1 parent d7e63a8 commit f85e607
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
6 changes: 5 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
General Information
===================================

A set of layers for graph convolutions in TensorFlow Keras that use RaggedTensors.
The package in `kgcnn <https://github.com/aimat-lab/gcnn_keras/tree/master/kgcnn>`__ contains several layer classes to build up graph convolution models in
Keras with Tensorflow, PyTorch or Jax as backend. Some models are given as an example in literature.
Focus of kgcnn is (batched) graph learning for molecules **kgcnn.molecule** and materials **kgcnn.crystal**.
Below you can find explanations and information on how to use `kgcnn <https://github.com/aimat-lab/gcnn_keras/tree/master/kgcnn>`__ .
See `Reference` under `Package Content` for code documentation.

.. toctree::
:maxdepth: 3
Expand Down
14 changes: 4 additions & 10 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
Installation
============

Clone repository https://github.com/aimat-lab/gcnn_keras and install with editable mode::

pip install -e ./gcnn_keras

Clone repository https://github.com/aimat-lab/gcnn_keras and install with editable mode
or latest release via `Python Package Index <https://pypi.org/>`_ ::

pip install kgcnn

Standard python package requirements are placed in the ``setup.py`` and are installed automatically (`kgcnn <https://github.com/aimat-lab/gcnn_keras>`_ >=2.2).
Packages which must be installed manually for full functionality are listed below.
For example to convert molecular file formats `OpenBabel <http://openbabel.org/wiki/Main_Page>`_ can complement `RDkit <https://www.rdkit.org/docs/api-docs.html>`_ which is installed via ``pip``.

* `OpenBabel <http://openbabel.org/wiki/Main_Page>`_ >=3.0.1

To have proper GPU support, make sure that the installed ``tensorflow`` version matches your system requirements.
Standard python package requirements are placed in the ``setup.py`` and are installed automatically.
However, you must make sure to install the GPU/TPU acceleration for the backend of your choice.
For example, to have proper GPU support, make sure that the installed ``tensorflow`` version matches your system requirements.
Moreover, installed `GPU drivers <https://www.nvidia.com/download/index.aspx?lang=en-us>`_ and `CUDA <https://developer.nvidia.com/cuda-toolkit-archive>`_ and `cuDNN <https://developer.nvidia.com/cudnn>`_ versions must match.
A list of verified version combinations can be found here: https://www.tensorflow.org/install/source#gpu .
11 changes: 8 additions & 3 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ Introduction
============


The package in `kgcnn <https://github.com/aimat-lab/gcnn_keras/tree/master/kgcnn>`_ contains several layer classes to build up graph convolution models.
The package in `kgcnn <https://github.com/aimat-lab/gcnn_keras/tree/master/kgcnn>`__ contains several layer classes to build up graph convolution models.
Some models are given as an example.
A documentation is generated in `docs <https://github.com/aimat-lab/gcnn_keras/tree/master/docs>`_.
Any comments, suggestions or help are very welcome!

The version of **kgcnn>=4.0.0** are developed for **keras>=3.0** and should enable graph neural networks with multi-backend support.
The currently supported backends are `PyTorch <https://pytorch.org/>`__ , `TensorFlow <https://www.tensorflow.org/install>`__ and `Jax <https://jax.readthedocs.io/en/latest/installation.html>`__ .

All models and layers of kgcnn


4 changes: 2 additions & 2 deletions kgcnn/layers/mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ def call(self, inputs, **kwargs):
r"""Forward pass.
Args:
inputs (tf.Tensor): Input tensor with last dimension not `None` .
inputs (Tensor): Input tensor with last dimension not `None` .
Returns:
tf.Tensor: MLP forward pass.
Tensor: MLP forward pass.
"""
x, batch = (inputs[0], inputs[1:]) if isinstance(inputs, list) else (inputs, [])

Expand Down
2 changes: 1 addition & 1 deletion kgcnn/layers/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class GraphInstanceNormalization(GraphNormalization):
"""

def __init__(self, **kwargs):
r"""Initialize layer :obj:`GraphBatchNormalization`.
r"""Initialize layer :obj:`GraphBatchNormalization` .
Args:
epsilon: Small float added to variance to avoid dividing by zero. Defaults to 1e-3.
Expand Down

0 comments on commit f85e607

Please sign in to comment.