示例#1
0
 def var(self):
     try:
         return self._var
     except AttributeError:
         return square(self.std)
示例#2
0
 def _pdf(self, x):
     return (1 / (np.pi * self.scale * (1 + square(
         (x - self.loc) / self.scale))))
示例#3
0
 def tau(self):
     try:
         return self._tau
     except AttributeError:
         return 1 / square(self.std)
示例#4
0
 def _pdf(self, x):
     return (
         exp(-0.5 * square((x - self.mu) / self.std))
         / sqrt(2 * np.pi) / self.std
     )
示例#5
0
 def forward(self):
     eps = normal(0, 1, (self.ndim, ) + self.std.shape)
     return sqrt(square(self.std * eps).sum(axis=0))
示例#6
0
 def _log_pdf(self, x):
     return ((self.ndim - 1) * log(x) - 0.5 * square(x / self.std) -
             self.ndim * log(self.std) - np.log(sp.gamma(0.5 * self.ndim)))
 def _pdf(self, x):
     gauss = (exp(-0.5 * square(
         (x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std)
     return (self.coef * gauss).sum(axis=self.axis)
示例#8
0
文件: cauchy.py 项目: NicholasYY/PRML
 def _log_pdf(self, x):
     return (
         -np.log(np.pi)
         - log(self.scale)
         - log(1 + square((x - self.loc) / self.scale))
     )
示例#9
0
 def _pdf(self, x):
     return (exp(-0.5 * square(
         (x - self.mu) / self.std)) / sqrt(2 * np.pi) / self.std)
示例#10
0
 def var(self):
     try:
         return self._var
     except AttributeError:
         return square(self.std)
示例#11
0
 def tau(self):
     try:
         return self._tau
     except AttributeError:
         return 1 / square(self.std)
示例#12
0
 def var(self):
     return square(self.parameter["std"])
示例#13
0
 def _pdf(self, x):
     gauss = (
         exp(-0.5 * square((x - self.mu) / self.std))
         / sqrt(2 * np.pi) / self.std
     )
     return (self.coef * gauss).sum(axis=self.axis)
示例#14
0
 def _log_pdf(self, x):
     return (-np.log(np.pi) - log(self.scale) -
             log(1 + square((x - self.loc) / self.scale)))
 def var(self):
     return square(self.parameter["std"])
示例#16
0
文件: kl.py 项目: luyang1210/ppml
def kl_gaussian(q, p):
    qvar = square(q.std)
    pvar = square(p.std)
    return log(p.std) - log(q.std) + 0.5 * (qvar + square(p.mean - q.mean)) / pvar - 0.5
示例#17
0
文件: cauchy.py 项目: NicholasYY/PRML
 def _pdf(self, x):
     return (
         1 / (np.pi * self.scale * (1 + square((x - self.loc) / self.scale)))
     )