partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
NetpbmFile._tofile
Write Netbm file.
GPy/util/netpbmfile.py
def _tofile(self, fh, pam=False): """Write Netbm file.""" fh.seek(0) fh.write(self._header(pam)) data = self.asarray(copy=False) if self.maxval == 1: data = numpy.packbits(data, axis=-1) data.tofile(fh)
def _tofile(self, fh, pam=False): """Write Netbm file.""" fh.seek(0) fh.write(self._header(pam)) data = self.asarray(copy=False) if self.maxval == 1: data = numpy.packbits(data, axis=-1) data.tofile(fh)
[ "Write", "Netbm", "file", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/netpbmfile.py#L265-L272
[ "def", "_tofile", "(", "self", ",", "fh", ",", "pam", "=", "False", ")", ":", "fh", ".", "seek", "(", "0", ")", "fh", ".", "write", "(", "self", ".", "_header", "(", "pam", ")", ")", "data", "=", "self", ".", "asarray", "(", "copy", "=", "Fal...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
NetpbmFile._header
Return file header as byte string.
GPy/util/netpbmfile.py
def _header(self, pam=False): """Return file header as byte string.""" if pam or self.magicnum == b'P7': header = "\n".join(( "P7", "HEIGHT %i" % self.height, "WIDTH %i" % self.width, "DEPTH %i" % self.depth, "MA...
def _header(self, pam=False): """Return file header as byte string.""" if pam or self.magicnum == b'P7': header = "\n".join(( "P7", "HEIGHT %i" % self.height, "WIDTH %i" % self.width, "DEPTH %i" % self.depth, "MA...
[ "Return", "file", "header", "as", "byte", "string", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/netpbmfile.py#L274-L293
[ "def", "_header", "(", "self", ",", "pam", "=", "False", ")", ":", "if", "pam", "or", "self", ".", "magicnum", "==", "b'P7'", ":", "header", "=", "\"\\n\"", ".", "join", "(", "(", "\"P7\"", ",", "\"HEIGHT %i\"", "%", "self", ".", "height", ",", "\"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
silence_errors
This wraps a function and it silences numpy errors that happen during the execution. After the function has exited, it restores the previous state of the warnings.
GPy/util/decorators.py
def silence_errors(f): """ This wraps a function and it silences numpy errors that happen during the execution. After the function has exited, it restores the previous state of the warnings. """ @wraps(f) def wrapper(*args, **kwds): status = np.seterr(all='ignore') result = f...
def silence_errors(f): """ This wraps a function and it silences numpy errors that happen during the execution. After the function has exited, it restores the previous state of the warnings. """ @wraps(f) def wrapper(*args, **kwds): status = np.seterr(all='ignore') result = f...
[ "This", "wraps", "a", "function", "and", "it", "silences", "numpy", "errors", "that", "happen", "during", "the", "execution", ".", "After", "the", "function", "has", "exited", "it", "restores", "the", "previous", "state", "of", "the", "warnings", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/decorators.py#L6-L18
[ "def", "silence_errors", "(", "f", ")", ":", "@", "wraps", "(", "f", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "status", "=", "np", ".", "seterr", "(", "all", "=", "'ignore'", ")", "result", "=", "f", "(", "*", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
sde_StdPeriodic.sde
Return the state space representation of the standard periodic covariance. ! Note: one must constrain lengthscale not to drop below 0.2. (independently of approximation order) After this Bessel functions of the first becomes NaN. Rescaling time variable might help. ...
GPy/kern/src/sde_standard_periodic.py
def sde(self): """ Return the state space representation of the standard periodic covariance. ! Note: one must constrain lengthscale not to drop below 0.2. (independently of approximation order) After this Bessel functions of the first becomes NaN. Rescaling t...
def sde(self): """ Return the state space representation of the standard periodic covariance. ! Note: one must constrain lengthscale not to drop below 0.2. (independently of approximation order) After this Bessel functions of the first becomes NaN. Rescaling t...
[ "Return", "the", "state", "space", "representation", "of", "the", "standard", "periodic", "covariance", ".", "!", "Note", ":", "one", "must", "constrain", "lengthscale", "not", "to", "drop", "below", "0", ".", "2", ".", "(", "independently", "of", "approxima...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/sde_standard_periodic.py#L72-L149
[ "def", "sde", "(", "self", ")", ":", "#import pdb; pdb.set_trace()", "# Params to use: (in that order)", "#self.variance", "#self.period", "#self.lengthscale", "if", "self", ".", "approx_order", "is", "not", "None", ":", "N", "=", "int", "(", "self", ".", "approx_or...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Exponential.pdf_link
Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\lambda(f_{i})\\exp (-y\\lambda(f_{i})) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata which is not used ...
GPy/likelihoods/exponential.py
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\lambda(f_{i})\\exp (-y\\lambda(f_{i})) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y...
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\lambda(f_{i})\\exp (-y\\lambda(f_{i})) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/exponential.py#L25-L42
[ "def", "pdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "assert", "np", ".", "atleast_1d", "(", "link_f", ")", ".", "shape", "==", "np", ".", "atleast_1d", "(", "y", ")", ".", "shape", "log_objective", "=", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Exponential.logpdf_link
Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\lambda(f_{i}) - y_{i}\\lambda(f_{i}) :param link_f: latent variables (link(f)) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata which...
GPy/likelihoods/exponential.py
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\lambda(f_{i}) - y_{i}\\lambda(f_{i}) :param link_f: latent variables (link(f)) :type link_f: Nx1 array :param y: data...
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\lambda(f_{i}) - y_{i}\\lambda(f_{i}) :param link_f: latent variables (link(f)) :type link_f: Nx1 array :param y: data...
[ "Log", "Likelihood", "Function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/exponential.py#L44-L61
[ "def", "logpdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "log_objective", "=", "np", ".", "log", "(", "link_f", ")", "-", "y", "*", "link_f", "return", "log_objective" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Poisson.pdf_link
Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\lambda(f_{i})^{y_{i}}}{y_{i}!}e^{-\\lambda(f_{i})} :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata...
GPy/likelihoods/poisson.py
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\lambda(f_{i})^{y_{i}}}{y_{i}!}e^{-\\lambda(f_{i})} :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: d...
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\lambda(f_{i})^{y_{i}}}{y_{i}!}e^{-\\lambda(f_{i})} :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: d...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/poisson.py#L33-L49
[ "def", "pdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "assert", "np", ".", "atleast_1d", "(", "link_f", ")", ".", "shape", "==", "np", ".", "atleast_1d", "(", "y", ")", ".", "shape", "return", "np", ".",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Poisson.logpdf_link
Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = -\\lambda(f_{i}) + y_{i}\\log \\lambda(f_{i}) - \\log y_{i}! :param link_f: latent variables (link(f)) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata:...
GPy/likelihoods/poisson.py
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = -\\lambda(f_{i}) + y_{i}\\log \\lambda(f_{i}) - \\log y_{i}! :param link_f: latent variables (link(f)) :type link_f: Nx1 array ...
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = -\\lambda(f_{i}) + y_{i}\\log \\lambda(f_{i}) - \\log y_{i}! :param link_f: latent variables (link(f)) :type link_f: Nx1 array ...
[ "Log", "Likelihood", "Function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/poisson.py#L52-L68
[ "def", "logpdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "return", "-", "link_f", "+", "y", "*", "np", ".", "log", "(", "link_f", ")", "-", "special", ".", "gammaln", "(", "y", "+", "1", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Poisson.samples
Returns a set of samples of observations based on a given value of the latent variable. :param gp: latent variable
GPy/likelihoods/poisson.py
def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations based on a given value of the latent variable. :param gp: latent variable """ orig_shape = gp.shape gp = gp.flatten() # Ysim = np.random.poisson(self.gp_link.transf(gp), [samples...
def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations based on a given value of the latent variable. :param gp: latent variable """ orig_shape = gp.shape gp = gp.flatten() # Ysim = np.random.poisson(self.gp_link.transf(gp), [samples...
[ "Returns", "a", "set", "of", "samples", "of", "observations", "based", "on", "a", "given", "value", "of", "the", "latent", "variable", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/poisson.py#L141-L152
[ "def", "samples", "(", "self", ",", "gp", ",", "Y_metadata", "=", "None", ")", ":", "orig_shape", "=", "gp", ".", "shape", "gp", "=", "gp", ".", "flatten", "(", ")", "# Ysim = np.random.poisson(self.gp_link.transf(gp), [samples, gp.size]).T", "# return Ysim.reshape(...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
WarpingFunction.f_inv
Calculate the numerical inverse of f. This should be overwritten for specific warping functions where the inverse can be found in closed form. :param max_iterations: maximum number of N.R. iterations
GPy/util/warping_functions.py
def f_inv(self, z, max_iterations=250, y=None): """ Calculate the numerical inverse of f. This should be overwritten for specific warping functions where the inverse can be found in closed form. :param max_iterations: maximum number of N.R. iterations """ z = z....
def f_inv(self, z, max_iterations=250, y=None): """ Calculate the numerical inverse of f. This should be overwritten for specific warping functions where the inverse can be found in closed form. :param max_iterations: maximum number of N.R. iterations """ z = z....
[ "Calculate", "the", "numerical", "inverse", "of", "f", ".", "This", "should", "be", "overwritten", "for", "specific", "warping", "functions", "where", "the", "inverse", "can", "be", "found", "in", "closed", "form", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/warping_functions.py#L34-L57
[ "def", "f_inv", "(", "self", ",", "z", ",", "max_iterations", "=", "250", ",", "y", "=", "None", ")", ":", "z", "=", "z", ".", "copy", "(", ")", "y", "=", "np", ".", "ones_like", "(", "z", ")", "it", "=", "0", "update", "=", "np", ".", "inf...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
TanhFunction.f
Transform y with f using parameter vector psi psi = [[a,b,c]] :math:`f = (y * d) + \\sum_{terms} a * tanh(b *(y + c))`
GPy/util/warping_functions.py
def f(self, y): """ Transform y with f using parameter vector psi psi = [[a,b,c]] :math:`f = (y * d) + \\sum_{terms} a * tanh(b *(y + c))` """ d = self.d mpsi = self.psi z = d * y.copy() for i in range(len(mpsi)): a, b, c = mpsi[i] ...
def f(self, y): """ Transform y with f using parameter vector psi psi = [[a,b,c]] :math:`f = (y * d) + \\sum_{terms} a * tanh(b *(y + c))` """ d = self.d mpsi = self.psi z = d * y.copy() for i in range(len(mpsi)): a, b, c = mpsi[i] ...
[ "Transform", "y", "with", "f", "using", "parameter", "vector", "psi", "psi", "=", "[[", "a", "b", "c", "]]" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/warping_functions.py#L93-L106
[ "def", "f", "(", "self", ",", "y", ")", ":", "d", "=", "self", ".", "d", "mpsi", "=", "self", ".", "psi", "z", "=", "d", "*", "y", ".", "copy", "(", ")", "for", "i", "in", "range", "(", "len", "(", "mpsi", ")", ")", ":", "a", ",", "b", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
TanhFunction.fgrad_y
gradient of f w.r.t to y ([N x 1]) :returns: Nx1 vector of derivatives, unless return_precalc is true, then it also returns the precomputed stuff
GPy/util/warping_functions.py
def fgrad_y(self, y, return_precalc=False): """ gradient of f w.r.t to y ([N x 1]) :returns: Nx1 vector of derivatives, unless return_precalc is true, then it also returns the precomputed stuff """ d = self.d mpsi = self.psi # vectorized version ...
def fgrad_y(self, y, return_precalc=False): """ gradient of f w.r.t to y ([N x 1]) :returns: Nx1 vector of derivatives, unless return_precalc is true, then it also returns the precomputed stuff """ d = self.d mpsi = self.psi # vectorized version ...
[ "gradient", "of", "f", "w", ".", "r", ".", "t", "to", "y", "(", "[", "N", "x", "1", "]", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/warping_functions.py#L108-L128
[ "def", "fgrad_y", "(", "self", ",", "y", ",", "return_precalc", "=", "False", ")", ":", "d", "=", "self", ".", "d", "mpsi", "=", "self", ".", "psi", "# vectorized version", "S", "=", "(", "mpsi", "[", ":", ",", "1", "]", "*", "(", "y", "[", ":"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
TanhFunction.fgrad_y_psi
gradient of f w.r.t to y and psi :returns: NxIx4 tensor of partial derivatives
GPy/util/warping_functions.py
def fgrad_y_psi(self, y, return_covar_chain=False): """ gradient of f w.r.t to y and psi :returns: NxIx4 tensor of partial derivatives """ mpsi = self.psi w, s, r, d = self.fgrad_y(y, return_precalc=True) gradients = np.zeros((y.shape[0], y.shape[1], len(mpsi), ...
def fgrad_y_psi(self, y, return_covar_chain=False): """ gradient of f w.r.t to y and psi :returns: NxIx4 tensor of partial derivatives """ mpsi = self.psi w, s, r, d = self.fgrad_y(y, return_precalc=True) gradients = np.zeros((y.shape[0], y.shape[1], len(mpsi), ...
[ "gradient", "of", "f", "w", ".", "r", ".", "t", "to", "y", "and", "psi" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/warping_functions.py#L130-L157
[ "def", "fgrad_y_psi", "(", "self", ",", "y", ",", "return_covar_chain", "=", "False", ")", ":", "mpsi", "=", "self", ".", "psi", "w", ",", "s", ",", "r", ",", "d", "=", "self", ".", "fgrad_y", "(", "y", ",", "return_precalc", "=", "True", ")", "g...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
inv_std_norm_cdf
Inverse cumulative standard Gaussian distribution Based on Winitzki, S. (2008)
GPy/util/univariate_Gaussian.py
def inv_std_norm_cdf(x): """ Inverse cumulative standard Gaussian distribution Based on Winitzki, S. (2008) """ z = 2*x -1 ln1z2 = np.log(1-z**2) a = 8*(np.pi -3)/(3*np.pi*(4-np.pi)) b = 2/(np.pi * a) + ln1z2/2 inv_erf = np.sign(z) * np.sqrt( np.sqrt(b**2 - ln1z2/a) - b ) return ...
def inv_std_norm_cdf(x): """ Inverse cumulative standard Gaussian distribution Based on Winitzki, S. (2008) """ z = 2*x -1 ln1z2 = np.log(1-z**2) a = 8*(np.pi -3)/(3*np.pi*(4-np.pi)) b = 2/(np.pi * a) + ln1z2/2 inv_erf = np.sign(z) * np.sqrt( np.sqrt(b**2 - ln1z2/a) - b ) return ...
[ "Inverse", "cumulative", "standard", "Gaussian", "distribution", "Based", "on", "Winitzki", "S", ".", "(", "2008", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/univariate_Gaussian.py#L14-L24
[ "def", "inv_std_norm_cdf", "(", "x", ")", ":", "z", "=", "2", "*", "x", "-", "1", "ln1z2", "=", "np", ".", "log", "(", "1", "-", "z", "**", "2", ")", "a", "=", "8", "*", "(", "np", ".", "pi", "-", "3", ")", "/", "(", "3", "*", "np", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cdfNormal
Robust implementations of cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. */
GPy/util/univariate_Gaussian.py
def cdfNormal(z): """ Robust implementations of cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. */ """ if (abs(z) < ERF_CODY_LIMIT1): # Phi(z) approx (1+y ...
def cdfNormal(z): """ Robust implementations of cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. */ """ if (abs(z) < ERF_CODY_LIMIT1): # Phi(z) approx (1+y ...
[ "Robust", "implementations", "of", "cdf", "of", "a", "standard", "normal", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/univariate_Gaussian.py#L35-L50
[ "def", "cdfNormal", "(", "z", ")", ":", "if", "(", "abs", "(", "z", ")", "<", "ERF_CODY_LIMIT1", ")", ":", "# Phi(z) approx (1+y R_3(y^2))/2, y=z/sqrt(2)", "return", "0.5", "*", "(", "1.0", "+", "(", "z", "/", "M_SQRT2", ")", "*", "_erfRationalHelperR3", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
logCdfNormal
Robust implementations of log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger.
GPy/util/univariate_Gaussian.py
def logCdfNormal(z): """ Robust implementations of log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. """ if (abs(z) < ERF_CODY_LIMIT1): # Phi(z) approx (1+y...
def logCdfNormal(z): """ Robust implementations of log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. """ if (abs(z) < ERF_CODY_LIMIT1): # Phi(z) approx (1+y...
[ "Robust", "implementations", "of", "log", "cdf", "of", "a", "standard", "normal", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/univariate_Gaussian.py#L54-L68
[ "def", "logCdfNormal", "(", "z", ")", ":", "if", "(", "abs", "(", "z", ")", "<", "ERF_CODY_LIMIT1", ")", ":", "# Phi(z) approx (1+y R_3(y^2))/2, y=z/sqrt(2)", "return", "np", ".", "log1p", "(", "(", "z", "/", "M_SQRT2", ")", "*", "_erfRationalHelperR3", "("...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
derivLogCdfNormal
Robust implementations of derivative of the log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger.
GPy/util/univariate_Gaussian.py
def derivLogCdfNormal(z): """ Robust implementations of derivative of the log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. """ if (abs(z) < ERF_CODY_LIMIT1): ...
def derivLogCdfNormal(z): """ Robust implementations of derivative of the log cdf of a standard normal. @see [[https://github.com/mseeger/apbsint/blob/master/src/eptools/potentials/SpecfunServices.h original implementation]] in C from Matthias Seeger. """ if (abs(z) < ERF_CODY_LIMIT1): ...
[ "Robust", "implementations", "of", "derivative", "of", "the", "log", "cdf", "of", "a", "standard", "normal", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/univariate_Gaussian.py#L72-L87
[ "def", "derivLogCdfNormal", "(", "z", ")", ":", "if", "(", "abs", "(", "z", ")", "<", "ERF_CODY_LIMIT1", ")", ":", "# Phi(z) approx (1 + y R_3(y^2))/2, y = z/sqrt(2)", "return", "2.0", "*", "np", ".", "exp", "(", "logPdfNormal", "(", "z", ")", ")", "/", "(...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
index_to_slices
take a numpy array of integers (index) and return a nested list of slices such that the slices describe the start, stop points for each integer in the index. e.g. >>> index = np.asarray([0,0,0,1,1,1,2,2,2]) returns >>> [[slice(0,3,None)],[slice(3,6,None)],[slice(6,9,None)]] or, a more complicated...
GPy/kern/src/independent_outputs.py
def index_to_slices(index): """ take a numpy array of integers (index) and return a nested list of slices such that the slices describe the start, stop points for each integer in the index. e.g. >>> index = np.asarray([0,0,0,1,1,1,2,2,2]) returns >>> [[slice(0,3,None)],[slice(3,6,None)],[slice...
def index_to_slices(index): """ take a numpy array of integers (index) and return a nested list of slices such that the slices describe the start, stop points for each integer in the index. e.g. >>> index = np.asarray([0,0,0,1,1,1,2,2,2]) returns >>> [[slice(0,3,None)],[slice(3,6,None)],[slice...
[ "take", "a", "numpy", "array", "of", "integers", "(", "index", ")", "and", "return", "a", "nested", "list", "of", "slices", "such", "that", "the", "slices", "describe", "the", "start", "stop", "points", "for", "each", "integer", "in", "the", "index", "."...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/independent_outputs.py#L9-L35
[ "def", "index_to_slices", "(", "index", ")", ":", "if", "len", "(", "index", ")", "==", "0", ":", "return", "[", "]", "#contruct the return structure", "ind", "=", "np", ".", "asarray", "(", "index", ",", "dtype", "=", "np", ".", "int", ")", "ret", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
prompt_user
Ask user for agreeing to data set licenses.
GPy/util/datasets.py
def prompt_user(prompt): """Ask user for agreeing to data set licenses.""" # raw_input returns the empty string for "enter" yes = set(['yes', 'y']) no = set(['no','n']) try: print(prompt) choice = input().lower() # would like to test for exception here, but not sure if we ca...
def prompt_user(prompt): """Ask user for agreeing to data set licenses.""" # raw_input returns the empty string for "enter" yes = set(['yes', 'y']) no = set(['no','n']) try: print(prompt) choice = input().lower() # would like to test for exception here, but not sure if we ca...
[ "Ask", "user", "for", "agreeing", "to", "data", "set", "licenses", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L68-L92
[ "def", "prompt_user", "(", "prompt", ")", ":", "# raw_input returns the empty string for \"enter\"", "yes", "=", "set", "(", "[", "'yes'", ",", "'y'", "]", ")", "no", "=", "set", "(", "[", "'no'", ",", "'n'", "]", ")", "try", ":", "print", "(", "prompt",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
data_available
Check if the data set is available on the local machine already.
GPy/util/datasets.py
def data_available(dataset_name=None): """Check if the data set is available on the local machine already.""" try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest dr = data_resources[dataset_name] zip_urls = (dr['files'], ) ...
def data_available(dataset_name=None): """Check if the data set is available on the local machine already.""" try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest dr = data_resources[dataset_name] zip_urls = (dr['files'], ) ...
[ "Check", "if", "the", "data", "set", "is", "available", "on", "the", "local", "machine", "already", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L96-L112
[ "def", "data_available", "(", "dataset_name", "=", "None", ")", ":", "try", ":", "from", "itertools", "import", "zip_longest", "except", "ImportError", ":", "from", "itertools", "import", "izip_longest", "as", "zip_longest", "dr", "=", "data_resources", "[", "da...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
download_url
Download a file from a url and save it to disk.
GPy/util/datasets.py
def download_url(url, store_directory, save_name=None, messages=True, suffix=''): """Download a file from a url and save it to disk.""" i = url.rfind('/') file = url[i+1:] print(file) dir_name = os.path.join(data_path, store_directory) if save_name is None: save_name = os.path.join(dir_name, fi...
def download_url(url, store_directory, save_name=None, messages=True, suffix=''): """Download a file from a url and save it to disk.""" i = url.rfind('/') file = url[i+1:] print(file) dir_name = os.path.join(data_path, store_directory) if save_name is None: save_name = os.path.join(dir_name, fi...
[ "Download", "a", "file", "from", "a", "url", "and", "save", "it", "to", "disk", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L114-L169
[ "def", "download_url", "(", "url", ",", "store_directory", ",", "save_name", "=", "None", ",", "messages", "=", "True", ",", "suffix", "=", "''", ")", ":", "i", "=", "url", ".", "rfind", "(", "'/'", ")", "file", "=", "url", "[", "i", "+", "1", ":...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
authorize_download
Check with the user that the are happy with terms and conditions for the data set.
GPy/util/datasets.py
def authorize_download(dataset_name=None): """Check with the user that the are happy with terms and conditions for the data set.""" print(('Acquiring resource: ' + dataset_name)) # TODO, check resource is in dictionary! print('') dr = data_resources[dataset_name] print('Details of data: ') p...
def authorize_download(dataset_name=None): """Check with the user that the are happy with terms and conditions for the data set.""" print(('Acquiring resource: ' + dataset_name)) # TODO, check resource is in dictionary! print('') dr = data_resources[dataset_name] print('Details of data: ') p...
[ "Check", "with", "the", "user", "that", "the", "are", "happy", "with", "terms", "and", "conditions", "for", "the", "data", "set", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L176-L205
[ "def", "authorize_download", "(", "dataset_name", "=", "None", ")", ":", "print", "(", "(", "'Acquiring resource: '", "+", "dataset_name", ")", ")", "# TODO, check resource is in dictionary!", "print", "(", "''", ")", "dr", "=", "data_resources", "[", "dataset_name"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
download_data
Check with the user that the are happy with terms and conditions for the data set, then download it.
GPy/util/datasets.py
def download_data(dataset_name=None): """Check with the user that the are happy with terms and conditions for the data set, then download it.""" try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest dr = data_resources[dataset_name]...
def download_data(dataset_name=None): """Check with the user that the are happy with terms and conditions for the data set, then download it.""" try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest dr = data_resources[dataset_name]...
[ "Check", "with", "the", "user", "that", "the", "are", "happy", "with", "terms", "and", "conditions", "for", "the", "data", "set", "then", "download", "it", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L207-L230
[ "def", "download_data", "(", "dataset_name", "=", "None", ")", ":", "try", ":", "from", "itertools", "import", "zip_longest", "except", "ImportError", ":", "from", "itertools", "import", "izip_longest", "as", "zip_longest", "dr", "=", "data_resources", "[", "dat...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cmu_urls_files
Find which resources are missing on the local disk for the requested CMU motion capture motions.
GPy/util/datasets.py
def cmu_urls_files(subj_motions, messages = True): ''' Find which resources are missing on the local disk for the requested CMU motion capture motions. ''' dr = data_resources['cmu_mocap_full'] cmu_url = dr['urls'][0] subjects_num = subj_motions[0] motions_num = subj_motions[1] resourc...
def cmu_urls_files(subj_motions, messages = True): ''' Find which resources are missing on the local disk for the requested CMU motion capture motions. ''' dr = data_resources['cmu_mocap_full'] cmu_url = dr['urls'][0] subjects_num = subj_motions[0] motions_num = subj_motions[1] resourc...
[ "Find", "which", "resources", "are", "missing", "on", "the", "local", "disk", "for", "the", "requested", "CMU", "motion", "capture", "motions", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L238-L291
[ "def", "cmu_urls_files", "(", "subj_motions", ",", "messages", "=", "True", ")", ":", "dr", "=", "data_resources", "[", "'cmu_mocap_full'", "]", "cmu_url", "=", "dr", "[", "'urls'", "]", "[", "0", "]", "subjects_num", "=", "subj_motions", "[", "0", "]", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
football_data
Football data from English games since 1993. This downloads data from football-data.co.uk for the given season.
GPy/util/datasets.py
def football_data(season='1314', data_set='football_data'): """Football data from English games since 1993. This downloads data from football-data.co.uk for the given season. """ def league2num(string): league_dict = {'E0':0, 'E1':1, 'E2': 2, 'E3': 3, 'EC':4} return league_dict[string] def ...
def football_data(season='1314', data_set='football_data'): """Football data from English games since 1993. This downloads data from football-data.co.uk for the given season. """ def league2num(string): league_dict = {'E0':0, 'E1':1, 'E2': 2, 'E3': 3, 'EC':4} return league_dict[string] def ...
[ "Football", "data", "from", "English", "games", "since", "1993", ".", "This", "downloads", "data", "from", "football", "-", "data", ".", "co", ".", "uk", "for", "the", "given", "season", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L360-L400
[ "def", "football_data", "(", "season", "=", "'1314'", ",", "data_set", "=", "'football_data'", ")", ":", "def", "league2num", "(", "string", ")", ":", "league_dict", "=", "{", "'E0'", ":", "0", ",", "'E1'", ":", "1", ",", "'E2'", ":", "2", ",", "'E3'...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
oil
The three phase oil data from Bishop and James (1993).
GPy/util/datasets.py
def oil(data_set='three_phase_oil_flow'): """The three phase oil data from Bishop and James (1993).""" if not data_available(data_set): download_data(data_set) oil_train_file = os.path.join(data_path, data_set, 'DataTrn.txt') oil_trainlbls_file = os.path.join(data_path, data_set, 'DataTrnLbls.tx...
def oil(data_set='three_phase_oil_flow'): """The three phase oil data from Bishop and James (1993).""" if not data_available(data_set): download_data(data_set) oil_train_file = os.path.join(data_path, data_set, 'DataTrn.txt') oil_trainlbls_file = os.path.join(data_path, data_set, 'DataTrnLbls.tx...
[ "The", "three", "phase", "oil", "data", "from", "Bishop", "and", "James", "(", "1993", ")", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L557-L585
[ "def", "oil", "(", "data_set", "=", "'three_phase_oil_flow'", ")", ":", "if", "not", "data_available", "(", "data_set", ")", ":", "download_data", "(", "data_set", ")", "oil_train_file", "=", "os", ".", "path", ".", "join", "(", "data_path", ",", "data_set",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
hapmap3
The HapMap phase three SNP dataset - 1184 samples out of 11 populations. SNP_matrix (A) encoding [see Paschou et all. 2007 (PCA-Correlated SNPs...)]: Let (B1,B2) be the alphabetically sorted bases, which occur in the j-th SNP, then / 1, iff SNPij==(B1,B1) Aij = | 0, iff SNPij==(B1,B2) ...
GPy/util/datasets.py
def hapmap3(data_set='hapmap3'): """ The HapMap phase three SNP dataset - 1184 samples out of 11 populations. SNP_matrix (A) encoding [see Paschou et all. 2007 (PCA-Correlated SNPs...)]: Let (B1,B2) be the alphabetically sorted bases, which occur in the j-th SNP, then / 1, iff SNPij==(B1,B1...
def hapmap3(data_set='hapmap3'): """ The HapMap phase three SNP dataset - 1184 samples out of 11 populations. SNP_matrix (A) encoding [see Paschou et all. 2007 (PCA-Correlated SNPs...)]: Let (B1,B2) be the alphabetically sorted bases, which occur in the j-th SNP, then / 1, iff SNPij==(B1,B1...
[ "The", "HapMap", "phase", "three", "SNP", "dataset", "-", "1184", "samples", "out", "of", "11", "populations", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L768-L917
[ "def", "hapmap3", "(", "data_set", "=", "'hapmap3'", ")", ":", "try", ":", "from", "pandas", "import", "read_pickle", ",", "DataFrame", "from", "sys", "import", "stdout", "import", "bz2", "except", "ImportError", "as", "i", ":", "raise", "i", "(", "\"Need ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
toy_rbf_1d
Samples values of a function from an RBF covariance with very small noise for inputs uniformly distributed between -1 and 1. :param seed: seed to use for random sampling. :type seed: int :param num_samples: number of samples to sample in the function (default 500). :type num_samples: int
GPy/util/datasets.py
def toy_rbf_1d(seed=default_seed, num_samples=500): """ Samples values of a function from an RBF covariance with very small noise for inputs uniformly distributed between -1 and 1. :param seed: seed to use for random sampling. :type seed: int :param num_samples: number of samples to sample in the f...
def toy_rbf_1d(seed=default_seed, num_samples=500): """ Samples values of a function from an RBF covariance with very small noise for inputs uniformly distributed between -1 and 1. :param seed: seed to use for random sampling. :type seed: int :param num_samples: number of samples to sample in the f...
[ "Samples", "values", "of", "a", "function", "from", "an", "RBF", "covariance", "with", "very", "small", "noise", "for", "inputs", "uniformly", "distributed", "between", "-", "1", "and", "1", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1102-L1121
[ "def", "toy_rbf_1d", "(", "seed", "=", "default_seed", ",", "num_samples", "=", "500", ")", ":", "np", ".", "random", ".", "seed", "(", "seed", "=", "seed", ")", "num_in", "=", "1", "X", "=", "np", ".", "random", ".", "uniform", "(", "low", "=", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
crescent_data
Data set formed from a mixture of four Gaussians. In each class two of the Gaussians are elongated at right angles to each other and offset to form an approximation to the crescent data that is popular in semi-supervised learning as a toy problem. :param num_data_part: number of data to be sampled (default is 200)...
GPy/util/datasets.py
def crescent_data(num_data=200, seed=default_seed): """ Data set formed from a mixture of four Gaussians. In each class two of the Gaussians are elongated at right angles to each other and offset to form an approximation to the crescent data that is popular in semi-supervised learning as a toy problem. :param ...
def crescent_data(num_data=200, seed=default_seed): """ Data set formed from a mixture of four Gaussians. In each class two of the Gaussians are elongated at right angles to each other and offset to form an approximation to the crescent data that is popular in semi-supervised learning as a toy problem. :param ...
[ "Data", "set", "formed", "from", "a", "mixture", "of", "four", "Gaussians", ".", "In", "each", "class", "two", "of", "the", "Gaussians", "are", "elongated", "at", "right", "angles", "to", "each", "other", "and", "offset", "to", "form", "an", "approximation...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1313-L1352
[ "def", "crescent_data", "(", "num_data", "=", "200", ",", "seed", "=", "default_seed", ")", ":", "np", ".", "random", ".", "seed", "(", "seed", "=", "seed", ")", "sqrt2", "=", "np", ".", "sqrt", "(", "2", ")", "# Rotation matrix", "R", "=", "np", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
creep_data
Brun and Yoshida's metal creep rupture data.
GPy/util/datasets.py
def creep_data(data_set='creep_rupture'): """Brun and Yoshida's metal creep rupture data.""" if not data_available(data_set): download_data(data_set) path = os.path.join(data_path, data_set) tar_file = os.path.join(path, 'creeprupt.tar') tar = tarfile.open(tar_file) print...
def creep_data(data_set='creep_rupture'): """Brun and Yoshida's metal creep rupture data.""" if not data_available(data_set): download_data(data_set) path = os.path.join(data_path, data_set) tar_file = os.path.join(path, 'creeprupt.tar') tar = tarfile.open(tar_file) print...
[ "Brun", "and", "Yoshida", "s", "metal", "creep", "rupture", "data", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1354-L1369
[ "def", "creep_data", "(", "data_set", "=", "'creep_rupture'", ")", ":", "if", "not", "data_available", "(", "data_set", ")", ":", "download_data", "(", "data_set", ")", "path", "=", "os", ".", "path", ".", "join", "(", "data_path", ",", "data_set", ")", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cifar10_patches
The Candian Institute for Advanced Research 10 image data set. Code for loading in this data is taken from this Boris Babenko's blog post, original code available here: http://bbabenko.tumblr.com/post/86756017649/learning-low-level-vision-feautres-in-10-lines-of-code
GPy/util/datasets.py
def cifar10_patches(data_set='cifar-10'): """The Candian Institute for Advanced Research 10 image data set. Code for loading in this data is taken from this Boris Babenko's blog post, original code available here: http://bbabenko.tumblr.com/post/86756017649/learning-low-level-vision-feautres-in-10-lines-of-code""" ...
def cifar10_patches(data_set='cifar-10'): """The Candian Institute for Advanced Research 10 image data set. Code for loading in this data is taken from this Boris Babenko's blog post, original code available here: http://bbabenko.tumblr.com/post/86756017649/learning-low-level-vision-feautres-in-10-lines-of-code""" ...
[ "The", "Candian", "Institute", "for", "Advanced", "Research", "10", "image", "data", "set", ".", "Code", "for", "loading", "in", "this", "data", "is", "taken", "from", "this", "Boris", "Babenko", "s", "blog", "post", "original", "code", "available", "here", ...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1371-L1393
[ "def", "cifar10_patches", "(", "data_set", "=", "'cifar-10'", ")", ":", "dir_path", "=", "os", ".", "path", ".", "join", "(", "data_path", ",", "data_set", ")", "filename", "=", "os", ".", "path", ".", "join", "(", "dir_path", ",", "'cifar-10-python.tar.gz...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cmu_mocap_49_balance
Load CMU subject 49's one legged balancing motion that was used by Alvarez, Luengo and Lawrence at AISTATS 2009.
GPy/util/datasets.py
def cmu_mocap_49_balance(data_set='cmu_mocap'): """Load CMU subject 49's one legged balancing motion that was used by Alvarez, Luengo and Lawrence at AISTATS 2009.""" train_motions = ['18', '19'] test_motions = ['20'] data = cmu_mocap('49', train_motions, test_motions, sample_every=4, data_set=data_set)...
def cmu_mocap_49_balance(data_set='cmu_mocap'): """Load CMU subject 49's one legged balancing motion that was used by Alvarez, Luengo and Lawrence at AISTATS 2009.""" train_motions = ['18', '19'] test_motions = ['20'] data = cmu_mocap('49', train_motions, test_motions, sample_every=4, data_set=data_set)...
[ "Load", "CMU", "subject", "49", "s", "one", "legged", "balancing", "motion", "that", "was", "used", "by", "Alvarez", "Luengo", "and", "Lawrence", "at", "AISTATS", "2009", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1395-L1401
[ "def", "cmu_mocap_49_balance", "(", "data_set", "=", "'cmu_mocap'", ")", ":", "train_motions", "=", "[", "'18'", ",", "'19'", "]", "test_motions", "=", "[", "'20'", "]", "data", "=", "cmu_mocap", "(", "'49'", ",", "train_motions", ",", "test_motions", ",", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cmu_mocap_35_walk_jog
Load CMU subject 35's walking and jogging motions, the same data that was used by Taylor, Roweis and Hinton at NIPS 2007. but without their preprocessing. Also used by Lawrence at AISTATS 2007.
GPy/util/datasets.py
def cmu_mocap_35_walk_jog(data_set='cmu_mocap'): """Load CMU subject 35's walking and jogging motions, the same data that was used by Taylor, Roweis and Hinton at NIPS 2007. but without their preprocessing. Also used by Lawrence at AISTATS 2007.""" train_motions = ['01', '02', '03', '04', '05', '06', ...
def cmu_mocap_35_walk_jog(data_set='cmu_mocap'): """Load CMU subject 35's walking and jogging motions, the same data that was used by Taylor, Roweis and Hinton at NIPS 2007. but without their preprocessing. Also used by Lawrence at AISTATS 2007.""" train_motions = ['01', '02', '03', '04', '05', '06', ...
[ "Load", "CMU", "subject", "35", "s", "walking", "and", "jogging", "motions", "the", "same", "data", "that", "was", "used", "by", "Taylor", "Roweis", "and", "Hinton", "at", "NIPS", "2007", ".", "but", "without", "their", "preprocessing", ".", "Also", "used"...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1403-L1413
[ "def", "cmu_mocap_35_walk_jog", "(", "data_set", "=", "'cmu_mocap'", ")", ":", "train_motions", "=", "[", "'01'", ",", "'02'", ",", "'03'", ",", "'04'", ",", "'05'", ",", "'06'", ",", "'07'", ",", "'08'", ",", "'09'", ",", "'10'", ",", "'11'", ",", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
cmu_mocap
Load a given subject's training and test motions from the CMU motion capture data.
GPy/util/datasets.py
def cmu_mocap(subject, train_motions, test_motions=[], sample_every=4, data_set='cmu_mocap'): """Load a given subject's training and test motions from the CMU motion capture data.""" # Load in subject skeleton. subject_dir = os.path.join(data_path, data_set) # Make sure the data is downloaded. all_...
def cmu_mocap(subject, train_motions, test_motions=[], sample_every=4, data_set='cmu_mocap'): """Load a given subject's training and test motions from the CMU motion capture data.""" # Load in subject skeleton. subject_dir = os.path.join(data_path, data_set) # Make sure the data is downloaded. all_...
[ "Load", "a", "given", "subject", "s", "training", "and", "test", "motions", "from", "the", "CMU", "motion", "capture", "data", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/datasets.py#L1415-L1492
[ "def", "cmu_mocap", "(", "subject", ",", "train_motions", ",", "test_motions", "=", "[", "]", ",", "sample_every", "=", "4", ",", "data_set", "=", "'cmu_mocap'", ")", ":", "# Load in subject skeleton.", "subject_dir", "=", "os", ".", "path", ".", "join", "("...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
PeriodicExponential.update_gradients_full
derivative of the covariance matrix with respect to the parameters (shape is N x num_inducing x num_params)
GPy/kern/src/periodic.py
def update_gradients_full(self, dL_dK, X, X2=None): """derivative of the covariance matrix with respect to the parameters (shape is N x num_inducing x num_params)""" if X2 is None: X2 = X FX = self._cos(self.basis_alpha[None,:],self.basis_omega[None,:],self.basis_phi[None,:])(X) FX2 = s...
def update_gradients_full(self, dL_dK, X, X2=None): """derivative of the covariance matrix with respect to the parameters (shape is N x num_inducing x num_params)""" if X2 is None: X2 = X FX = self._cos(self.basis_alpha[None,:],self.basis_omega[None,:],self.basis_phi[None,:])(X) FX2 = s...
[ "derivative", "of", "the", "covariance", "matrix", "with", "respect", "to", "the", "parameters", "(", "shape", "is", "N", "x", "num_inducing", "x", "num_params", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/periodic.py#L103-L167
[ "def", "update_gradients_full", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ")", ":", "if", "X2", "is", "None", ":", "X2", "=", "X", "FX", "=", "self", ".", "_cos", "(", "self", ".", "basis_alpha", "[", "None", ",", ":", "]", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
BayesianGPLVM.set_X_gradients
Set the gradients of the posterior distribution of X in its specific form.
GPy/models/bayesian_gplvm.py
def set_X_gradients(self, X, X_grad): """Set the gradients of the posterior distribution of X in its specific form.""" X.mean.gradient, X.variance.gradient = X_grad
def set_X_gradients(self, X, X_grad): """Set the gradients of the posterior distribution of X in its specific form.""" X.mean.gradient, X.variance.gradient = X_grad
[ "Set", "the", "gradients", "of", "the", "posterior", "distribution", "of", "X", "in", "its", "specific", "form", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/bayesian_gplvm.py#L76-L78
[ "def", "set_X_gradients", "(", "self", ",", "X", ",", "X_grad", ")", ":", "X", ".", "mean", ".", "gradient", ",", "X", ".", "variance", ".", "gradient", "=", "X_grad" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gamma.pdf_link
Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\beta^{\\alpha_{i}}}{\\Gamma(\\alpha_{i})}y_{i}^{\\alpha_{i}-1}e^{-\\beta y_{i}}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: latent variables link(f) :type link_f: Nx1 array :param ...
GPy/likelihoods/gamma.py
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\beta^{\\alpha_{i}}}{\\Gamma(\\alpha_{i})}y_{i}^{\\alpha_{i}-1}e^{-\\beta y_{i}}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: late...
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\beta^{\\alpha_{i}}}{\\Gamma(\\alpha_{i})}y_{i}^{\\alpha_{i}-1}e^{-\\beta y_{i}}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: late...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gamma.py#L30-L50
[ "def", "pdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "assert", "np", ".", "atleast_1d", "(", "link_f", ")", ".", "shape", "==", "np", ".", "atleast_1d", "(", "y", ")", ".", "shape", "#return stats.gamma.pdf...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gamma.logpdf_link
Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: latent variables (link(f)) :type link_f: Nx1 a...
GPy/likelihoods/gamma.py
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} ...
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} ...
[ "Log", "Likelihood", "Function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gamma.py#L52-L73
[ "def", "logpdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "#alpha = self.gp_link.transf(gp)*self.beta", "#return (1. - alpha)*np.log(obs) + self.beta*obs - alpha * np.log(self.beta) + np.log(special.gamma(alpha))", "alpha", "=", "link_f...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gamma.dlogpdf_dlink
Gradient of the log likelihood function at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\beta (\\log \\beta y_{i}) - \\Psi(\\alpha_{i})\\beta\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: latent variables (f) :type li...
GPy/likelihoods/gamma.py
def dlogpdf_dlink(self, link_f, y, Y_metadata=None): """ Gradient of the log likelihood function at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\beta (\\log \\beta y_{i}) - \\Psi(\\alpha_{i})\\beta\\\\ \\alpha_{i} = \...
def dlogpdf_dlink(self, link_f, y, Y_metadata=None): """ Gradient of the log likelihood function at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\beta (\\log \\beta y_{i}) - \\Psi(\\alpha_{i})\\beta\\\\ \\alpha_{i} = \...
[ "Gradient", "of", "the", "log", "likelihood", "function", "at", "y", "given", "link", "(", "f", ")", "w", ".", "r", ".", "t", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gamma.py#L75-L95
[ "def", "dlogpdf_dlink", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "grad", "=", "self", ".", "beta", "*", "np", ".", "log", "(", "self", ".", "beta", "*", "y", ")", "-", "special", ".", "psi", "(", "self", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gamma.d2logpdf_dlink2
Hessian at y, given link(f), w.r.t link(f) i.e. second derivative logpdf at y given link(f_i) and link(f_j) w.r.t link(f_i) and link(f_j) The hessian will be 0 unless i == j .. math:: \\frac{d^{2} \\ln p(y_{i}|\lambda(f_{i}))}{d^{2}\\lambda(f)} = -\\beta^{2}\\frac{d\\Psi(\\alpha_{i...
GPy/likelihoods/gamma.py
def d2logpdf_dlink2(self, link_f, y, Y_metadata=None): """ Hessian at y, given link(f), w.r.t link(f) i.e. second derivative logpdf at y given link(f_i) and link(f_j) w.r.t link(f_i) and link(f_j) The hessian will be 0 unless i == j .. math:: \\frac{d^{2} \\ln p(y_{...
def d2logpdf_dlink2(self, link_f, y, Y_metadata=None): """ Hessian at y, given link(f), w.r.t link(f) i.e. second derivative logpdf at y given link(f_i) and link(f_j) w.r.t link(f_i) and link(f_j) The hessian will be 0 unless i == j .. math:: \\frac{d^{2} \\ln p(y_{...
[ "Hessian", "at", "y", "given", "link", "(", "f", ")", "w", ".", "r", ".", "t", "link", "(", "f", ")", "i", ".", "e", ".", "second", "derivative", "logpdf", "at", "y", "given", "link", "(", "f_i", ")", "and", "link", "(", "f_j", ")", "w", ".",...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gamma.py#L97-L122
[ "def", "d2logpdf_dlink2", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "hess", "=", "-", "special", ".", "polygamma", "(", "1", ",", "self", ".", "beta", "*", "link_f", ")", "*", "(", "self", ".", "beta", "**", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gamma.d3logpdf_dlink3
Third order derivative log-likelihood function at y given link(f) w.r.t link(f) .. math:: \\frac{d^{3} \\ln p(y_{i}|\lambda(f_{i}))}{d^{3}\\lambda(f)} = -\\beta^{3}\\frac{d^{2}\\Psi(\\alpha_{i})}{d\\alpha_{i}}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: latent variables link(...
GPy/likelihoods/gamma.py
def d3logpdf_dlink3(self, link_f, y, Y_metadata=None): """ Third order derivative log-likelihood function at y given link(f) w.r.t link(f) .. math:: \\frac{d^{3} \\ln p(y_{i}|\lambda(f_{i}))}{d^{3}\\lambda(f)} = -\\beta^{3}\\frac{d^{2}\\Psi(\\alpha_{i})}{d\\alpha_{i}}\\\\ ...
def d3logpdf_dlink3(self, link_f, y, Y_metadata=None): """ Third order derivative log-likelihood function at y given link(f) w.r.t link(f) .. math:: \\frac{d^{3} \\ln p(y_{i}|\lambda(f_{i}))}{d^{3}\\lambda(f)} = -\\beta^{3}\\frac{d^{2}\\Psi(\\alpha_{i})}{d\\alpha_{i}}\\\\ ...
[ "Third", "order", "derivative", "log", "-", "likelihood", "function", "at", "y", "given", "link", "(", "f", ")", "w", ".", "r", ".", "t", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gamma.py#L124-L141
[ "def", "d3logpdf_dlink3", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "d3lik_dlink3", "=", "-", "special", ".", "polygamma", "(", "2", ",", "self", ".", "beta", "*", "link_f", ")", "*", "(", "self", ".", "beta", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
InputWarpedGP.parameters_changed
Update the gradients of parameters for warping function This method is called when having new values of parameters for warping function, kernels and other parameters in a normal GP
GPy/models/input_warped_gp.py
def parameters_changed(self): """Update the gradients of parameters for warping function This method is called when having new values of parameters for warping function, kernels and other parameters in a normal GP """ # using the warped X to update self.X = self.transfor...
def parameters_changed(self): """Update the gradients of parameters for warping function This method is called when having new values of parameters for warping function, kernels and other parameters in a normal GP """ # using the warped X to update self.X = self.transfor...
[ "Update", "the", "gradients", "of", "parameters", "for", "warping", "function" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/input_warped_gp.py#L94-L105
[ "def", "parameters_changed", "(", "self", ")", ":", "# using the warped X to update", "self", ".", "X", "=", "self", ".", "transform_data", "(", "self", ".", "X_untransformed", ")", "super", "(", "InputWarpedGP", ",", "self", ")", ".", "parameters_changed", "(",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
InputWarpedGP.transform_data
Apply warping_function to some Input data Parameters ---------- X : array_like, shape = (n_samples, n_features) test_data: bool, optional Default to False, should set to True when transforming test data
GPy/models/input_warped_gp.py
def transform_data(self, X, test_data=False): """Apply warping_function to some Input data Parameters ---------- X : array_like, shape = (n_samples, n_features) test_data: bool, optional Default to False, should set to True when transforming test data """ ...
def transform_data(self, X, test_data=False): """Apply warping_function to some Input data Parameters ---------- X : array_like, shape = (n_samples, n_features) test_data: bool, optional Default to False, should set to True when transforming test data """ ...
[ "Apply", "warping_function", "to", "some", "Input", "data" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/input_warped_gp.py#L107-L117
[ "def", "transform_data", "(", "self", ",", "X", ",", "test_data", "=", "False", ")", ":", "return", "self", ".", "warping_function", ".", "f", "(", "X", ",", "test_data", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
InputWarpedGP.predict
Prediction on the new data Parameters ---------- Xnew : array_like, shape = (n_samples, n_features) The test data. Returns ------- mean : array_like, shape = (n_samples, output.dim) Posterior mean at the location of Xnew var : array_like...
GPy/models/input_warped_gp.py
def predict(self, Xnew): """Prediction on the new data Parameters ---------- Xnew : array_like, shape = (n_samples, n_features) The test data. Returns ------- mean : array_like, shape = (n_samples, output.dim) Posterior mean at the locati...
def predict(self, Xnew): """Prediction on the new data Parameters ---------- Xnew : array_like, shape = (n_samples, n_features) The test data. Returns ------- mean : array_like, shape = (n_samples, output.dim) Posterior mean at the locati...
[ "Prediction", "on", "the", "new", "data" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/input_warped_gp.py#L126-L144
[ "def", "predict", "(", "self", ",", "Xnew", ")", ":", "Xnew_warped", "=", "self", ".", "transform_data", "(", "Xnew", ",", "test_data", "=", "True", ")", "mean", ",", "var", "=", "super", "(", "InputWarpedGP", ",", "self", ")", ".", "predict", "(", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._set_namespace
Set the name space for use when calling eval. This needs to contain all the relvant functions for mapping from symbolic python to the numerical python. It also contains variables, cached portions etc.
GPy/core/symbolic.py
def _set_namespace(self, namespaces): """Set the name space for use when calling eval. This needs to contain all the relvant functions for mapping from symbolic python to the numerical python. It also contains variables, cached portions etc.""" self.namespace = {} for m in namespaces[::-1]: ...
def _set_namespace(self, namespaces): """Set the name space for use when calling eval. This needs to contain all the relvant functions for mapping from symbolic python to the numerical python. It also contains variables, cached portions etc.""" self.namespace = {} for m in namespaces[::-1]: ...
[ "Set", "the", "name", "space", "for", "use", "when", "calling", "eval", ".", "This", "needs", "to", "contain", "all", "the", "relvant", "functions", "for", "mapping", "from", "symbolic", "python", "to", "the", "numerical", "python", ".", "It", "also", "con...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L60-L66
[ "def", "_set_namespace", "(", "self", ",", "namespaces", ")", ":", "self", ".", "namespace", "=", "{", "}", "for", "m", "in", "namespaces", "[", ":", ":", "-", "1", "]", ":", "buf", "=", "_get_namespace", "(", "m", ")", "self", ".", "namespace", "....
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._set_expressions
Extract expressions and variables from the user provided expressions.
GPy/core/symbolic.py
def _set_expressions(self, expressions): """Extract expressions and variables from the user provided expressions.""" self.expressions = {} for key, item in expressions.items(): self.expressions[key] = {'function': item}
def _set_expressions(self, expressions): """Extract expressions and variables from the user provided expressions.""" self.expressions = {} for key, item in expressions.items(): self.expressions[key] = {'function': item}
[ "Extract", "expressions", "and", "variables", "from", "the", "user", "provided", "expressions", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L68-L72
[ "def", "_set_expressions", "(", "self", ",", "expressions", ")", ":", "self", ".", "expressions", "=", "{", "}", "for", "key", ",", "item", "in", "expressions", ".", "items", "(", ")", ":", "self", ".", "expressions", "[", "key", "]", "=", "{", "'fun...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._set_variables
Pull the variable names out of the provided expressions and separate into cacheable expressions and normal parameters. Those that are only stored in the cache, the parameters are stored in this object.
GPy/core/symbolic.py
def _set_variables(self, cacheable): """Pull the variable names out of the provided expressions and separate into cacheable expressions and normal parameters. Those that are only stored in the cache, the parameters are stored in this object.""" # pull the parameters and inputs out of the symbolic pdf ...
def _set_variables(self, cacheable): """Pull the variable names out of the provided expressions and separate into cacheable expressions and normal parameters. Those that are only stored in the cache, the parameters are stored in this object.""" # pull the parameters and inputs out of the symbolic pdf ...
[ "Pull", "the", "variable", "names", "out", "of", "the", "provided", "expressions", "and", "separate", "into", "cacheable", "expressions", "and", "normal", "parameters", ".", "Those", "that", "are", "only", "stored", "in", "the", "cache", "the", "parameters", "...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L74-L97
[ "def", "_set_variables", "(", "self", ",", "cacheable", ")", ":", "# pull the parameters and inputs out of the symbolic pdf", "def", "extract_vars", "(", "expr", ")", ":", "return", "[", "e", "for", "e", "in", "expr", ".", "atoms", "(", ")", "if", "e", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._set_parameters
Add parameters to the model and initialize with given values.
GPy/core/symbolic.py
def _set_parameters(self, parameters): """Add parameters to the model and initialize with given values.""" for theta in self.variables['theta']: val = 1.0 # TODO: improve approach for initializing parameters. if parameters is not None: if theta.name in...
def _set_parameters(self, parameters): """Add parameters to the model and initialize with given values.""" for theta in self.variables['theta']: val = 1.0 # TODO: improve approach for initializing parameters. if parameters is not None: if theta.name in...
[ "Add", "parameters", "to", "the", "model", "and", "initialize", "with", "given", "values", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L120-L130
[ "def", "_set_parameters", "(", "self", ",", "parameters", ")", ":", "for", "theta", "in", "self", ".", "variables", "[", "'theta'", "]", ":", "val", "=", "1.0", "# TODO: improve approach for initializing parameters.", "if", "parameters", "is", "not", "None", ":"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._set_attribute
Make sure namespace gets updated when setting attributes.
GPy/core/symbolic.py
def _set_attribute(self, name, value): """Make sure namespace gets updated when setting attributes.""" setattr(self, name, value) self.namespace.update({name: getattr(self, name)})
def _set_attribute(self, name, value): """Make sure namespace gets updated when setting attributes.""" setattr(self, name, value) self.namespace.update({name: getattr(self, name)})
[ "Make", "sure", "namespace", "gets", "updated", "when", "setting", "attributes", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L249-L252
[ "def", "_set_attribute", "(", "self", ",", "name", ",", "value", ")", ":", "setattr", "(", "self", ",", "name", ",", "value", ")", "self", ".", "namespace", ".", "update", "(", "{", "name", ":", "getattr", "(", "self", ",", "name", ")", "}", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core.update_expression_list
Extract a list of expressions from the dictionary of expressions.
GPy/core/symbolic.py
def update_expression_list(self): """Extract a list of expressions from the dictionary of expressions.""" self.expression_list = [] # code arrives in dictionary, but is passed in this list self.expression_keys = [] # Keep track of the dictionary keys. self.expression_order = [] # This ma...
def update_expression_list(self): """Extract a list of expressions from the dictionary of expressions.""" self.expression_list = [] # code arrives in dictionary, but is passed in this list self.expression_keys = [] # Keep track of the dictionary keys. self.expression_order = [] # This ma...
[ "Extract", "a", "list", "of", "expressions", "from", "the", "dictionary", "of", "expressions", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L255-L283
[ "def", "update_expression_list", "(", "self", ")", ":", "self", ".", "expression_list", "=", "[", "]", "# code arrives in dictionary, but is passed in this list", "self", ".", "expression_keys", "=", "[", "]", "# Keep track of the dictionary keys.", "self", ".", "expressi...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._gen_code
Generate code for the list of expressions provided using the common sub-expression eliminator to separate out portions that are computed multiple times.
GPy/core/symbolic.py
def _gen_code(self): """Generate code for the list of expressions provided using the common sub-expression eliminator to separate out portions that are computed multiple times.""" # This is the dictionary that stores all the generated code. self.code = {} def match_key(expr): ...
def _gen_code(self): """Generate code for the list of expressions provided using the common sub-expression eliminator to separate out portions that are computed multiple times.""" # This is the dictionary that stores all the generated code. self.code = {} def match_key(expr): ...
[ "Generate", "code", "for", "the", "list", "of", "expressions", "provided", "using", "the", "common", "sub", "-", "expression", "eliminator", "to", "separate", "out", "portions", "that", "are", "computed", "multiple", "times", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L344-L359
[ "def", "_gen_code", "(", "self", ")", ":", "# This is the dictionary that stores all the generated code.", "self", ".", "code", "=", "{", "}", "def", "match_key", "(", "expr", ")", ":", "if", "type", "(", "expr", ")", "is", "dict", ":", "code", "=", "{", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._expr2code
Convert the given symbolic expression into code.
GPy/core/symbolic.py
def _expr2code(self, arg_list, expr): """Convert the given symbolic expression into code.""" code = lambdastr(arg_list, expr) function_code = code.split(':')[1].strip() #for arg in arg_list: # function_code = function_code.replace(arg.name, 'self.'+arg.name) return fu...
def _expr2code(self, arg_list, expr): """Convert the given symbolic expression into code.""" code = lambdastr(arg_list, expr) function_code = code.split(':')[1].strip() #for arg in arg_list: # function_code = function_code.replace(arg.name, 'self.'+arg.name) return fu...
[ "Convert", "the", "given", "symbolic", "expression", "into", "code", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L362-L369
[ "def", "_expr2code", "(", "self", ",", "arg_list", ",", "expr", ")", ":", "code", "=", "lambdastr", "(", "arg_list", ",", "expr", ")", "function_code", "=", "code", ".", "split", "(", "':'", ")", "[", "1", "]", ".", "strip", "(", ")", "#for arg in ar...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._print_code
Prepare code for string writing.
GPy/core/symbolic.py
def _print_code(self, code): """Prepare code for string writing.""" # This needs a rewrite --- it doesn't check for match clashes! So sub11 would be replaced by sub1 before being replaced with sub11!! for key in self.variables.keys(): for arg in self.variables[key]: c...
def _print_code(self, code): """Prepare code for string writing.""" # This needs a rewrite --- it doesn't check for match clashes! So sub11 would be replaced by sub1 before being replaced with sub11!! for key in self.variables.keys(): for arg in self.variables[key]: c...
[ "Prepare", "code", "for", "string", "writing", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L371-L377
[ "def", "_print_code", "(", "self", ",", "code", ")", ":", "# This needs a rewrite --- it doesn't check for match clashes! So sub11 would be replaced by sub1 before being replaced with sub11!!", "for", "key", "in", "self", ".", "variables", ".", "keys", "(", ")", ":", "for", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Symbolic_core._display_expression
Helper function for human friendly display of the symbolic components.
GPy/core/symbolic.py
def _display_expression(self, keys, user_substitutes={}): """Helper function for human friendly display of the symbolic components.""" # Create some pretty maths symbols for the display. sigma, alpha, nu, omega, l, variance = sym.var('\sigma, \alpha, \nu, \omega, \ell, \sigma^2') substit...
def _display_expression(self, keys, user_substitutes={}): """Helper function for human friendly display of the symbolic components.""" # Create some pretty maths symbols for the display. sigma, alpha, nu, omega, l, variance = sym.var('\sigma, \alpha, \nu, \omega, \ell, \sigma^2') substit...
[ "Helper", "function", "for", "human", "friendly", "display", "of", "the", "symbolic", "components", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/symbolic.py#L379-L410
[ "def", "_display_expression", "(", "self", ",", "keys", ",", "user_substitutes", "=", "{", "}", ")", ":", "# Create some pretty maths symbols for the display.", "sigma", ",", "alpha", ",", "nu", ",", "omega", ",", "l", ",", "variance", "=", "sym", ".", "var", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
BayesianGPLVMMiniBatch._outer_values_update
Here you put the values, which were collected before in the right places. E.g. set the gradients of parameters, etc.
GPy/models/bayesian_gplvm_minibatch.py
def _outer_values_update(self, full_values): """ Here you put the values, which were collected before in the right places. E.g. set the gradients of parameters, etc. """ super(BayesianGPLVMMiniBatch, self)._outer_values_update(full_values) if self.has_uncertain_inputs(): ...
def _outer_values_update(self, full_values): """ Here you put the values, which were collected before in the right places. E.g. set the gradients of parameters, etc. """ super(BayesianGPLVMMiniBatch, self)._outer_values_update(full_values) if self.has_uncertain_inputs(): ...
[ "Here", "you", "put", "the", "values", "which", "were", "collected", "before", "in", "the", "right", "places", ".", "E", ".", "g", ".", "set", "the", "gradients", "of", "parameters", "etc", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/bayesian_gplvm_minibatch.py#L83-L101
[ "def", "_outer_values_update", "(", "self", ",", "full_values", ")", ":", "super", "(", "BayesianGPLVMMiniBatch", ",", "self", ")", ".", "_outer_values_update", "(", "full_values", ")", "if", "self", ".", "has_uncertain_inputs", "(", ")", ":", "meangrad_tmp", ",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_t.K
Compute the covariance matrix between X and X2.
GPy/kern/src/ODE_t.py
def K(self, X, X2=None): """Compute the covariance matrix between X and X2.""" X,slices = X[:,:-1],index_to_slices(X[:,-1]) if X2 is None: X2,slices2 = X,slices K = np.zeros((X.shape[0], X.shape[0])) ...
def K(self, X, X2=None): """Compute the covariance matrix between X and X2.""" X,slices = X[:,:-1],index_to_slices(X[:,-1]) if X2 is None: X2,slices2 = X,slices K = np.zeros((X.shape[0], X.shape[0])) ...
[ "Compute", "the", "covariance", "matrix", "between", "X", "and", "X2", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/ODE_t.py#L22-L63
[ "def", "K", "(", "self", ",", "X", ",", "X2", "=", "None", ")", ":", "X", ",", "slices", "=", "X", "[", ":", ",", ":", "-", "1", "]", ",", "index_to_slices", "(", "X", "[", ":", ",", "-", "1", "]", ")", "if", "X2", "is", "None", ":", "X...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_t.update_gradients_full
derivative of the covariance matrix with respect to the parameters.
GPy/kern/src/ODE_t.py
def update_gradients_full(self, dL_dK, X, X2=None): """derivative of the covariance matrix with respect to the parameters.""" X,slices = X[:,:-1],index_to_slices(X[:,-1]) if X2 is None: X2,slices2 = X,slices K = np.zeros((X.shape[0]...
def update_gradients_full(self, dL_dK, X, X2=None): """derivative of the covariance matrix with respect to the parameters.""" X,slices = X[:,:-1],index_to_slices(X[:,-1]) if X2 is None: X2,slices2 = X,slices K = np.zeros((X.shape[0]...
[ "derivative", "of", "the", "covariance", "matrix", "with", "respect", "to", "the", "parameters", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/ODE_t.py#L92-L165
[ "def", "update_gradients_full", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ")", ":", "X", ",", "slices", "=", "X", "[", ":", ",", ":", "-", "1", "]", ",", "index_to_slices", "(", "X", "[", ":", ",", "-", "1", "]", ")", "if",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._dK_ode_dtheta
Do all the computations for the ode parts of the covariance function.
GPy/kern/src/todo/eq_ode1.py
def _dK_ode_dtheta(self, target): """Do all the computations for the ode parts of the covariance function.""" t_ode = self._t[self._index>0] dL_dK_ode = self._dL_dK[self._index>0, :] index_ode = self._index[self._index>0]-1 if self._t2 is None: if t_ode.size==0: ...
def _dK_ode_dtheta(self, target): """Do all the computations for the ode parts of the covariance function.""" t_ode = self._t[self._index>0] dL_dK_ode = self._dL_dK[self._index>0, :] index_ode = self._index[self._index>0]-1 if self._t2 is None: if t_ode.size==0: ...
[ "Do", "all", "the", "computations", "for", "the", "ode", "parts", "of", "the", "covariance", "function", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L134-L184
[ "def", "_dK_ode_dtheta", "(", "self", ",", "target", ")", ":", "t_ode", "=", "self", ".", "_t", "[", "self", ".", "_index", ">", "0", "]", "dL_dK_ode", "=", "self", ".", "_dL_dK", "[", "self", ".", "_index", ">", "0", ",", ":", "]", "index_ode", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._extract_t_indices
Extract times and output indices from the input matrix X. Times are ordered according to their index for convenience of computation, this ordering is stored in self._order and self.order2. These orderings are then mapped back to the original ordering (in X) using self._rorder and self._rorder2.
GPy/kern/src/todo/eq_ode1.py
def _extract_t_indices(self, X, X2=None, dL_dK=None): """Extract times and output indices from the input matrix X. Times are ordered according to their index for convenience of computation, this ordering is stored in self._order and self.order2. These orderings are then mapped back to the original ordering (in ...
def _extract_t_indices(self, X, X2=None, dL_dK=None): """Extract times and output indices from the input matrix X. Times are ordered according to their index for convenience of computation, this ordering is stored in self._order and self.order2. These orderings are then mapped back to the original ordering (in ...
[ "Extract", "times", "and", "output", "indices", "from", "the", "input", "matrix", "X", ".", "Times", "are", "ordered", "according", "to", "their", "index", "for", "convenience", "of", "computation", "this", "ordering", "is", "stored", "in", "self", ".", "_or...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L199-L231
[ "def", "_extract_t_indices", "(", "self", ",", "X", ",", "X2", "=", "None", ",", "dL_dK", "=", "None", ")", ":", "# TODO: some fast checking here to see if this needs recomputing?", "self", ".", "_t", "=", "X", "[", ":", ",", "0", "]", "if", "not", "X", "....
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._K_computations
Perform main body of computations for the ode1 covariance function.
GPy/kern/src/todo/eq_ode1.py
def _K_computations(self, X, X2): """Perform main body of computations for the ode1 covariance function.""" # First extract times and indices. self._extract_t_indices(X, X2) self._K_compute_eq() self._K_compute_ode_eq() if X2 is None: self._K_eq_ode = self._K...
def _K_computations(self, X, X2): """Perform main body of computations for the ode1 covariance function.""" # First extract times and indices. self._extract_t_indices(X, X2) self._K_compute_eq() self._K_compute_ode_eq() if X2 is None: self._K_eq_ode = self._K...
[ "Perform", "main", "body", "of", "computations", "for", "the", "ode1", "covariance", "function", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L233-L288
[ "def", "_K_computations", "(", "self", ",", "X", ",", "X2", ")", ":", "# First extract times and indices.", "self", ".", "_extract_t_indices", "(", "X", ",", "X2", ")", "self", ".", "_K_compute_eq", "(", ")", "self", ".", "_K_compute_ode_eq", "(", ")", "if",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._K_compute_eq
Compute covariance for latent covariance.
GPy/kern/src/todo/eq_ode1.py
def _K_compute_eq(self): """Compute covariance for latent covariance.""" t_eq = self._t[self._index==0] if self._t2 is None: if t_eq.size==0: self._K_eq = np.zeros((0, 0)) return self._dist2 = np.square(t_eq[:, None] - t_eq[None, :]) ...
def _K_compute_eq(self): """Compute covariance for latent covariance.""" t_eq = self._t[self._index==0] if self._t2 is None: if t_eq.size==0: self._K_eq = np.zeros((0, 0)) return self._dist2 = np.square(t_eq[:, None] - t_eq[None, :]) ...
[ "Compute", "covariance", "for", "latent", "covariance", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L292-L309
[ "def", "_K_compute_eq", "(", "self", ")", ":", "t_eq", "=", "self", ".", "_t", "[", "self", ".", "_index", "==", "0", "]", "if", "self", ".", "_t2", "is", "None", ":", "if", "t_eq", ".", "size", "==", "0", ":", "self", ".", "_K_eq", "=", "np", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._K_compute_ode_eq
Compute the cross covariances between latent exponentiated quadratic and observed ordinary differential equations. :param transpose: if set to false the exponentiated quadratic is on the rows of the matrix and is computed according to self._t, if set to true it is on the columns and is computed according to se...
GPy/kern/src/todo/eq_ode1.py
def _K_compute_ode_eq(self, transpose=False): """Compute the cross covariances between latent exponentiated quadratic and observed ordinary differential equations. :param transpose: if set to false the exponentiated quadratic is on the rows of the matrix and is computed according to self._t, if set to ...
def _K_compute_ode_eq(self, transpose=False): """Compute the cross covariances between latent exponentiated quadratic and observed ordinary differential equations. :param transpose: if set to false the exponentiated quadratic is on the rows of the matrix and is computed according to self._t, if set to ...
[ "Compute", "the", "cross", "covariances", "between", "latent", "exponentiated", "quadratic", "and", "observed", "ordinary", "differential", "equations", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L311-L363
[ "def", "_K_compute_ode_eq", "(", "self", ",", "transpose", "=", "False", ")", ":", "if", "self", ".", "_t2", "is", "not", "None", ":", "if", "transpose", ":", "t_eq", "=", "self", ".", "_t", "[", "self", ".", "_index", "==", "0", "]", "t_ode", "=",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Eq_ode1._compute_H
Helper function for computing part of the ode1 covariance function. :param t: first time input. :type t: array :param index: Indices of first output. :type index: array of int :param t2: second time input. :type t2: array :param index2: Indices of second output. ...
GPy/kern/src/todo/eq_ode1.py
def _compute_H(self, t, index, t2, index2, update_derivatives=False, stationary=False): """Helper function for computing part of the ode1 covariance function. :param t: first time input. :type t: array :param index: Indices of first output. :type index: array of int :par...
def _compute_H(self, t, index, t2, index2, update_derivatives=False, stationary=False): """Helper function for computing part of the ode1 covariance function. :param t: first time input. :type t: array :param index: Indices of first output. :type index: array of int :par...
[ "Helper", "function", "for", "computing", "part", "of", "the", "ode1", "covariance", "function", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/eq_ode1.py#L461-L556
[ "def", "_compute_H", "(", "self", ",", "t", ",", "index", ",", "t2", ",", "index2", ",", "update_derivatives", "=", "False", ",", "stationary", "=", "False", ")", ":", "if", "stationary", ":", "raise", "NotImplementedError", ",", "\"Error, stationary version o...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Mapping.from_dict
Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dict of the derived class. Note: This method should n...
GPy/core/mapping.py
def from_dict(input_dict): """ Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dict of the de...
def from_dict(input_dict): """ Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dict of the de...
[ "Instantiate", "an", "object", "of", "a", "derived", "class", "using", "the", "information", "in", "input_dict", "(", "built", "by", "the", "to_dict", "method", "of", "the", "derived", "class", ")", ".", "More", "specifically", "after", "reading", "the", "de...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/mapping.py#L39-L57
[ "def", "from_dict", "(", "input_dict", ")", ":", "import", "copy", "input_dict", "=", "copy", ".", "deepcopy", "(", "input_dict", ")", "mapping_class", "=", "input_dict", ".", "pop", "(", "'class'", ")", "input_dict", "[", "\"name\"", "]", "=", "str", "(",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
VarDTC_SVI_Multiout_Miss.inference
The SVI-VarDTC inference
GPy/inference/latent_function_inference/vardtc_svi_multiout_miss.py
def inference(self, kern_r, kern_c, Xr, Xc, Zr, Zc, likelihood, Y, qU_mean ,qU_var_r, qU_var_c, indexD, output_dim): """ The SVI-VarDTC inference """ N, D, Mr, Mc, Qr, Qc = Y.shape[0], output_dim,Zr.shape[0], Zc.shape[0], Zr.shape[1], Zc.shape[1] uncertain_inputs_r = isinstance...
def inference(self, kern_r, kern_c, Xr, Xc, Zr, Zc, likelihood, Y, qU_mean ,qU_var_r, qU_var_c, indexD, output_dim): """ The SVI-VarDTC inference """ N, D, Mr, Mc, Qr, Qc = Y.shape[0], output_dim,Zr.shape[0], Zc.shape[0], Zr.shape[1], Zc.shape[1] uncertain_inputs_r = isinstance...
[ "The", "SVI", "-", "VarDTC", "inference" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/inference/latent_function_inference/vardtc_svi_multiout_miss.py#L184-L309
[ "def", "inference", "(", "self", ",", "kern_r", ",", "kern_c", ",", "Xr", ",", "Xc", ",", "Zr", ",", "Zc", ",", "likelihood", ",", "Y", ",", "qU_mean", ",", "qU_var_r", ",", "qU_var_c", ",", "indexD", ",", "output_dim", ")", ":", "N", ",", "D", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
common_subarrays
Find common subarrays of 2 dimensional X, where axis is the axis to apply the search over. Common subarrays are returned as a dictionary of <subarray, [index]> pairs, where the subarray is a tuple representing the subarray and the index is the index for the subarray in X, where index is the index to the rem...
GPy/util/subarray_and_sorting.py
def common_subarrays(X, axis=0): """ Find common subarrays of 2 dimensional X, where axis is the axis to apply the search over. Common subarrays are returned as a dictionary of <subarray, [index]> pairs, where the subarray is a tuple representing the subarray and the index is the index for the subar...
def common_subarrays(X, axis=0): """ Find common subarrays of 2 dimensional X, where axis is the axis to apply the search over. Common subarrays are returned as a dictionary of <subarray, [index]> pairs, where the subarray is a tuple representing the subarray and the index is the index for the subar...
[ "Find", "common", "subarrays", "of", "2", "dimensional", "X", "where", "axis", "is", "the", "axis", "to", "apply", "the", "search", "over", ".", "Common", "subarrays", "are", "returned", "as", "a", "dictionary", "of", "<subarray", "[", "index", "]", ">", ...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/subarray_and_sorting.py#L11-L58
[ "def", "common_subarrays", "(", "X", ",", "axis", "=", "0", ")", ":", "from", "collections", "import", "defaultdict", "from", "itertools", "import", "count", "from", "operator", "import", "iadd", "assert", "X", ".", "ndim", "==", "2", "and", "axis", "in", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MRD.predict
Prediction for data set Yindex[default=0]. This predicts the output mean and variance for the dataset given in Ylist[Yindex]
GPy/models/mrd.py
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None, Yindex=0): """ Prediction for data set Yindex[default=0]. This predicts the output mean and variance for the dataset given in Ylist[Yindex] """ b = self.bgplvms[Yindex] self.posterior = b.posterior ...
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None, Yindex=0): """ Prediction for data set Yindex[default=0]. This predicts the output mean and variance for the dataset given in Ylist[Yindex] """ b = self.bgplvms[Yindex] self.posterior = b.posterior ...
[ "Prediction", "for", "data", "set", "Yindex", "[", "default", "=", "0", "]", ".", "This", "predicts", "the", "output", "mean", "and", "variance", "for", "the", "dataset", "given", "in", "Ylist", "[", "Yindex", "]" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/mrd.py#L218-L227
[ "def", "predict", "(", "self", ",", "Xnew", ",", "full_cov", "=", "False", ",", "Y_metadata", "=", "None", ",", "kern", "=", "None", ",", "Yindex", "=", "0", ")", ":", "b", "=", "self", ".", "bgplvms", "[", "Yindex", "]", "self", ".", "posterior", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MRD.plot_scales
Plot input sensitivity for all datasets, to see which input dimensions are significant for which dataset. :param titles: titles for axes of datasets kwargs go into plot_ARD for each kernel.
GPy/models/mrd.py
def plot_scales(self, titles=None, fig_kwargs={}, **kwargs): """ Plot input sensitivity for all datasets, to see which input dimensions are significant for which dataset. :param titles: titles for axes of datasets kwargs go into plot_ARD for each kernel. """ fro...
def plot_scales(self, titles=None, fig_kwargs={}, **kwargs): """ Plot input sensitivity for all datasets, to see which input dimensions are significant for which dataset. :param titles: titles for axes of datasets kwargs go into plot_ARD for each kernel. """ fro...
[ "Plot", "input", "sensitivity", "for", "all", "datasets", "to", "see", "which", "input", "dimensions", "are", "significant", "for", "which", "dataset", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/mrd.py#L239-L257
[ "def", "plot_scales", "(", "self", ",", "titles", "=", "None", ",", "fig_kwargs", "=", "{", "}", ",", "*", "*", "kwargs", ")", ":", "from", ".", ".", "plotting", "import", "plotting_library", "as", "pl", "if", "titles", "is", "None", ":", "titles", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MRD.plot_latent
see plotting.matplot_dep.dim_reduction_plots.plot_latent if predict_kwargs is None, will plot latent spaces for 0th dataset (and kernel), otherwise give predict_kwargs=dict(Yindex='index') for plotting only the latent space of dataset with 'index'.
GPy/models/mrd.py
def plot_latent(self, labels=None, which_indices=None, resolution=60, legend=True, plot_limits=None, updates=False, kern=None, marker='<>^vsd', num_samples=1000, projection='2d', predict_kwargs={}, scatter_kw...
def plot_latent(self, labels=None, which_indices=None, resolution=60, legend=True, plot_limits=None, updates=False, kern=None, marker='<>^vsd', num_samples=1000, projection='2d', predict_kwargs={}, scatter_kw...
[ "see", "plotting", ".", "matplot_dep", ".", "dim_reduction_plots", ".", "plot_latent", "if", "predict_kwargs", "is", "None", "will", "plot", "latent", "spaces", "for", "0th", "dataset", "(", "and", "kernel", ")", "otherwise", "give", "predict_kwargs", "=", "dict...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/mrd.py#L259-L282
[ "def", "plot_latent", "(", "self", ",", "labels", "=", "None", ",", "which_indices", "=", "None", ",", "resolution", "=", "60", ",", "legend", "=", "True", ",", "plot_limits", "=", "None", ",", "updates", "=", "False", ",", "kern", "=", "None", ",", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MRD.factorize_space
Given a trained MRD model, this function looks at the optimized ARD weights (lengthscales) and decides which part of the latent space is shared across views or private, according to a threshold. The threshold is applied after all weights are normalized so that the maximum value is 1.
GPy/models/mrd.py
def factorize_space(self, threshold=0.005, printOut=False, views=None): """ Given a trained MRD model, this function looks at the optimized ARD weights (lengthscales) and decides which part of the latent space is shared across views or private, according to a threshold. The threshold is ...
def factorize_space(self, threshold=0.005, printOut=False, views=None): """ Given a trained MRD model, this function looks at the optimized ARD weights (lengthscales) and decides which part of the latent space is shared across views or private, according to a threshold. The threshold is ...
[ "Given", "a", "trained", "MRD", "model", "this", "function", "looks", "at", "the", "optimized", "ARD", "weights", "(", "lengthscales", ")", "and", "decides", "which", "part", "of", "the", "latent", "space", "is", "shared", "across", "views", "or", "private",...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/mrd.py#L299-L352
[ "def", "factorize_space", "(", "self", ",", "threshold", "=", "0.005", ",", "printOut", "=", "False", ",", "views", "=", "None", ")", ":", "M", "=", "len", "(", "self", ".", "bgplvms", ")", "if", "views", "is", "None", ":", "# There are some small modifi...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot_mean
Plot the mean of the GP. You can deactivate the legend for this one plot by supplying None to label. Give the Y_metadata in the predict_kw if you need it. :param plot_limits: The limits of the plot. If 1D [xmin,xmax], if 2D [[xmin,ymin],[xmax,ymax]]. Defaluts to data limits :type plot_limits: np.ar...
GPy/plotting/gpy_plot/gp_plots.py
def plot_mean(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', levels=20, projection='2d', label='gp mean', predict_kw=None, **kwargs)...
def plot_mean(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', levels=20, projection='2d', label='gp mean', predict_kw=None, **kwargs)...
[ "Plot", "the", "mean", "of", "the", "GP", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L38-L77
[ "def", "plot_mean", "(", "self", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "plot_raw", "=", "False", ",", "apply_link", "=", "False", ",", "visible_dims", "=", "None", ",", "which_data_ycols", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot_confidence
Plot the confidence interval between the percentiles lower and upper. E.g. the 95% confidence interval is $2.5, 97.5$. Note: Only implemented for one dimension! You can deactivate the legend for this one plot by supplying None to label. Give the Y_metadata in the predict_kw if you need it. :para...
GPy/plotting/gpy_plot/gp_plots.py
def plot_confidence(self, lower=2.5, upper=97.5, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', label='gp confidence', predict_kw=None, **kwargs): """ Plot th...
def plot_confidence(self, lower=2.5, upper=97.5, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', label='gp confidence', predict_kw=None, **kwargs): """ Plot th...
[ "Plot", "the", "confidence", "interval", "between", "the", "percentiles", "lower", "and", "upper", ".", "E", ".", "g", ".", "the", "95%", "confidence", "interval", "is", "$2", ".", "5", "97", ".", "5$", ".", "Note", ":", "Only", "implemented", "for", "...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L108-L145
[ "def", "plot_confidence", "(", "self", ",", "lower", "=", "2.5", ",", "upper", "=", "97.5", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "plot_raw", "=", "False", ",", "apply_link", "=", "False",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot_samples
Plot the mean of the GP. You can deactivate the legend for this one plot by supplying None to label. Give the Y_metadata in the predict_kw if you need it. :param plot_limits: The limits of the plot. If 1D [xmin,xmax], if 2D [[xmin,ymin],[xmax,ymax]]. Defaluts to data limits :type plot_limits: np.ar...
GPy/plotting/gpy_plot/gp_plots.py
def plot_samples(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=True, apply_link=False, visible_dims=None, which_data_ycols='all', samples=3, projection='2d', label='gp_samples', predict_kw=None, **kwargs): """...
def plot_samples(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=True, apply_link=False, visible_dims=None, which_data_ycols='all', samples=3, projection='2d', label='gp_samples', predict_kw=None, **kwargs): """...
[ "Plot", "the", "mean", "of", "the", "GP", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L163-L200
[ "def", "plot_samples", "(", "self", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "plot_raw", "=", "True", ",", "apply_link", "=", "False", ",", "visible_dims", "=", "None", ",", "which_data_ycols", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot_density
Plot the confidence interval between the percentiles lower and upper. E.g. the 95% confidence interval is $2.5, 97.5$. Note: Only implemented for one dimension! You can deactivate the legend for this one plot by supplying None to label. Give the Y_metadata in the predict_kw if you need it. :param...
GPy/plotting/gpy_plot/gp_plots.py
def plot_density(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', levels=35, label='gp density', predict_kw=None, **kwargs): """ Plot the co...
def plot_density(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, visible_dims=None, which_data_ycols='all', levels=35, label='gp density', predict_kw=None, **kwargs): """ Plot the co...
[ "Plot", "the", "confidence", "interval", "between", "the", "percentiles", "lower", "and", "upper", ".", "E", ".", "g", ".", "the", "95%", "confidence", "interval", "is", "$2", ".", "5", "97", ".", "5$", ".", "Note", ":", "Only", "implemented", "for", "...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L222-L258
[ "def", "plot_density", "(", "self", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "plot_raw", "=", "False", ",", "apply_link", "=", "False", ",", "visible_dims", "=", "None", ",", "which_data_ycols", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot
Convenience function for plotting the fit of a GP. You can deactivate the legend for this one plot by supplying None to label. Give the Y_metadata in the predict_kw if you need it. If you want fine graned control use the specific plotting functions supplied in the model. :param plot_limits: The lim...
GPy/plotting/gpy_plot/gp_plots.py
def plot(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, which_data_ycols='all', which_data_rows='all', visible_dims=None, levels=20, samples=0, samples_likelihood=0, lower=2.5, upper=97.5, ...
def plot(self, plot_limits=None, fixed_inputs=None, resolution=None, plot_raw=False, apply_link=False, which_data_ycols='all', which_data_rows='all', visible_dims=None, levels=20, samples=0, samples_likelihood=0, lower=2.5, upper=97.5, ...
[ "Convenience", "function", "for", "plotting", "the", "fit", "of", "a", "GP", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L281-L354
[ "def", "plot", "(", "self", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "plot_raw", "=", "False", ",", "apply_link", "=", "False", ",", "which_data_ycols", "=", "'all'", ",", "which_data_rows", "=...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
plot_f
Convinience function for plotting the fit of a GP. This is the same as plot, except it plots the latent function fit of the GP! If you want fine graned control use the specific plotting functions supplied in the model. You can deactivate the legend for this one plot by supplying None to label. Give t...
GPy/plotting/gpy_plot/gp_plots.py
def plot_f(self, plot_limits=None, fixed_inputs=None, resolution=None, apply_link=False, which_data_ycols='all', which_data_rows='all', visible_dims=None, levels=20, samples=0, lower=2.5, upper=97.5, plot_density=False, pl...
def plot_f(self, plot_limits=None, fixed_inputs=None, resolution=None, apply_link=False, which_data_ycols='all', which_data_rows='all', visible_dims=None, levels=20, samples=0, lower=2.5, upper=97.5, plot_density=False, pl...
[ "Convinience", "function", "for", "plotting", "the", "fit", "of", "a", "GP", ".", "This", "is", "the", "same", "as", "plot", "except", "it", "plots", "the", "latent", "function", "fit", "of", "the", "GP!" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/gpy_plot/gp_plots.py#L357-L405
[ "def", "plot_f", "(", "self", ",", "plot_limits", "=", "None", ",", "fixed_inputs", "=", "None", ",", "resolution", "=", "None", ",", "apply_link", "=", "False", ",", "which_data_ycols", "=", "'all'", ",", "which_data_rows", "=", "'all'", ",", "visible_dims"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Model.from_dict
Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dict of the derived class. Note: This method should n...
GPy/core/model.py
def from_dict(input_dict, data=None): """ Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dic...
def from_dict(input_dict, data=None): """ Instantiate an object of a derived class using the information in input_dict (built by the to_dict method of the derived class). More specifically, after reading the derived class from input_dict, it calls the method _build_from_input_dic...
[ "Instantiate", "an", "object", "of", "a", "derived", "class", "using", "the", "information", "in", "input_dict", "(", "built", "by", "the", "to_dict", "method", "of", "the", "derived", "class", ")", ".", "More", "specifically", "after", "reading", "the", "de...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/model.py#L23-L41
[ "def", "from_dict", "(", "input_dict", ",", "data", "=", "None", ")", ":", "import", "copy", "input_dict", "=", "copy", ".", "deepcopy", "(", "input_dict", ")", "model_class", "=", "input_dict", ".", "pop", "(", "'class'", ")", "input_dict", "[", "\"name\"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Linear.to_dict
Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object
GPy/mappings/linear.py
def to_dict(self): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object """ input_dict = su...
def to_dict(self): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object """ input_dict = su...
[ "Convert", "the", "object", "into", "a", "json", "serializable", "dictionary", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/mappings/linear.py#L41-L53
[ "def", "to_dict", "(", "self", ")", ":", "input_dict", "=", "super", "(", "Linear", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.mappings.Linear\"", "input_dict", "[", "\"A\"", "]", "=", "self", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ICM
Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize kernel (matrix B). :type kernel: a GPy kernel :param W_rank: number tu...
GPy/util/multioutput.py
def ICM(input_dim, num_outputs, kernel, W_rank=1,W=None,kappa=None,name='ICM'): """ Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the ...
def ICM(input_dim, num_outputs, kernel, W_rank=1,W=None,kappa=None,name='ICM'): """ Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the ...
[ "Builds", "a", "kernel", "for", "an", "Intrinsic", "Coregionalization", "Model" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/multioutput.py#L43-L59
[ "def", "ICM", "(", "input_dim", ",", "num_outputs", ",", "kernel", ",", "W_rank", "=", "1", ",", "W", "=", "None", ",", "kappa", "=", "None", ",", "name", "=", "'ICM'", ")", ":", "if", "kernel", ".", "input_dim", "!=", "input_dim", ":", "kernel", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
LCM
Builds a kernel for an Linear Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize kernel (matrix B). :type kernel: a GPy kernel :param W_rank: number tuple...
GPy/util/multioutput.py
def LCM(input_dim, num_outputs, kernels_list, W_rank=1,name='ICM'): """ Builds a kernel for an Linear Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize k...
def LCM(input_dim, num_outputs, kernels_list, W_rank=1,name='ICM'): """ Builds a kernel for an Linear Coregionalization Model :input_dim: Input dimensionality (does not include dimension of indices) :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize k...
[ "Builds", "a", "kernel", "for", "an", "Linear", "Coregionalization", "Model" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/multioutput.py#L62-L79
[ "def", "LCM", "(", "input_dim", ",", "num_outputs", ",", "kernels_list", ",", "W_rank", "=", "1", ",", "name", "=", "'ICM'", ")", ":", "Nk", "=", "len", "(", "kernels_list", ")", "K", "=", "ICM", "(", "input_dim", ",", "num_outputs", ",", "kernels_list...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Private
Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize kernel (matrix B). :type kernel: a GPy kernel :param W_rank: number tuples of the corregionalization parameter...
GPy/util/multioutput.py
def Private(input_dim, num_outputs, kernel, output, kappa=None,name='X'): """ Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize kernel (matrix B). :type ker...
def Private(input_dim, num_outputs, kernel, output, kappa=None,name='X'): """ Builds a kernel for an Intrinsic Coregionalization Model :input_dim: Input dimensionality :num_outputs: Number of outputs :param kernel: kernel that will be multiplied by the coregionalize kernel (matrix B). :type ker...
[ "Builds", "a", "kernel", "for", "an", "Intrinsic", "Coregionalization", "Model" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/multioutput.py#L82-L100
[ "def", "Private", "(", "input_dim", ",", "num_outputs", ",", "kernel", ",", "output", ",", "kappa", "=", "None", ",", "name", "=", "'X'", ")", ":", "K", "=", "ICM", "(", "input_dim", ",", "num_outputs", ",", "kernel", ",", "W_rank", "=", "1", ",", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.K
Kernel function applied on inputs X and X2. In the stationary case there is an inner function depending on the distances from X to X2, called r. K(X, X2) = K_of_r((X-X2)**2)
GPy/kern/src/stationary.py
def K(self, X, X2=None): """ Kernel function applied on inputs X and X2. In the stationary case there is an inner function depending on the distances from X to X2, called r. K(X, X2) = K_of_r((X-X2)**2) """ r = self._scaled_dist(X, X2) return self.K_of_r(...
def K(self, X, X2=None): """ Kernel function applied on inputs X and X2. In the stationary case there is an inner function depending on the distances from X to X2, called r. K(X, X2) = K_of_r((X-X2)**2) """ r = self._scaled_dist(X, X2) return self.K_of_r(...
[ "Kernel", "function", "applied", "on", "inputs", "X", "and", "X2", ".", "In", "the", "stationary", "case", "there", "is", "an", "inner", "function", "depending", "on", "the", "distances", "from", "X", "to", "X2", "called", "r", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L106-L115
[ "def", "K", "(", "self", ",", "X", ",", "X2", "=", "None", ")", ":", "r", "=", "self", ".", "_scaled_dist", "(", "X", ",", "X2", ")", "return", "self", ".", "K_of_r", "(", "r", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.dK_dr_via_X
compute the derivative of K wrt X going through X
GPy/kern/src/stationary.py
def dK_dr_via_X(self, X, X2): """ compute the derivative of K wrt X going through X """ #a convenience function, so we can cache dK_dr return self.dK_dr(self._scaled_dist(X, X2))
def dK_dr_via_X(self, X, X2): """ compute the derivative of K wrt X going through X """ #a convenience function, so we can cache dK_dr return self.dK_dr(self._scaled_dist(X, X2))
[ "compute", "the", "derivative", "of", "K", "wrt", "X", "going", "through", "X" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L118-L123
[ "def", "dK_dr_via_X", "(", "self", ",", "X", ",", "X2", ")", ":", "#a convenience function, so we can cache dK_dr", "return", "self", ".", "dK_dr", "(", "self", ".", "_scaled_dist", "(", "X", ",", "X2", ")", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary._unscaled_dist
Compute the Euclidean distance between each row of X and X2, or between each pair of rows of X if X2 is None.
GPy/kern/src/stationary.py
def _unscaled_dist(self, X, X2=None): """ Compute the Euclidean distance between each row of X and X2, or between each pair of rows of X if X2 is None. """ #X, = self._slice_X(X) if X2 is None: Xsq = np.sum(np.square(X),1) r2 = -2.*tdot(X) + (Xsq[:...
def _unscaled_dist(self, X, X2=None): """ Compute the Euclidean distance between each row of X and X2, or between each pair of rows of X if X2 is None. """ #X, = self._slice_X(X) if X2 is None: Xsq = np.sum(np.square(X),1) r2 = -2.*tdot(X) + (Xsq[:...
[ "Compute", "the", "Euclidean", "distance", "between", "each", "row", "of", "X", "and", "X2", "or", "between", "each", "pair", "of", "rows", "of", "X", "if", "X2", "is", "None", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L130-L148
[ "def", "_unscaled_dist", "(", "self", ",", "X", ",", "X2", "=", "None", ")", ":", "#X, = self._slice_X(X)", "if", "X2", "is", "None", ":", "Xsq", "=", "np", ".", "sum", "(", "np", ".", "square", "(", "X", ")", ",", "1", ")", "r2", "=", "-", "2....
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary._scaled_dist
Efficiently compute the scaled distance, r. ..math:: r = \sqrt( \sum_{q=1}^Q (x_q - x'q)^2/l_q^2 ) Note that if thre is only one lengthscale, l comes outside the sum. In this case we compute the unscaled distance first (in a separate function for caching) and divide by leng...
GPy/kern/src/stationary.py
def _scaled_dist(self, X, X2=None): """ Efficiently compute the scaled distance, r. ..math:: r = \sqrt( \sum_{q=1}^Q (x_q - x'q)^2/l_q^2 ) Note that if thre is only one lengthscale, l comes outside the sum. In this case we compute the unscaled distance first (in a s...
def _scaled_dist(self, X, X2=None): """ Efficiently compute the scaled distance, r. ..math:: r = \sqrt( \sum_{q=1}^Q (x_q - x'q)^2/l_q^2 ) Note that if thre is only one lengthscale, l comes outside the sum. In this case we compute the unscaled distance first (in a s...
[ "Efficiently", "compute", "the", "scaled", "distance", "r", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L151-L168
[ "def", "_scaled_dist", "(", "self", ",", "X", ",", "X2", "=", "None", ")", ":", "if", "self", ".", "ARD", ":", "if", "X2", "is", "not", "None", ":", "X2", "=", "X2", "/", "self", ".", "lengthscale", "return", "self", ".", "_unscaled_dist", "(", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.update_gradients_full
Given the derivative of the objective wrt the covariance matrix (dL_dK), compute the gradient wrt the parameters of this kernel, and store in the parameters object as e.g. self.variance.gradient
GPy/kern/src/stationary.py
def update_gradients_full(self, dL_dK, X, X2=None, reset=True): """ Given the derivative of the objective wrt the covariance matrix (dL_dK), compute the gradient wrt the parameters of this kernel, and store in the parameters object as e.g. self.variance.gradient """ self....
def update_gradients_full(self, dL_dK, X, X2=None, reset=True): """ Given the derivative of the objective wrt the covariance matrix (dL_dK), compute the gradient wrt the parameters of this kernel, and store in the parameters object as e.g. self.variance.gradient """ self....
[ "Given", "the", "derivative", "of", "the", "objective", "wrt", "the", "covariance", "matrix", "(", "dL_dK", ")", "compute", "the", "gradient", "wrt", "the", "parameters", "of", "this", "kernel", "and", "store", "in", "the", "parameters", "object", "as", "e",...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L193-L213
[ "def", "update_gradients_full", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ",", "reset", "=", "True", ")", ":", "self", ".", "variance", ".", "gradient", "=", "np", ".", "sum", "(", "self", ".", "K", "(", "X", ",", "X2", ")", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.update_gradients_direct
Specially intended for the Grid regression case. Given the computed log likelihood derivates, update the corresponding kernel and likelihood gradients. Useful for when gradients have been computed a priori.
GPy/kern/src/stationary.py
def update_gradients_direct(self, dL_dVar, dL_dLen): """ Specially intended for the Grid regression case. Given the computed log likelihood derivates, update the corresponding kernel and likelihood gradients. Useful for when gradients have been computed a priori. """ ...
def update_gradients_direct(self, dL_dVar, dL_dLen): """ Specially intended for the Grid regression case. Given the computed log likelihood derivates, update the corresponding kernel and likelihood gradients. Useful for when gradients have been computed a priori. """ ...
[ "Specially", "intended", "for", "the", "Grid", "regression", "case", ".", "Given", "the", "computed", "log", "likelihood", "derivates", "update", "the", "corresponding", "kernel", "and", "likelihood", "gradients", ".", "Useful", "for", "when", "gradients", "have",...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L216-L224
[ "def", "update_gradients_direct", "(", "self", ",", "dL_dVar", ",", "dL_dLen", ")", ":", "self", ".", "variance", ".", "gradient", "=", "dL_dVar", "self", ".", "lengthscale", ".", "gradient", "=", "dL_dLen" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary._inv_dist
Compute the elementwise inverse of the distance matrix, expecpt on the diagonal, where we return zero (the distance on the diagonal is zero). This term appears in derviatives.
GPy/kern/src/stationary.py
def _inv_dist(self, X, X2=None): """ Compute the elementwise inverse of the distance matrix, expecpt on the diagonal, where we return zero (the distance on the diagonal is zero). This term appears in derviatives. """ dist = self._scaled_dist(X, X2).copy() return 1...
def _inv_dist(self, X, X2=None): """ Compute the elementwise inverse of the distance matrix, expecpt on the diagonal, where we return zero (the distance on the diagonal is zero). This term appears in derviatives. """ dist = self._scaled_dist(X, X2).copy() return 1...
[ "Compute", "the", "elementwise", "inverse", "of", "the", "distance", "matrix", "expecpt", "on", "the", "diagonal", "where", "we", "return", "zero", "(", "the", "distance", "on", "the", "diagonal", "is", "zero", ")", ".", "This", "term", "appears", "in", "d...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L226-L233
[ "def", "_inv_dist", "(", "self", ",", "X", ",", "X2", "=", "None", ")", ":", "dist", "=", "self", ".", "_scaled_dist", "(", "X", ",", "X2", ")", ".", "copy", "(", ")", "return", "1.", "/", "np", ".", "where", "(", "dist", "!=", "0.", ",", "di...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.gradients_X
Given the derivative of the objective wrt K (dL_dK), compute the derivative wrt X
GPy/kern/src/stationary.py
def gradients_X(self, dL_dK, X, X2=None): """ Given the derivative of the objective wrt K (dL_dK), compute the derivative wrt X """ if use_stationary_cython: return self._gradients_X_cython(dL_dK, X, X2) else: return self._gradients_X_pure(dL_dK, X, X2)
def gradients_X(self, dL_dK, X, X2=None): """ Given the derivative of the objective wrt K (dL_dK), compute the derivative wrt X """ if use_stationary_cython: return self._gradients_X_cython(dL_dK, X, X2) else: return self._gradients_X_pure(dL_dK, X, X2)
[ "Given", "the", "derivative", "of", "the", "objective", "wrt", "K", "(", "dL_dK", ")", "compute", "the", "derivative", "wrt", "X" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L246-L253
[ "def", "gradients_X", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ")", ":", "if", "use_stationary_cython", ":", "return", "self", ".", "_gradients_X_cython", "(", "dL_dK", ",", "X", ",", "X2", ")", "else", ":", "return", "self", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.gradients_XX
Given the derivative of the objective K(dL_dK), compute the second derivative of K wrt X and X2: returns the full covariance matrix [QxQ] of the input dimensionfor each pair or vectors, thus the returned array is of shape [NxNxQxQ]. ..math: \frac{\partial^2 K}{\partial X2 ^2} = - \...
GPy/kern/src/stationary.py
def gradients_XX(self, dL_dK, X, X2=None): """ Given the derivative of the objective K(dL_dK), compute the second derivative of K wrt X and X2: returns the full covariance matrix [QxQ] of the input dimensionfor each pair or vectors, thus the returned array is of shape [NxNxQxQ]. ...
def gradients_XX(self, dL_dK, X, X2=None): """ Given the derivative of the objective K(dL_dK), compute the second derivative of K wrt X and X2: returns the full covariance matrix [QxQ] of the input dimensionfor each pair or vectors, thus the returned array is of shape [NxNxQxQ]. ...
[ "Given", "the", "derivative", "of", "the", "objective", "K", "(", "dL_dK", ")", "compute", "the", "second", "derivative", "of", "K", "wrt", "X", "and", "X2", ":" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L255-L292
[ "def", "gradients_XX", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ")", ":", "# According to multivariable chain rule, we can chain the second derivative through r:", "# d2K_dXdX2 = dK_dr*d2r_dXdX2 + d2K_drdr * dr_dX * dr_dX2:", "invdist", "=", "self", ".", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Stationary.gradients_XX_diag
Given the derivative of the objective dL_dK, compute the second derivative of K wrt X: ..math: \frac{\partial^2 K}{\partial X\partial X} ..returns: dL2_dXdX: [NxQxQ]
GPy/kern/src/stationary.py
def gradients_XX_diag(self, dL_dK_diag, X): """ Given the derivative of the objective dL_dK, compute the second derivative of K wrt X: ..math: \frac{\partial^2 K}{\partial X\partial X} ..returns: dL2_dXdX: [NxQxQ] """ dL_dK_diag = dL_dK_diag.copy()...
def gradients_XX_diag(self, dL_dK_diag, X): """ Given the derivative of the objective dL_dK, compute the second derivative of K wrt X: ..math: \frac{\partial^2 K}{\partial X\partial X} ..returns: dL2_dXdX: [NxQxQ] """ dL_dK_diag = dL_dK_diag.copy()...
[ "Given", "the", "derivative", "of", "the", "objective", "dL_dK", "compute", "the", "second", "derivative", "of", "K", "wrt", "X", ":" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L294-L308
[ "def", "gradients_XX_diag", "(", "self", ",", "dL_dK_diag", ",", "X", ")", ":", "dL_dK_diag", "=", "dL_dK_diag", ".", "copy", "(", ")", ".", "reshape", "(", "-", "1", ",", "1", ",", "1", ")", "assert", "(", "dL_dK_diag", ".", "size", "==", "X", "."...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Matern32.sde
Return the state space representation of the covariance.
GPy/kern/src/stationary.py
def sde(self): """ Return the state space representation of the covariance. """ variance = float(self.variance.values) lengthscale = float(self.lengthscale.values) foo = np.sqrt(3.)/lengthscale F = np.array([[0, 1], [-foo**2, -2*foo]]) L = np.array(...
def sde(self): """ Return the state space representation of the covariance. """ variance = float(self.variance.values) lengthscale = float(self.lengthscale.values) foo = np.sqrt(3.)/lengthscale F = np.array([[0, 1], [-foo**2, -2*foo]]) L = np.array(...
[ "Return", "the", "state", "space", "representation", "of", "the", "covariance", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L485-L519
[ "def", "sde", "(", "self", ")", ":", "variance", "=", "float", "(", "self", ".", "variance", ".", "values", ")", "lengthscale", "=", "float", "(", "self", ".", "lengthscale", ".", "values", ")", "foo", "=", "np", ".", "sqrt", "(", "3.", ")", "/", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Matern52.Gram_matrix
Return the Gram matrix of the vector of functions F with respect to the RKHS norm. The use of this function is limited to input_dim=1. :param F: vector of functions :type F: np.array :param F1: vector of derivatives of F :type F1: np.array :param F2: vector of second derivatives...
GPy/kern/src/stationary.py
def Gram_matrix(self, F, F1, F2, F3, lower, upper): """ Return the Gram matrix of the vector of functions F with respect to the RKHS norm. The use of this function is limited to input_dim=1. :param F: vector of functions :type F: np.array :param F1: vector of derivatives of F ...
def Gram_matrix(self, F, F1, F2, F3, lower, upper): """ Return the Gram matrix of the vector of functions F with respect to the RKHS norm. The use of this function is limited to input_dim=1. :param F: vector of functions :type F: np.array :param F1: vector of derivatives of F ...
[ "Return", "the", "Gram", "matrix", "of", "the", "vector", "of", "functions", "F", "with", "respect", "to", "the", "RKHS", "norm", ".", "The", "use", "of", "this", "function", "is", "limited", "to", "input_dim", "=", "1", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L556-L585
[ "def", "Gram_matrix", "(", "self", ",", "F", ",", "F1", ",", "F2", ",", "F3", ",", "lower", ",", "upper", ")", ":", "assert", "self", ".", "input_dim", "==", "1", "def", "L", "(", "x", ",", "i", ")", ":", "return", "(", "5", "*", "np", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
RatQuad.to_dict
Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object
GPy/kern/src/stationary.py
def to_dict(self): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object """ input_dict = su...
def to_dict(self): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :return dict: json serializable dictionary containing the needed information to instantiate the object """ input_dict = su...
[ "Convert", "the", "object", "into", "a", "json", "serializable", "dictionary", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/stationary.py#L656-L668
[ "def", "to_dict", "(", "self", ")", ":", "input_dict", "=", "super", "(", "RatQuad", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.kern.RatQuad\"", "input_dict", "[", "\"power\"", "]", "=", "self", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
fixed_inputs
Convenience function for returning back fixed_inputs where the other inputs are fixed using fix_routine :param model: model :type model: Model :param non_fixed_inputs: dimensions of non fixed inputs :type non_fixed_inputs: list :param fix_routine: fixing routine to use, 'mean', 'median', 'zero' ...
GPy/plotting/matplot_dep/util.py
def fixed_inputs(model, non_fixed_inputs, fix_routine='median', as_list=True, X_all=False): """ Convenience function for returning back fixed_inputs where the other inputs are fixed using fix_routine :param model: model :type model: Model :param non_fixed_inputs: dimensions of non fixed inputs ...
def fixed_inputs(model, non_fixed_inputs, fix_routine='median', as_list=True, X_all=False): """ Convenience function for returning back fixed_inputs where the other inputs are fixed using fix_routine :param model: model :type model: Model :param non_fixed_inputs: dimensions of non fixed inputs ...
[ "Convenience", "function", "for", "returning", "back", "fixed_inputs", "where", "the", "other", "inputs", "are", "fixed", "using", "fix_routine", ":", "param", "model", ":", "model", ":", "type", "model", ":", "Model", ":", "param", "non_fixed_inputs", ":", "d...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/plotting/matplot_dep/util.py#L121-L158
[ "def", "fixed_inputs", "(", "model", ",", "non_fixed_inputs", ",", "fix_routine", "=", "'median'", ",", "as_list", "=", "True", ",", "X_all", "=", "False", ")", ":", "from", ".", ".", ".", "inference", ".", "latent_function_inference", ".", "posterior", "imp...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
infer_newX
Infer the distribution of X for the new observed data *Y_new*. :param model: the GPy model used in inference :type model: GPy.core.Model :param Y_new: the new observed data for inference :type Y_new: numpy.ndarray :param optimize: whether to optimize the location of new X (True by default) :typ...
GPy/inference/latent_function_inference/inferenceX.py
def infer_newX(model, Y_new, optimize=True, init='L2'): """ Infer the distribution of X for the new observed data *Y_new*. :param model: the GPy model used in inference :type model: GPy.core.Model :param Y_new: the new observed data for inference :type Y_new: numpy.ndarray :param optimize: ...
def infer_newX(model, Y_new, optimize=True, init='L2'): """ Infer the distribution of X for the new observed data *Y_new*. :param model: the GPy model used in inference :type model: GPy.core.Model :param Y_new: the new observed data for inference :type Y_new: numpy.ndarray :param optimize: ...
[ "Infer", "the", "distribution", "of", "X", "for", "the", "new", "observed", "data", "*", "Y_new", "*", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/inference/latent_function_inference/inferenceX.py#L9-L27
[ "def", "infer_newX", "(", "model", ",", "Y_new", ",", "optimize", "=", "True", ",", "init", "=", "'L2'", ")", ":", "infr_m", "=", "InferenceX", "(", "model", ",", "Y_new", ",", "init", "=", "init", ")", "if", "optimize", ":", "infr_m", ".", "optimize...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
sde_RBF.sde
Return the state space representation of the covariance. Note! For Sparse GP inference too small or two high values of lengthscale lead to instabilities. This is because Qc are too high or too low and P_inf are not full rank. This effect depends on approximatio order. For N = 10...
GPy/kern/src/sde_stationary.py
def sde(self): """ Return the state space representation of the covariance. Note! For Sparse GP inference too small or two high values of lengthscale lead to instabilities. This is because Qc are too high or too low and P_inf are not full rank. This effect depends on app...
def sde(self): """ Return the state space representation of the covariance. Note! For Sparse GP inference too small or two high values of lengthscale lead to instabilities. This is because Qc are too high or too low and P_inf are not full rank. This effect depends on app...
[ "Return", "the", "state", "space", "representation", "of", "the", "covariance", ".", "Note!", "For", "Sparse", "GP", "inference", "too", "small", "or", "two", "high", "values", "of", "lengthscale", "lead", "to", "instabilities", ".", "This", "is", "because", ...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/sde_stationary.py#L73-L166
[ "def", "sde", "(", "self", ")", ":", "#import pdb; pdb.set_trace()", "if", "self", ".", "approx_order", "is", "not", "None", ":", "N", "=", "self", ".", "approx_order", "else", ":", "N", "=", "10", "# approximation order ( number of terms in exponent series expansio...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
sde_Exponential.sde
Return the state space representation of the covariance.
GPy/kern/src/sde_stationary.py
def sde(self): """ Return the state space representation of the covariance. """ variance = float(self.variance.values) lengthscale = float(self.lengthscale) F = np.array(((-1.0/lengthscale,),)) L = np.array(((1.0,),)) Qc = np.array( ((2.0*variance/lengt...
def sde(self): """ Return the state space representation of the covariance. """ variance = float(self.variance.values) lengthscale = float(self.lengthscale) F = np.array(((-1.0/lengthscale,),)) L = np.array(((1.0,),)) Qc = np.array( ((2.0*variance/lengt...
[ "Return", "the", "state", "space", "representation", "of", "the", "covariance", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/sde_stationary.py#L191-L220
[ "def", "sde", "(", "self", ")", ":", "variance", "=", "float", "(", "self", ".", "variance", ".", "values", ")", "lengthscale", "=", "float", "(", "self", ".", "lengthscale", ")", "F", "=", "np", ".", "array", "(", "(", "(", "-", "1.0", "/", "len...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.pdf_link
Likelihood function given link(f) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata which is not used in weibull distribution :returns: likelihood evaluated for this point :rtype: floa...
GPy/likelihoods/weibull.py
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata which is not used in weibull distribution ...
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadata which is not used in weibull distribution ...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/weibull.py#L31-L50
[ "def", "pdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "assert", "np", ".", "atleast_1d", "(", "link_f", ")", ".", "shape", "==", "np", ".", "atleast_1d", "(", "y", ")", ".", "shape", "c", "=", "np", "....
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.logpdf_link
Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} :param link_f: latent variables (link(f)) :type link_f: Nx1 a...
GPy/likelihoods/weibull.py
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} ...
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\alpha_{i}\\log \\beta - \\log \\Gamma(\\alpha_{i}) + (\\alpha_{i} - 1)\\log y_{i} - \\beta y_{i}\\\\ \\alpha_{i} = \\beta y_{i} ...
[ "Log", "Likelihood", "Function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/weibull.py#L52-L82
[ "def", "logpdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "# alpha = self.gp_link.transf(gp)*self.beta sum(log(a) + (a-1).*log(y)- f - exp(-f).*y.^a)", "# return (1. - alpha)*np.log(obs) + self.beta*obs - alpha * np.log(self.beta) + np.log...
54c32d79d289d622fb18b898aee65a2a431d90cf