def matrix2att_cpu(self, matrix):
'''Input is vector of size (batch_size,5) in numpy terms'''
g_hat_x = matrix[:,0]
g_hat_y = matrix[:,1]
log_delta = matrix[:,2]
log_sigma_sqr = matrix[:,3]
log_gamma = matrix[:,4]
g_x = (self.A + 1.0) / 2.0 * (g_hat_x + 1.0)
g_y = (self.B + 1.0) / 2.0 * (g_hat_y + 1.0)
delta = (max(self.A,self.B) - 1.0) / (self.N - 1) * np.exp(log_delta)
gamma = np.exp(log_gamma)
sigma = np.exp(log_sigma_sqr/2.0)
return g_y, g_x, delta, sigma, gamma
评论列表
文章目录