Esempio n. 1
0
 def log_q_W_global(self, z):
     """
     log_q_W samples over q for global vars
     """
     mu = self.scale_grad(self.mean)
     rho = self.scale_grad(self.rho)
     z = z[self.global_slc]
     logq = tt.sum(log_normal(z, mu, rho=rho))
     return logq
Esempio n. 2
0
 def symbolic_log_q_W_global(self):
     """
     log_q_W samples over q for global vars
     """
     mu = self.scale_grad(self.mean)
     rho = self.scale_grad(self.rho)
     z = self.symbolic_random_global_matrix
     logq = log_normal(z, mu, rho=rho)
     return logq.sum(1)
Esempio n. 3
0
 def symbolic_log_q_W_global(self):
     """
     log_q_W samples over q for global vars
     """
     mu = self.scale_grad(self.mean)
     rho = self.scale_grad(self.rho)
     z = self.symbolic_random_global_matrix
     logq = log_normal(z, mu, rho=rho)
     return logq.sum(1)
Esempio n. 4
0
 def log_q_W_global(self, z):
     """
     log_q_W samples over q for global vars
     Gradient wrt mu, rho in density parametrization
     is set to zero to lower variance of ELBO
     """
     mu = self.scale_grad(self.mean)
     rho = self.scale_grad(self.rho)
     z = z[self.global_slc]
     logq = tt.sum(log_normal(z, mu, rho=rho))
     return logq