diff options
author | MathieuCarriere <mathieu.carriere3@gmail.com> | 2021-10-19 14:37:39 +0200 |
---|---|---|
committer | MathieuCarriere <mathieu.carriere3@gmail.com> | 2021-10-19 14:37:39 +0200 |
commit | 423c4be21968fd42c5470a9132d0e332c73ec2b9 (patch) | |
tree | b9d0f0f033f4b62d7f59410737f051a75676186a /src/python/doc | |
parent | fc1c33d19c7d50d01bacb61529badbde8217ce7e (diff) |
fix python documentation
Diffstat (limited to 'src/python/doc')
-rw-r--r-- | src/python/doc/cubical_complex_tflow_itf_ref.rst | 2 | ||||
-rw-r--r-- | src/python/doc/differentiation_sum.inc | 5 | ||||
-rw-r--r-- | src/python/doc/ls_simplex_tree_tflow_itf_ref.rst | 2 | ||||
-rw-r--r-- | src/python/doc/rips_complex_tflow_itf_ref.rst | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/src/python/doc/cubical_complex_tflow_itf_ref.rst b/src/python/doc/cubical_complex_tflow_itf_ref.rst index 8991b638..e85cfdc6 100644 --- a/src/python/doc/cubical_complex_tflow_itf_ref.rst +++ b/src/python/doc/cubical_complex_tflow_itf_ref.rst @@ -11,6 +11,7 @@ Example of gradient computed from cubical persistence ----------------------------------------------------- .. code-block:: python + from gudhi.tensorflow import * import numpy as np import tensorflow as tf @@ -23,6 +24,7 @@ Example of gradient computed from cubical persistence dgm = cl.call(X) loss = tf.math.reduce_sum(tf.square(.5*(dgm[:,1]-dgm[:,0]))) grads = tape.gradient(loss, [X]) + print(grads[0].numpy()) Documentation for CubicalLayer ------------------------------ diff --git a/src/python/doc/differentiation_sum.inc b/src/python/doc/differentiation_sum.inc index 7340d24d..3dd8e59c 100644 --- a/src/python/doc/differentiation_sum.inc +++ b/src/python/doc/differentiation_sum.inc @@ -1,4 +1,4 @@ -. list-table:: +.. list-table:: :widths: 40 30 30 :header-rows: 0 @@ -7,4 +7,5 @@ - :Requires: `TensorFlow <installation.html#tensorflow>`_ We provide TensorFlow 2 models that can handle automatic differentiation for the computation of persistence diagrams from complexes available in the Gudhi library. -This includes simplex trees, cubical complexes and Vietoris-Rips complexes. +This includes simplex trees, cubical complexes and Vietoris-Rips complexes. Detailed example on how to use these layers in practice are available +in the following `notebook <https://github.com/GUDHI/TDA-tutorial/blob/master/Tuto-GUDHI-optimization.ipynb>`_. diff --git a/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst b/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst index bb9c61c6..7baf611c 100644 --- a/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst +++ b/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst @@ -11,6 +11,7 @@ Example of gradient computed from lower-star filtration of a simplex tree ------------------------------------------------------------------------- .. code-block:: python + from gudhi.tensorflow import * import numpy as np import tensorflow as tf @@ -47,6 +48,7 @@ Example of gradient computed from lower-star filtration of a simplex tree dgm = sl.call(F) loss = tf.math.reduce_sum(tf.square(.5*(dgm[:,1]-dgm[:,0]))) grads = tape.gradient(loss, [F]) + print(grads[0].numpy()) Documentation for LowerStarSimplexTreeLayer ------------------------------------------- diff --git a/src/python/doc/rips_complex_tflow_itf_ref.rst b/src/python/doc/rips_complex_tflow_itf_ref.rst index db8c64ff..15ba4c8e 100644 --- a/src/python/doc/rips_complex_tflow_itf_ref.rst +++ b/src/python/doc/rips_complex_tflow_itf_ref.rst @@ -11,6 +11,7 @@ Example of gradient computed from Vietoris-Rips persistence ----------------------------------------------------------- .. code-block:: python + from gudhi.tensorflow import * import numpy as np import tensorflow as tf @@ -23,6 +24,7 @@ Example of gradient computed from Vietoris-Rips persistence dgm = rl.call(X) loss = tf.math.reduce_sum(tf.square(.5*(dgm[:,1]-dgm[:,0]))) grads = tape.gradient(loss, [X]) + print(grads[0].numpy()) Documentation for RipsLayer --------------------------- |