def sample_grid_encoders(self, n):
    sample_pts = self.get_sample_points(n, method='sobol')
    N = self.num_grids
    if (N < n):
        sorts = np.hstack([np.arange(N), np.random.randint(0, (N - 1), size=(n - N))])
    else:
        sorts = np.arange(n)
    encoders = np.zeros((self.ssp_dim, n))
    for i in range(n):
        sub_mat = _get_sub_SSP(sorts[i], N, sublen=self.grid_basis_dim)
        proj_mat = _proj_sub_SSP(sorts[i], N, sublen=self.grid_basis_dim)
        sub_space = SSPSpace(self.domain_dim, ((2 * self.grid_basis_dim) + 1), axis_matrix=(sub_mat @ self.axis_matrix))
        encoders[:, i] = ((N * proj_mat) @ sub_space.encode(sample_pts[:, i]))
    return encoders
def sample_grid_encoders(self, n):
    sample_pts = self.get_sample_points(n, method='sobol')
    N = self.num_grids
    if (N < n):
        sorts = np.hstack([np.arange(N), np.random.randint(0, (N - 1), size=(n - N))])
    else:
        sorts = np.arange(n)
    encoders = np.zeros((self.ssp_dim, n))
    for i in range(n):
        sub_mat = _get_sub_SSP(sorts[i], N, sublen=self.grid_basis_dim)
        proj_mat = _proj_sub_SSP(sorts[i], N, sublen=self.grid_basis_dim)
        sub_space = SSPSpace(self.domain_dim, ((2 * self.grid_basis_dim) + 1), axis_matrix=(sub_mat @ self.axis_matrix))
        encoders[:, i] = ((N * proj_mat) @ sub_space.encode(sample_pts[:, i]))
    return encoders