示例#1
0
    def Run(self, W, x, eps, seed):
        x = x.flatten()
        prng = np.random.RandomState(seed)
        M = selection.Total(x.shape).select()
        y = measurement.Laplace(M, eps).measure(x, prng)
        x_hat = inference.LeastSquares().infer(M, y)

        return x_hat
示例#2
0
 def test_Total(self):
     op_total = selection.Total(self.domain_shape_1D)
     queries = op_total.select()
     np.testing.assert_array_equal(queries.dense_matrix(), np.ones((1, 16)))