From 6e5b348cb02acd16f990df629a9d938ecb3a318f Mon Sep 17 00:00:00 2001 From: MathieuCarriere Date: Mon, 23 May 2022 10:23:25 +0200 Subject: updated output for cubical complexes --- src/python/test/test_diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/python/test/test_diff.py') diff --git a/src/python/test/test_diff.py b/src/python/test/test_diff.py index 2529cf22..e0a4717c 100644 --- a/src/python/test/test_diff.py +++ b/src/python/test/test_diff.py @@ -22,7 +22,7 @@ def test_cubical_diff(): cl = CubicalLayer(dimensions=[0]) with tf.GradientTape() as tape: - dgm = cl.call(X)[0] + dgm = cl.call(X)[0][0] loss = tf.math.reduce_sum(tf.square(.5*(dgm[:,1]-dgm[:,0]))) grads = tape.gradient(loss, [X]) assert tf.norm(grads[0]-tf.constant([[0.,0.,0.],[0.,.5,0.],[0.,0.,-.5]]),1) <= 1e-6 @@ -34,7 +34,7 @@ def test_nonsquare_cubical_diff(): cl = CubicalLayer(dimensions=[0]) with tf.GradientTape() as tape: - dgm = cl.call(X)[0] + dgm = cl.call(X)[0][0] loss = tf.math.reduce_sum(tf.square(.5*(dgm[:,1]-dgm[:,0]))) grads = tape.gradient(loss, [X]) assert tf.norm(grads[0]-tf.constant([[0.,0.5,-0.5],[0.,0.,0.]]),1) <= 1e-6 -- cgit v1.2.3