def test_sample_z(self):
        np.random.seed(42)
        df0 = np.random.normal(size=(10,3))

        sub = ss.Subspaces()
        sub.compute(df=df0)
        W1, W2 = sub.W1, sub.W2
        m, n = W1.shape

        np.random.seed(43)
        x = np.random.uniform(-1.0,1.0,size=(1,m))
        y = np.dot(x, W1).reshape((n, ))
        N = 10
        np.random.seed(42)
        Z = dom.sample_z(N, y, W1, W2)
    def test_sample_z(self):
        np.random.seed(42)
        df0 = np.random.normal(size=(10, 3))

        sub = ss.Subspaces()
        sub.compute(df=df0)
        W1, W2 = sub.W1, sub.W2
        m, n = W1.shape

        np.random.seed(43)
        x = np.random.uniform(-1.0, 1.0, size=(1, m))
        y = np.dot(x, W1).reshape((n, ))
        N = 10
        np.random.seed(42)
        Z = dom.sample_z(N, y, W1, W2)
    def test_sample_z(self):
        data = helper.load_test_npz('test_spec_decomp_1.npz')
        df0, e0, W0 = data['df'], data['e'], data['W']

        sub = ss.Subspaces()
        sub.compute(df0)
        W1, W2 = sub.W1, sub.W2
        m, n = W1.shape

        np.random.seed(43)
        x = np.random.uniform(-1.0,1.0,size=(1,m))
        y = np.dot(x, W1).reshape((n, ))
        N = 10
        np.random.seed(42)
        Z = dom.sample_z(N, y, W1, W2)

        data_test = helper.load_test_npz('test_sampling_z_0_0.npz')
        np.testing.assert_almost_equal(Z, data_test['Z'])
 def test_sample_z(self):
     data = helper.load_test_npz('test_spec_decomp_1.npz')
     df0, e0, W0 = data['df'], data['e'], data['W']
     
     sub = ss.Subspaces()
     sub.compute(df0)
     W1, W2 = sub.W1, sub.W2
     m, n = W1.shape
     
     np.random.seed(43)
     x = np.random.uniform(-1.0,1.0,size=(1,m))
     y = np.dot(x, W1).reshape((n, ))
     N = 10
     np.random.seed(42)
     Z = dom.sample_z(N, y, W1, W2)
         
     #np.savez('data/test_sampling_z_0_3',Z=Z)
     # probably don't need to save this file. should wrap rejection_sampling_z
     data_test = helper.load_test_npz('test_sampling_z_0_0.npz')
     np.testing.assert_equal(Z, data_test['Z'])