From f85e607e0a0076985e756a2e61a3b68c3f023001 Mon Sep 17 00:00:00 2001 From: PatReis Date: Tue, 24 Oct 2023 18:13:30 +0200 Subject: [PATCH] refactoring for keras 3.0 --- docs/source/index.rst | 6 +++++- docs/source/installation.rst | 14 ++++---------- docs/source/intro.rst | 11 ++++++++--- kgcnn/layers/mlp.py | 4 ++-- kgcnn/layers/norm.py | 2 +- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index d31700aa..41749b76 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,7 +6,11 @@ General Information =================================== -A set of layers for graph convolutions in TensorFlow Keras that use RaggedTensors. +The package in `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 `__ . +See `Reference` under `Package Content` for code documentation. .. toctree:: :maxdepth: 3 diff --git a/docs/source/installation.rst b/docs/source/installation.rst index d0bbcdc5..606498b5 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -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 `_ :: pip install kgcnn -Standard python package requirements are placed in the ``setup.py`` and are installed automatically (`kgcnn `_ >=2.2). -Packages which must be installed manually for full functionality are listed below. -For example to convert molecular file formats `OpenBabel `_ can complement `RDkit `_ which is installed via ``pip``. - -* `OpenBabel `_ >=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 `_ and `CUDA `_ and `cuDNN `_ versions must match. A list of verified version combinations can be found here: https://www.tensorflow.org/install/source#gpu . \ No newline at end of file diff --git a/docs/source/intro.rst b/docs/source/intro.rst index c32c0800..28b47cd4 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -5,7 +5,12 @@ Introduction ============ -The package in `kgcnn `_ contains several layer classes to build up graph convolution models. +The package in `kgcnn `__ contains several layer classes to build up graph convolution models. Some models are given as an example. -A documentation is generated in `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 `__ , `TensorFlow `__ and `Jax `__ . + +All models and layers of kgcnn + + diff --git a/kgcnn/layers/mlp.py b/kgcnn/layers/mlp.py index 11b9c055..c7e2120c 100644 --- a/kgcnn/layers/mlp.py +++ b/kgcnn/layers/mlp.py @@ -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, []) diff --git a/kgcnn/layers/norm.py b/kgcnn/layers/norm.py index 9d8a1006..3a1ac218 100644 --- a/kgcnn/layers/norm.py +++ b/kgcnn/layers/norm.py @@ -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.