def test_calc_A(self):
tolerance = 1e-100
dims = self.dims
?_w = np.diag(np.ones(dims))
W = np.random.randint(0, 9, self.dims ** 2).reshape(dims, dims) + \
np.eye(dims)
n_avg = 9
A_truth = ?_w * n_avg / (n_avg - 1)
A_truth = np.sqrt(A_truth)
A_truth = np.matmul(np.linalg.inv(W).T, A_truth)
A_model = self.model.calc_A(n_avg, ?_w, W)
self.assert_same(A_model, A_truth, tolerance=tolerance)
self.assert_invertible(self.model.W)
评论列表
文章目录