def setUp(self):
with self.test_session():
N = 4
M = 5
self.mu = tf.placeholder(settings.float_type, [M, N])
self.sqrt = tf.placeholder(settings.float_type, [M, N])
self.chol = tf.placeholder(settings.float_type, [M, M, N])
self.K = tf.placeholder(settings.float_type, [M, M])
self.Kdiag = tf.placeholder(settings.float_type, [M, M])
self.rng = np.random.RandomState(0)
self.mu_data = self.rng.randn(M, N)
sqrt_diag = self.rng.randn(M)
self.sqrt_data = np.array([sqrt_diag for _ in range(N)]).T
sqrt_chol = np.tril(self.rng.randn(M, M))
self.chol_data = np.rollaxis(np.array([sqrt_chol for _ in range(N)]), 0, 3)
self.feed_dict = {
self.mu: np.zeros((M, N)),
self.sqrt: self.sqrt_data,
self.chol: self.chol_data,
self.K: squareT(sqrt_chol),
self.Kdiag: np.diag(sqrt_diag ** 2),
}
评论列表
文章目录