Ejemplo n.º 1
0
 def __init__(self, loc, scale, name, learnable=False, has_bias=False, is_observed=False, is_policy=False, is_reward=False):
     self._type = "Normal"
     ranges = {"loc": geometric_ranges.UnboundedRange(),
               "scale": geometric_ranges.RightHalfLine(0.)}
     super().__init__(name, loc=loc, scale=scale, learnable=learnable, has_bias=has_bias,
                      ranges=ranges, is_observed=is_observed, is_policy=is_policy, is_reward=is_reward)
     self.distribution = distributions.NormalDistribution()
Ejemplo n.º 2
0
 def __init__(self, loc, scale, name, learnable=False):
     self._type = "Normal"
     ranges = {
         "loc": geometric_ranges.UnboundedRange(),
         "scale": geometric_ranges.RightHalfLine(0.)
     }
     super().__init__(name,
                      loc=loc,
                      scale=scale,
                      learnable=learnable,
                      ranges=ranges)
     self.distribution = distributions.NormalDistribution()
Ejemplo n.º 3
0
 def __init__(self, mu, sigma, name, learnable=False):
     self._type = "Normal"
     ranges = {
         "mu": geometric_ranges.UnboundedRange(),
         "sigma": geometric_ranges.RightHalfLine(0.)
     }
     super().__init__(name,
                      mu=mu,
                      sigma=sigma,
                      learnable=learnable,
                      ranges=ranges)
     self.distribution = distributions.NormalDistribution()
Ejemplo n.º 4
0
 def __init__(self,
              mu,
              cov=None,
              chol_cov=None,
              diag_cov=None,
              name="Multivariate Normal",
              learnable=False):
     self._type = "Multivariate Normal"
     if chol_cov is not None and diag_cov is None:
         ranges = {
             "mu": geometric_ranges.UnboundedRange(),
             "chol_cov": geometric_ranges.UnboundedRange()
         }
         super().__init__(name,
                          mu=mu,
                          chol_cov=chol_cov,
                          learnable=learnable,
                          ranges=ranges)
         self.distribution = distributions.CholeskyMultivariateNormal()
     elif diag_cov is not None and chol_cov is None:
         ranges = {
             "mean": geometric_ranges.UnboundedRange(),
             "var": geometric_ranges.RightHalfLine(0.)
         }
         super().__init__(name,
                          mean=mu,
                          var=diag_cov,
                          learnable=learnable,
                          ranges=ranges)
         self.distribution = distributions.NormalDistribution()
     else:
         raise ValueError(
             "Either chol_cov (cholesky factor of the covariance matrix) or "
             +
             "diag_cov (diagonal of the covariance matrix) need to be provided as input"
         )