def testBijectorLogDetJacobianEventDimsOne(self): with self.test_session(): bijector = Softplus(event_ndims=1) y = 2 * rng.rand(2, 10) ildj_before = self._softplus_ildj_before_reduction(y) ildj = np.sum(ildj_before, axis=1) self.assertAllClose(ildj, bijector.inverse_log_det_jacobian(y).eval())
def testBijectorLogDetJacobianEventDimsZero(self): with self.test_session(): bijector = Softplus(event_ndims=0) y = 2 * rng.rand(2, 10) # No reduction needed if event_dims = 0. ildj = self._softplus_ildj_before_reduction(y) self.assertAllClose(ildj, bijector.inverse_log_det_jacobian(y).eval())
def testBijectorLogDetJacobianEventDimsOne(self): with self.test_session(): bijector = Softplus(event_ndims=1) y = 2 * rng.rand(2, 10) ildj_before = self._softplus_ildj_before_reduction(y) ildj = np.sum(ildj_before, axis=1) self.assertAllClose(ildj, bijector.inverse_log_det_jacobian(y).eval())
def testBijectorLogDetJacobianEventDimsZero(self): with self.test_session(): bijector = Softplus(event_ndims=0) y = 2 * rng.rand(2, 10) # No reduction needed if event_dims = 0. ildj = self._softplus_ildj_before_reduction(y) self.assertAllClose(ildj, bijector.inverse_log_det_jacobian(y).eval())