From 734622d5a8816cfdaaed2aaa4b9b3212fb6a259c Mon Sep 17 00:00:00 2001 From: MathieuCarriere Date: Fri, 5 Nov 2021 00:35:51 +0100 Subject: update doc and pieces of code --- src/python/doc/cubical_complex_tflow_itf_ref.rst | 4 +--- src/python/doc/ls_simplex_tree_tflow_itf_ref.rst | 4 +--- src/python/doc/rips_complex_tflow_itf_ref.rst | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/python/doc') 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: -- cgit v1.2.3