def encode(self, x):
    assert (x.shape[0] == self.domain_dim)
    ls_mat = np.atleast_2d(np.diag((1 / self.length_scale.flatten())))
    scaled_x = (ls_mat @ x)
    data = np.fft.ifft(np.exp(((1j * self.phase_matrix) @ scaled_x)), axis=0).real
    return data
def encode(self, x):
    assert (x.shape[0] == self.domain_dim)
    ls_mat = np.atleast_2d(np.diag((1 / self.length_scale.flatten())))
    scaled_x = (ls_mat @ x)
    data = np.fft.ifft(np.exp(((1j * self.phase_matrix) @ scaled_x)), axis=0).real
    return data