summaryrefslogtreecommitdiff
path: root/src/python/doc
diff options
context:
space:
mode:
authorMathieuCarriere <mathieu.carriere3@gmail.com>2021-11-05 00:35:51 +0100
committerMathieuCarriere <mathieu.carriere3@gmail.com>2021-11-05 00:35:51 +0100
commit734622d5a8816cfdaaed2aaa4b9b3212fb6a259c (patch)
tree1b3d1b10b0f28bdb654f1f53fe51d9d96c485af3 /src/python/doc
parent1597a5b4fc1aec9f825e430e80b2a843a9037043 (diff)
update doc and pieces of code
Diffstat (limited to 'src/python/doc')
-rw-r--r--src/python/doc/cubical_complex_tflow_itf_ref.rst4
-rw-r--r--src/python/doc/ls_simplex_tree_tflow_itf_ref.rst4
-rw-r--r--src/python/doc/rips_complex_tflow_itf_ref.rst4
3 files changed, 3 insertions, 9 deletions
diff --git a/src/python/doc/cubical_complex_tflow_itf_ref.rst b/src/python/doc/cubical_complex_tflow_itf_ref.rst
index a907dfce..582e0551 100644
--- a/src/python/doc/cubical_complex_tflow_itf_ref.rst
+++ b/src/python/doc/cubical_complex_tflow_itf_ref.rst
@@ -13,11 +13,9 @@ Example of gradient computed from cubical persistence
.. testcode::
from gudhi.tensorflow import *
- import numpy as np
import tensorflow as tf
- Xinit = np.array([[0.,2.,2.],[2.,2.,2.],[2.,2.,1.]], dtype=np.float32)
- X = tf.Variable(initial_value=Xinit, trainable=True)
+ X = tf.Variable([[0.,2.,2.],[2.,2.,2.],[2.,2.,1.]], dtype=tf.float32, trainable=True)
cl = CubicalLayer(dimension=0)
with tf.GradientTape() as tape:
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 26cf1ff2..6c8b5a08 100644
--- a/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst
+++ b/src/python/doc/ls_simplex_tree_tflow_itf_ref.rst
@@ -13,7 +13,6 @@ Example of gradient computed from lower-star filtration of a simplex tree
.. testcode::
from gudhi.tensorflow import *
- import numpy as np
import tensorflow as tf
import gudhi as gd
@@ -40,8 +39,7 @@ Example of gradient computed from lower-star filtration of a simplex tree
st.insert([8, 9])
st.insert([9, 10])
- Finit = np.array([6.,4.,3.,4.,5.,4.,3.,2.,3.,4.,5.], dtype=np.float32)
- F = tf.Variable(initial_value=Finit, trainable=True)
+ F = tf.Variable([6.,4.,3.,4.,5.,4.,3.,2.,3.,4.,5.], dtype=tf.float32, trainable=True)
sl = LowerStarSimplexTreeLayer(simplextree=st, dimension=0)
with tf.GradientTape() as tape:
diff --git a/src/python/doc/rips_complex_tflow_itf_ref.rst b/src/python/doc/rips_complex_tflow_itf_ref.rst
index 7300eba0..bd9c5da5 100644
--- a/src/python/doc/rips_complex_tflow_itf_ref.rst
+++ b/src/python/doc/rips_complex_tflow_itf_ref.rst
@@ -13,11 +13,9 @@ Example of gradient computed from Vietoris-Rips persistence
.. testcode::
from gudhi.tensorflow import *
- import numpy as np
import tensorflow as tf
- Xinit = np.array([[1.,1.],[2.,2.]], dtype=np.float32)
- X = tf.Variable(initial_value=Xinit, trainable=True)
+ X = tf.Variable([[1.,1.],[2.,2.]], dtype=tf.float32, trainable=True)
rl = RipsLayer(maximum_edge_length=2., dimension=0)
with tf.GradientTape() as tape: