Exemplo n.º 1
0
 def test_one(self) -> None:
     # Initial condition
     moments = stats.raw_gaussian_moments_bivar(self.indices, 1.00, 1.00,
                                                0.1, 0.1)
     xi, weight = self.inversion(moments, self.indices)
     print(moments)
     print(weight)
     print(xi[1])
Exemplo n.º 2
0
    def init_batch_input(self, n: int) -> np.ndarray:
        '''
        initialize an Nx5 numpy array containing N moments
        All moments are the same, initialized with raw_gaussian_moments_bivar
        '''
        moments = []
        mu = [1.0, 1.0]
        sig = [0.1, 0.1]
        one_moment = stats.raw_gaussian_moments_bivar(self.indices, mu[0],
                                                      mu[1], sig[0], sig[1])
        for i in range(n):
            moments.append(one_moment)

        return np.asarray(moments)
Exemplo n.º 3
0
def init_batch_input(indices):
    mu = [1.0, 1.0]
    sig = [0.1, 0.1]
    moments = stats.raw_gaussian_moments_bivar(indices, mu[0], mu[1], sig[0],
                                               sig[1])
    return np.asarray(moments)