Beispiel #1
0
 def dlogpxmc_dw(self, w, x, n_batch):
     x = self.tiled_x(x, n_batch) 
     x, z, _ = self.gen_xz(w, x, {}, n_batch=n_batch)
     x, z = self.xz_to_theano(x, z)
     A = self.get_A(x)
     r = self.f_dlogpxmc_dw(*ndict.orderedvals((w, x, z))+[A])
     return r[0], dict(zip(ndict.ordered(w).keys(), r[1:]))
Beispiel #2
0
 def logpxmc(self, w, x, n_batch):
     x = self.tiled_x(x, n_batch)
     x, z, _ = self.gen_xz(w, x, {}, n_batch=n_batch)
     x, z = self.xz_to_theano(x, z)
     A = self.get_A(x)
     logpxmc = self.f_logpxmc(*ndict.orderedvals((w, x, z))+[A])
     return logpxmc
Beispiel #3
0
 def logpw(self, w):
     logpw = self.f_logpw(*ndict.orderedvals((w,)))
     return logpw
Beispiel #4
0
 def hessian_z(self, w, z, x):
     x, z = self.xz_to_theano(x, z)
     A = self.get_A(x)
     return self.f_hessian_z(*ndict.orderedvals((w, x, z))+[A])
 def dlogpw_dw(self, v, w):
     r = self.f_dlogpw_dw(*ndict.orderedvals((v, w)))
     v, w = ndict.ordereddicts((v, w))
     return r[0], r[1], dict(zip(v.keys(), r[2:2 + len(v)])), dict(zip(w.keys(), r[2 + len(v):2 + len(v) + len(w)]))
 def logpw(self, v, w):
     logpv, logpw = self.f_logpw(*ndict.orderedvals((v, w)))
     return logpv, logpw
Beispiel #7
0
 def dlogpw_dw(self, v, w):
     r = self.f_dlogpw_dw(*ndict.orderedvals((v,w)))
     v, w = ndict.ordereddicts((v, w))
     return r[0], r[1], dict(zip(v.keys(), r[2:2+len(v)])), dict(zip(w.keys(), r[2+len(v):2+len(v)+len(w)]))
Beispiel #8
0
 def logpw(self, v, w):
     logpv, logpw = self.f_logpw(*ndict.orderedvals((v,w)))
     return logpv, logpw