mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
[priors] InverseGamma fix with singleton
This commit is contained in:
parent
4018832be5
commit
d086c7ee3f
1 changed files with 2 additions and 6 deletions
|
|
@ -188,11 +188,6 @@ class MultivariateGaussian:
|
||||||
from ..plotting.matplot_dep import priors_plots
|
from ..plotting.matplot_dep import priors_plots
|
||||||
priors_plots.multivariate_plot(self)
|
priors_plots.multivariate_plot(self)
|
||||||
|
|
||||||
def gamma_from_EV(E, V):
|
|
||||||
warnings.warn("use Gamma.from_EV to create Gamma Prior", FutureWarning)
|
|
||||||
return Gamma.from_EV(E, V)
|
|
||||||
|
|
||||||
|
|
||||||
class Gamma(Prior):
|
class Gamma(Prior):
|
||||||
"""
|
"""
|
||||||
Implementation of the Gamma probability function, coupled with random variables.
|
Implementation of the Gamma probability function, coupled with random variables.
|
||||||
|
|
@ -254,7 +249,7 @@ class Gamma(Prior):
|
||||||
b = E / V
|
b = E / V
|
||||||
return Gamma(a, b)
|
return Gamma(a, b)
|
||||||
|
|
||||||
class inverse_gamma(Prior):
|
class InverseGamma(Prior):
|
||||||
"""
|
"""
|
||||||
Implementation of the inverse-Gamma probability function, coupled with random variables.
|
Implementation of the inverse-Gamma probability function, coupled with random variables.
|
||||||
|
|
||||||
|
|
@ -265,6 +260,7 @@ class inverse_gamma(Prior):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
domain = _POSITIVE
|
domain = _POSITIVE
|
||||||
|
_instances = []
|
||||||
def __new__(cls, a, b): # Singleton:
|
def __new__(cls, a, b): # Singleton:
|
||||||
if cls._instances:
|
if cls._instances:
|
||||||
cls._instances[:] = [instance for instance in cls._instances if instance()]
|
cls._instances[:] = [instance for instance in cls._instances if instance()]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue