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
Weibull.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/weibull.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/weibull.py#L84-L111
[ "def", "dlogpdf_dlink", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "# grad = (1. - self.beta) / (y - link_f)", "c", "=", "np", ".", "zeros_like", "(", "y", ")", "if", "Y_metadata", "is", "not", "None", "and", "'censored'...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.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/weibull.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/weibull.py#L113-L146
[ "def", "d2logpdf_dlink2", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "# hess = (self.beta - 1.) / (y - link_f)**2", "c", "=", "np", ".", "zeros_like", "(", "y", ")", "if", "Y_metadata", "is", "not", "None", "and", "'censo...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.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/weibull.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/weibull.py#L148-L176
[ "def", "d3logpdf_dlink3", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "# d3lik_dlink3 = (1. - self.beta) / (y - link_f)**3", "c", "=", "np", ".", "zeros_like", "(", "y", ")", "if", "Y_metadata", "is", "not", "None", "and", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.dlogpdf_dlink_dr
First order derivative derivative of loglikelihood wrt r:shape parameter :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 gamma distribution :returns: third derivative of ...
GPy/likelihoods/weibull.py
def dlogpdf_dlink_dr(self, inv_link_f, y, Y_metadata=None): """ First order derivative derivative of loglikelihood wrt r:shape parameter :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadat...
def dlogpdf_dlink_dr(self, inv_link_f, y, Y_metadata=None): """ First order derivative derivative of loglikelihood wrt r:shape parameter :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :param Y_metadata: Y_metadat...
[ "First", "order", "derivative", "derivative", "of", "loglikelihood", "wrt", "r", ":", "shape", "parameter" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/weibull.py#L205-L229
[ "def", "dlogpdf_dlink_dr", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "# dlogpdf_dlink_dr = self.beta * y**(self.beta - 1) * np.exp(-link_f)", "# dlogpdf_dlink_dr = np.exp(-link_f) * (y ** self.r) * np.log(y)", "c", "=", "np", ".", "ze...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Weibull.samples
Returns a set of samples of observations conditioned on a given value of latent variable f. :param gp: latent variable
GPy/likelihoods/weibull.py
def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations conditioned on a given value of latent variable f. :param gp: latent variable """ orig_shape = gp.shape gp = gp.flatten() weibull_samples = np.array([sp.stats.weibull_min.rvs(sel...
def samples(self, gp, Y_metadata=None): """ Returns a set of samples of observations conditioned on a given value of latent variable f. :param gp: latent variable """ orig_shape = gp.shape gp = gp.flatten() weibull_samples = np.array([sp.stats.weibull_min.rvs(sel...
[ "Returns", "a", "set", "of", "samples", "of", "observations", "conditioned", "on", "a", "given", "value", "of", "latent", "variable", "f", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/weibull.py#L313-L322
[ "def", "samples", "(", "self", ",", "gp", ",", "Y_metadata", "=", "None", ")", ":", "orig_shape", "=", "gp", ".", "shape", "gp", "=", "gp", ".", "flatten", "(", ")", "weibull_samples", "=", "np", ".", "array", "(", "[", "sp", ".", "stats", ".", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
VarDTC_minibatch.inference_likelihood
The first phase of inference: Compute: log-likelihood, dL_dKmm Cached intermediate results: Kmm, KmmInv,
GPy/inference/latent_function_inference/var_dtc_parallel.py
def inference_likelihood(self, kern, X, Z, likelihood, Y): """ The first phase of inference: Compute: log-likelihood, dL_dKmm Cached intermediate results: Kmm, KmmInv, """ num_data, output_dim = Y.shape input_dim = Z.shape[0] if self.mpi_comm != None: ...
def inference_likelihood(self, kern, X, Z, likelihood, Y): """ The first phase of inference: Compute: log-likelihood, dL_dKmm Cached intermediate results: Kmm, KmmInv, """ num_data, output_dim = Y.shape input_dim = Z.shape[0] if self.mpi_comm != None: ...
[ "The", "first", "phase", "of", "inference", ":", "Compute", ":", "log", "-", "likelihood", "dL_dKmm" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/inference/latent_function_inference/var_dtc_parallel.py#L135-L227
[ "def", "inference_likelihood", "(", "self", ",", "kern", ",", "X", ",", "Z", ",", "likelihood", ",", "Y", ")", ":", "num_data", ",", "output_dim", "=", "Y", ".", "shape", "input_dim", "=", "Z", ".", "shape", "[", "0", "]", "if", "self", ".", "mpi_c...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
VarDTC_minibatch.inference_minibatch
The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd)
GPy/inference/latent_function_inference/var_dtc_parallel.py
def inference_minibatch(self, kern, X, Z, likelihood, Y): """ The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd) """ num_data, outp...
def inference_minibatch(self, kern, X, Z, likelihood, Y): """ The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd) """ num_data, outp...
[ "The", "second", "phase", "of", "inference", ":", "Computing", "the", "derivatives", "over", "a", "minibatch", "of", "Y", "Compute", ":", "dL_dpsi0", "dL_dpsi1", "dL_dpsi2", "dL_dthetaL", "return", "a", "flag", "showing", "whether", "it", "reached", "the", "en...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/inference/latent_function_inference/var_dtc_parallel.py#L229-L334
[ "def", "inference_minibatch", "(", "self", ",", "kern", ",", "X", ",", "Z", ",", "likelihood", ",", "Y", ")", ":", "num_data", ",", "output_dim", "=", "Y", ".", "shape", "if", "isinstance", "(", "X", ",", "VariationalPosterior", ")", ":", "uncertain_inpu...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
VarDTC_minibatch_IBPLFM.inference_minibatch
The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd)
GPy/models/ibp_lfm.py
def inference_minibatch(self, kern, X, Z, likelihood, Y, Zp): """ The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd) """ num_data, ...
def inference_minibatch(self, kern, X, Z, likelihood, Y, Zp): """ The second phase of inference: Computing the derivatives over a minibatch of Y Compute: dL_dpsi0, dL_dpsi1, dL_dpsi2, dL_dthetaL return a flag showing whether it reached the end of Y (isEnd) """ num_data, ...
[ "The", "second", "phase", "of", "inference", ":", "Computing", "the", "derivatives", "over", "a", "minibatch", "of", "Y", "Compute", ":", "dL_dpsi0", "dL_dpsi1", "dL_dpsi2", "dL_dthetaL", "return", "a", "flag", "showing", "whether", "it", "reached", "the", "en...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/ibp_lfm.py#L190-L287
[ "def", "inference_minibatch", "(", "self", ",", "kern", ",", "X", ",", "Z", ",", "likelihood", ",", "Y", ",", "Zp", ")", ":", "num_data", ",", "output_dim", "=", "Y", ".", "shape", "#see whether we've got a different noise variance for each datum", "beta", "=", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
RBF.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/rbf.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/rbf.py#L34-L48
[ "def", "to_dict", "(", "self", ")", ":", "input_dict", "=", "super", "(", "RBF", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.kern.RBF\"", "input_dict", "[", "\"inv_l\"", "]", "=", "self", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
RBF.get_one_dimensional_kernel
Specially intended for Grid regression.
GPy/kern/src/rbf.py
def get_one_dimensional_kernel(self, dim): """ Specially intended for Grid regression. """ oneDkernel = GridRBF(input_dim=1, variance=self.variance.copy(), originalDimensions=dim) return oneDkernel
def get_one_dimensional_kernel(self, dim): """ Specially intended for Grid regression. """ oneDkernel = GridRBF(input_dim=1, variance=self.variance.copy(), originalDimensions=dim) return oneDkernel
[ "Specially", "intended", "for", "Grid", "regression", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/rbf.py#L82-L87
[ "def", "get_one_dimensional_kernel", "(", "self", ",", "dim", ")", ":", "oneDkernel", "=", "GridRBF", "(", "input_dim", "=", "1", ",", "variance", "=", "self", ".", "variance", ".", "copy", "(", ")", ",", "originalDimensions", "=", "dim", ")", "return", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
load_text_data
Load in a data set of marker points from the Ohio State University C3D motion capture files (http://accad.osu.edu/research/mocap/mocap_data.htm).
GPy/util/mocap.py
def load_text_data(dataset, directory, centre=True): """Load in a data set of marker points from the Ohio State University C3D motion capture files (http://accad.osu.edu/research/mocap/mocap_data.htm).""" points, point_names = parse_text(os.path.join(directory, dataset + '.txt'))[0:2] # Remove markers wher...
def load_text_data(dataset, directory, centre=True): """Load in a data set of marker points from the Ohio State University C3D motion capture files (http://accad.osu.edu/research/mocap/mocap_data.htm).""" points, point_names = parse_text(os.path.join(directory, dataset + '.txt'))[0:2] # Remove markers wher...
[ "Load", "in", "a", "data", "set", "of", "marker", "points", "from", "the", "Ohio", "State", "University", "C3D", "motion", "capture", "files", "(", "http", ":", "//", "accad", ".", "osu", ".", "edu", "/", "research", "/", "mocap", "/", "mocap_data", "....
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L647-L664
[ "def", "load_text_data", "(", "dataset", ",", "directory", ",", "centre", "=", "True", ")", ":", "points", ",", "point_names", "=", "parse_text", "(", "os", ".", "path", ".", "join", "(", "directory", ",", "dataset", "+", "'.txt'", ")", ")", "[", "0", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
parse_text
Parse data from Ohio State University text mocap files (http://accad.osu.edu/research/mocap/mocap_data.htm).
GPy/util/mocap.py
def parse_text(file_name): """Parse data from Ohio State University text mocap files (http://accad.osu.edu/research/mocap/mocap_data.htm).""" # Read the header fid = open(file_name, 'r') point_names = np.array(fid.readline().split())[2:-1:3] fid.close() for i in range(len(point_names)): ...
def parse_text(file_name): """Parse data from Ohio State University text mocap files (http://accad.osu.edu/research/mocap/mocap_data.htm).""" # Read the header fid = open(file_name, 'r') point_names = np.array(fid.readline().split())[2:-1:3] fid.close() for i in range(len(point_names)): ...
[ "Parse", "data", "from", "Ohio", "State", "University", "text", "mocap", "files", "(", "http", ":", "//", "accad", ".", "osu", ".", "edu", "/", "research", "/", "mocap", "/", "mocap_data", ".", "htm", ")", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L666-L691
[ "def", "parse_text", "(", "file_name", ")", ":", "# Read the header", "fid", "=", "open", "(", "file_name", ",", "'r'", ")", "point_names", "=", "np", ".", "array", "(", "fid", ".", "readline", "(", ")", ".", "split", "(", ")", ")", "[", "2", ":", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
read_connections
Read a file detailing which markers should be connected to which for motion capture data.
GPy/util/mocap.py
def read_connections(file_name, point_names): """Read a file detailing which markers should be connected to which for motion capture data.""" connections = [] fid = open(file_name, 'r') line=fid.readline() while(line): connections.append(np.array(line.split(','))) connections[-1][0]...
def read_connections(file_name, point_names): """Read a file detailing which markers should be connected to which for motion capture data.""" connections = [] fid = open(file_name, 'r') line=fid.readline() while(line): connections.append(np.array(line.split(','))) connections[-1][0]...
[ "Read", "a", "file", "detailing", "which", "markers", "should", "be", "connected", "to", "which", "for", "motion", "capture", "data", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L693-L714
[ "def", "read_connections", "(", "file_name", ",", "point_names", ")", ":", "connections", "=", "[", "]", "fid", "=", "open", "(", "file_name", ",", "'r'", ")", "line", "=", "fid", ".", "readline", "(", ")", "while", "(", "line", ")", ":", "connections"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.find_children
Take a tree and set the children according to the parents. Takes a tree structure which lists the parents of each vertex and computes the children for each vertex and places them in.
GPy/util/mocap.py
def find_children(self): """Take a tree and set the children according to the parents. Takes a tree structure which lists the parents of each vertex and computes the children for each vertex and places them in.""" for i in range(len(self.vertices)): self.vertices[i].children...
def find_children(self): """Take a tree and set the children according to the parents. Takes a tree structure which lists the parents of each vertex and computes the children for each vertex and places them in.""" for i in range(len(self.vertices)): self.vertices[i].children...
[ "Take", "a", "tree", "and", "set", "the", "children", "according", "to", "the", "parents", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L32-L42
[ "def", "find_children", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "self", ".", "vertices", "[", "i", "]", ".", "children", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.find_parents
Take a tree and set the parents according to the children Takes a tree structure which lists the children of each vertex and computes the parents for each vertex and places them in.
GPy/util/mocap.py
def find_parents(self): """Take a tree and set the parents according to the children Takes a tree structure which lists the children of each vertex and computes the parents for each vertex and places them in.""" for i in range(len(self.vertices)): self.vertices[i].parents = ...
def find_parents(self): """Take a tree and set the parents according to the children Takes a tree structure which lists the children of each vertex and computes the parents for each vertex and places them in.""" for i in range(len(self.vertices)): self.vertices[i].parents = ...
[ "Take", "a", "tree", "and", "set", "the", "parents", "according", "to", "the", "children" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L44-L54
[ "def", "find_parents", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "self", ".", "vertices", "[", "i", "]", ".", "parents", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.find_root
Finds the index of the root node of the tree.
GPy/util/mocap.py
def find_root(self): """Finds the index of the root node of the tree.""" self.find_parents() index = 0 while len(self.vertices[index].parents)>0: index = self.vertices[index].parents[0] return index
def find_root(self): """Finds the index of the root node of the tree.""" self.find_parents() index = 0 while len(self.vertices[index].parents)>0: index = self.vertices[index].parents[0] return index
[ "Finds", "the", "index", "of", "the", "root", "node", "of", "the", "tree", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L56-L62
[ "def", "find_root", "(", "self", ")", ":", "self", ".", "find_parents", "(", ")", "index", "=", "0", "while", "len", "(", "self", ".", "vertices", "[", "index", "]", ".", "parents", ")", ">", "0", ":", "index", "=", "self", ".", "vertices", "[", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.get_index_by_id
Give the index associated with a given vertex id.
GPy/util/mocap.py
def get_index_by_id(self, id): """Give the index associated with a given vertex id.""" for i in range(len(self.vertices)): if self.vertices[i].id == id: return i raise ValueError('Reverse look up of id failed.')
def get_index_by_id(self, id): """Give the index associated with a given vertex id.""" for i in range(len(self.vertices)): if self.vertices[i].id == id: return i raise ValueError('Reverse look up of id failed.')
[ "Give", "the", "index", "associated", "with", "a", "given", "vertex", "id", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L64-L69
[ "def", "get_index_by_id", "(", "self", ",", "id", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "if", "self", ".", "vertices", "[", "i", "]", ".", "id", "==", "id", ":", "return", "i", "raise", "V...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.get_index_by_name
Give the index associated with a given vertex name.
GPy/util/mocap.py
def get_index_by_name(self, name): """Give the index associated with a given vertex name.""" for i in range(len(self.vertices)): if self.vertices[i].name == name: return i raise ValueError('Reverse look up of name failed.')
def get_index_by_name(self, name): """Give the index associated with a given vertex name.""" for i in range(len(self.vertices)): if self.vertices[i].name == name: return i raise ValueError('Reverse look up of name failed.')
[ "Give", "the", "index", "associated", "with", "a", "given", "vertex", "name", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L71-L76
[ "def", "get_index_by_name", "(", "self", ",", "name", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "if", "self", ".", "vertices", "[", "i", "]", ".", "name", "==", "name", ":", "return", "i", "rais...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.order_vertices
Order vertices in the graph such that parents always have a lower index than children.
GPy/util/mocap.py
def order_vertices(self): """Order vertices in the graph such that parents always have a lower index than children.""" ordered = False while ordered == False: for i in range(len(self.vertices)): ordered = True for parent in self.vertices[i].pa...
def order_vertices(self): """Order vertices in the graph such that parents always have a lower index than children.""" ordered = False while ordered == False: for i in range(len(self.vertices)): ordered = True for parent in self.vertices[i].pa...
[ "Order", "vertices", "in", "the", "graph", "such", "that", "parents", "always", "have", "a", "lower", "index", "than", "children", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L78-L88
[ "def", "order_vertices", "(", "self", ")", ":", "ordered", "=", "False", "while", "ordered", "==", "False", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "ordered", "=", "True", "for", "parent", "in", "self"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
tree.swap_vertices
Swap two vertices in the tree structure array. swap_vertex swaps the location of two vertices in a tree structure array. :param tree: the tree for which two vertices are to be swapped. :param i: the index of the first vertex to be swapped. :param j: the index of the second vertex to be...
GPy/util/mocap.py
def swap_vertices(self, i, j): """ Swap two vertices in the tree structure array. swap_vertex swaps the location of two vertices in a tree structure array. :param tree: the tree for which two vertices are to be swapped. :param i: the index of the first vertex to be swapped. ...
def swap_vertices(self, i, j): """ Swap two vertices in the tree structure array. swap_vertex swaps the location of two vertices in a tree structure array. :param tree: the tree for which two vertices are to be swapped. :param i: the index of the first vertex to be swapped. ...
[ "Swap", "two", "vertices", "in", "the", "tree", "structure", "array", ".", "swap_vertex", "swaps", "the", "location", "of", "two", "vertices", "in", "a", "tree", "structure", "array", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L93-L115
[ "def", "swap_vertices", "(", "self", ",", "i", ",", "j", ")", ":", "store_vertex_i", "=", "self", ".", "vertices", "[", "i", "]", "store_vertex_j", "=", "self", ".", "vertices", "[", "j", "]", "self", ".", "vertices", "[", "j", "]", "=", "store_verte...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
skeleton.smooth_angle_channels
Remove discontinuities in angle channels so that they don't cause artifacts in algorithms that rely on the smoothness of the functions.
GPy/util/mocap.py
def smooth_angle_channels(self, channels): """Remove discontinuities in angle channels so that they don't cause artifacts in algorithms that rely on the smoothness of the functions.""" for vertex in self.vertices: for col in vertex.meta['rot_ind']: if col: ...
def smooth_angle_channels(self, channels): """Remove discontinuities in angle channels so that they don't cause artifacts in algorithms that rely on the smoothness of the functions.""" for vertex in self.vertices: for col in vertex.meta['rot_ind']: if col: ...
[ "Remove", "discontinuities", "in", "angle", "channels", "so", "that", "they", "don", "t", "cause", "artifacts", "in", "algorithms", "that", "rely", "on", "the", "smoothness", "of", "the", "functions", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L186-L196
[ "def", "smooth_angle_channels", "(", "self", ",", "channels", ")", ":", "for", "vertex", "in", "self", ".", "vertices", ":", "for", "col", "in", "vertex", ".", "meta", "[", "'rot_ind'", "]", ":", "if", "col", ":", "for", "k", "in", "range", "(", "1",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.load_skel
Loads an ASF file into a skeleton structure. :param file_name: The file name to load in.
GPy/util/mocap.py
def load_skel(self, file_name): """ Loads an ASF file into a skeleton structure. :param file_name: The file name to load in. """ fid = open(file_name, 'r') self.read_skel(fid) fid.close() self.name = file_name
def load_skel(self, file_name): """ Loads an ASF file into a skeleton structure. :param file_name: The file name to load in. """ fid = open(file_name, 'r') self.read_skel(fid) fid.close() self.name = file_name
[ "Loads", "an", "ASF", "file", "into", "a", "skeleton", "structure", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L313-L325
[ "def", "load_skel", "(", "self", ",", "file_name", ")", ":", "fid", "=", "open", "(", "file_name", ",", "'r'", ")", "self", ".", "read_skel", "(", "fid", ")", "fid", ".", "close", "(", ")", "self", ".", "name", "=", "file_name" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_bonedata
Read bone data from an acclaim skeleton file stream.
GPy/util/mocap.py
def read_bonedata(self, fid): """Read bone data from an acclaim skeleton file stream.""" bone_count = 0 lin = self.read_line(fid) while lin[0]!=':': parts = lin.split() if parts[0] == 'begin': bone_count += 1 self.vertices.append(v...
def read_bonedata(self, fid): """Read bone data from an acclaim skeleton file stream.""" bone_count = 0 lin = self.read_line(fid) while lin[0]!=':': parts = lin.split() if parts[0] == 'begin': bone_count += 1 self.vertices.append(v...
[ "Read", "bone", "data", "from", "an", "acclaim", "skeleton", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L328-L428
[ "def", "read_bonedata", "(", "self", ",", "fid", ")", ":", "bone_count", "=", "0", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", "[", "0", "]", "!=", "':'", ":", "parts", "=", "lin", ".", "split", "(", ")", "if", "parts",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_channels
Read channels from an acclaim file.
GPy/util/mocap.py
def read_channels(self, fid): """Read channels from an acclaim file.""" bones = [[] for i in self.vertices] num_channels = 0 for vertex in self.vertices: num_channels = num_channels + len(vertex.meta['channels']) lin = self.read_line(fid) while lin != ':DEGRE...
def read_channels(self, fid): """Read channels from an acclaim file.""" bones = [[] for i in self.vertices] num_channels = 0 for vertex in self.vertices: num_channels = num_channels + len(vertex.meta['channels']) lin = self.read_line(fid) while lin != ':DEGRE...
[ "Read", "channels", "from", "an", "acclaim", "file", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L430-L475
[ "def", "read_channels", "(", "self", ",", "fid", ")", ":", "bones", "=", "[", "[", "]", "for", "i", "in", "self", ".", "vertices", "]", "num_channels", "=", "0", "for", "vertex", "in", "self", ".", "vertices", ":", "num_channels", "=", "num_channels", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_documentation
Read documentation from an acclaim skeleton file stream.
GPy/util/mocap.py
def read_documentation(self, fid): """Read documentation from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': self.documentation.append(lin) lin = self.read_line(fid) return lin
def read_documentation(self, fid): """Read documentation from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': self.documentation.append(lin) lin = self.read_line(fid) return lin
[ "Read", "documentation", "from", "an", "acclaim", "skeleton", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L490-L497
[ "def", "read_documentation", "(", "self", ",", "fid", ")", ":", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", "[", "0", "]", "!=", "':'", ":", "self", ".", "documentation", ".", "append", "(", "lin", ")", "lin", "=", "self"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_hierarchy
Read hierarchy information from acclaim skeleton file stream.
GPy/util/mocap.py
def read_hierarchy(self, fid): """Read hierarchy information from acclaim skeleton file stream.""" lin = self.read_line(fid) while lin != 'end': parts = lin.split() if lin != 'begin': ind = self.get_index_by_name(parts[0]) ...
def read_hierarchy(self, fid): """Read hierarchy information from acclaim skeleton file stream.""" lin = self.read_line(fid) while lin != 'end': parts = lin.split() if lin != 'begin': ind = self.get_index_by_name(parts[0]) ...
[ "Read", "hierarchy", "information", "from", "acclaim", "skeleton", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L499-L512
[ "def", "read_hierarchy", "(", "self", ",", "fid", ")", ":", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", "!=", "'end'", ":", "parts", "=", "lin", ".", "split", "(", ")", "if", "lin", "!=", "'begin'", ":", "ind", "=", "se...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_line
Read a line from a file string and check it isn't either empty or commented before returning.
GPy/util/mocap.py
def read_line(self, fid): """Read a line from a file string and check it isn't either empty or commented before returning.""" lin = '#' while lin[0] == '#': lin = fid.readline().strip() if lin == '': return lin return lin
def read_line(self, fid): """Read a line from a file string and check it isn't either empty or commented before returning.""" lin = '#' while lin[0] == '#': lin = fid.readline().strip() if lin == '': return lin return lin
[ "Read", "a", "line", "from", "a", "file", "string", "and", "check", "it", "isn", "t", "either", "empty", "or", "commented", "before", "returning", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L514-L521
[ "def", "read_line", "(", "self", ",", "fid", ")", ":", "lin", "=", "'#'", "while", "lin", "[", "0", "]", "==", "'#'", ":", "lin", "=", "fid", ".", "readline", "(", ")", ".", "strip", "(", ")", "if", "lin", "==", "''", ":", "return", "lin", "r...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_root
Read the root node from an acclaim skeleton file stream.
GPy/util/mocap.py
def read_root(self, fid): """Read the root node from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': parts = lin.split() if parts[0]=='order': order = [] for i in range(1, len(parts)): ...
def read_root(self, fid): """Read the root node from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': parts = lin.split() if parts[0]=='order': order = [] for i in range(1, len(parts)): ...
[ "Read", "the", "root", "node", "from", "an", "acclaim", "skeleton", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L524-L565
[ "def", "read_root", "(", "self", ",", "fid", ")", ":", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", "[", "0", "]", "!=", "':'", ":", "parts", "=", "lin", ".", "split", "(", ")", "if", "parts", "[", "0", "]", "==", "'...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_skel
Loads an acclaim skeleton format from a file stream.
GPy/util/mocap.py
def read_skel(self, fid): """Loads an acclaim skeleton format from a file stream.""" lin = self.read_line(fid) while lin: if lin[0]==':': if lin[1:]== 'name': lin = self.read_line(fid) self.name = lin elif lin[1:...
def read_skel(self, fid): """Loads an acclaim skeleton format from a file stream.""" lin = self.read_line(fid) while lin: if lin[0]==':': if lin[1:]== 'name': lin = self.read_line(fid) self.name = lin elif lin[1:...
[ "Loads", "an", "acclaim", "skeleton", "format", "from", "a", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L567-L595
[ "def", "read_skel", "(", "self", ",", "fid", ")", ":", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", ":", "if", "lin", "[", "0", "]", "==", "':'", ":", "if", "lin", "[", "1", ":", "]", "==", "'name'", ":", "lin", "=",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.read_units
Read units from an acclaim skeleton file stream.
GPy/util/mocap.py
def read_units(self, fid): """Read units from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': parts = lin.split() if parts[0]=='mass': self.mass = float(parts[1]) elif parts[0]=='length': ...
def read_units(self, fid): """Read units from an acclaim skeleton file stream.""" lin = self.read_line(fid) while lin[0] != ':': parts = lin.split() if parts[0]=='mass': self.mass = float(parts[1]) elif parts[0]=='length': ...
[ "Read", "units", "from", "an", "acclaim", "skeleton", "file", "stream", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L597-L609
[ "def", "read_units", "(", "self", ",", "fid", ")", ":", "lin", "=", "self", ".", "read_line", "(", "fid", ")", "while", "lin", "[", "0", "]", "!=", "':'", ":", "parts", "=", "lin", ".", "split", "(", ")", "if", "parts", "[", "0", "]", "==", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.resolve_indices
Get indices for the skeleton from the channels when loading in channel data.
GPy/util/mocap.py
def resolve_indices(self, index, start_val): """Get indices for the skeleton from the channels when loading in channel data.""" channels = self.vertices[index].meta['channels'] base_channel = start_val rot_ind = -np.ones(3, dtype=int) pos_ind = -np.ones(3, dtype=int) fo...
def resolve_indices(self, index, start_val): """Get indices for the skeleton from the channels when loading in channel data.""" channels = self.vertices[index].meta['channels'] base_channel = start_val rot_ind = -np.ones(3, dtype=int) pos_ind = -np.ones(3, dtype=int) fo...
[ "Get", "indices", "for", "the", "skeleton", "from", "the", "channels", "when", "loading", "in", "channel", "data", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L611-L632
[ "def", "resolve_indices", "(", "self", ",", "index", ",", "start_val", ")", ":", "channels", "=", "self", ".", "vertices", "[", "index", "]", ".", "meta", "[", "'channels'", "]", "base_channel", "=", "start_val", "rot_ind", "=", "-", "np", ".", "ones", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
acclaim_skeleton.set_rotation_matrices
Set the meta information at each vertex to contain the correct matrices C and Cinv as prescribed by the rotations and rotation orders.
GPy/util/mocap.py
def set_rotation_matrices(self): """Set the meta information at each vertex to contain the correct matrices C and Cinv as prescribed by the rotations and rotation orders.""" for i in range(len(self.vertices)): self.vertices[i].meta['C'] = rotation_matrix(self.vertices[i].meta['axis'][0], ...
def set_rotation_matrices(self): """Set the meta information at each vertex to contain the correct matrices C and Cinv as prescribed by the rotations and rotation orders.""" for i in range(len(self.vertices)): self.vertices[i].meta['C'] = rotation_matrix(self.vertices[i].meta['axis'][0], ...
[ "Set", "the", "meta", "information", "at", "each", "vertex", "to", "contain", "the", "correct", "matrices", "C", "and", "Cinv", "as", "prescribed", "by", "the", "rotations", "and", "rotation", "orders", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/util/mocap.py#L634-L643
[ "def", "set_rotation_matrices", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "vertices", ")", ")", ":", "self", ".", "vertices", "[", "i", "]", ".", "meta", "[", "'C'", "]", "=", "rotation_matrix", "(", "self", "....
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MLP.Kdiag
Compute the diagonal of the covariance matrix for X.
GPy/kern/src/mlp.py
def Kdiag(self, X): """Compute the diagonal of the covariance matrix for X.""" X_prod = self._comp_prod(X) return self.variance*four_over_tau*np.arcsin(X_prod/(X_prod+1.))
def Kdiag(self, X): """Compute the diagonal of the covariance matrix for X.""" X_prod = self._comp_prod(X) return self.variance*four_over_tau*np.arcsin(X_prod/(X_prod+1.))
[ "Compute", "the", "diagonal", "of", "the", "covariance", "matrix", "for", "X", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/mlp.py#L61-L64
[ "def", "Kdiag", "(", "self", ",", "X", ")", ":", "X_prod", "=", "self", ".", "_comp_prod", "(", "X", ")", "return", "self", ".", "variance", "*", "four_over_tau", "*", "np", ".", "arcsin", "(", "X_prod", "/", "(", "X_prod", "+", "1.", ")", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MLP.update_gradients_full
Derivative of the covariance with respect to the parameters.
GPy/kern/src/mlp.py
def update_gradients_full(self, dL_dK, X, X2=None): """Derivative of the covariance with respect to the parameters.""" dvar, dw, db = self._comp_grads(dL_dK, X, X2)[:3] self.variance.gradient = dvar self.weight_variance.gradient = dw self.bias_variance.gradient = db
def update_gradients_full(self, dL_dK, X, X2=None): """Derivative of the covariance with respect to the parameters.""" dvar, dw, db = self._comp_grads(dL_dK, X, X2)[:3] self.variance.gradient = dvar self.weight_variance.gradient = dw self.bias_variance.gradient = db
[ "Derivative", "of", "the", "covariance", "with", "respect", "to", "the", "parameters", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/mlp.py#L66-L71
[ "def", "update_gradients_full", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", "=", "None", ")", ":", "dvar", ",", "dw", ",", "db", "=", "self", ".", "_comp_grads", "(", "dL_dK", ",", "X", ",", "X2", ")", "[", ":", "3", "]", "self", ".", "vari...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MLP.gradients_X
Derivative of the covariance matrix with respect to X
GPy/kern/src/mlp.py
def gradients_X(self, dL_dK, X, X2): """Derivative of the covariance matrix with respect to X""" return self._comp_grads(dL_dK, X, X2)[3]
def gradients_X(self, dL_dK, X, X2): """Derivative of the covariance matrix with respect to X""" return self._comp_grads(dL_dK, X, X2)[3]
[ "Derivative", "of", "the", "covariance", "matrix", "with", "respect", "to", "X" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/mlp.py#L79-L81
[ "def", "gradients_X", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", ")", ":", "return", "self", ".", "_comp_grads", "(", "dL_dK", ",", "X", ",", "X2", ")", "[", "3", "]" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
MLP.gradients_X_X2
Derivative of the covariance matrix with respect to X
GPy/kern/src/mlp.py
def gradients_X_X2(self, dL_dK, X, X2): """Derivative of the covariance matrix with respect to X""" return self._comp_grads(dL_dK, X, X2)[3:]
def gradients_X_X2(self, dL_dK, X, X2): """Derivative of the covariance matrix with respect to X""" return self._comp_grads(dL_dK, X, X2)[3:]
[ "Derivative", "of", "the", "covariance", "matrix", "with", "respect", "to", "X" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/mlp.py#L83-L85
[ "def", "gradients_X_X2", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", ")", ":", "return", "self", ".", "_comp_grads", "(", "dL_dK", ",", "X", ",", "X2", ")", "[", "3", ":", "]" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_1._get_params
return the value of the parameters.
GPy/kern/src/todo/ODE_1.py
def _get_params(self): """return the value of the parameters.""" return np.hstack((self.varianceU,self.varianceY, self.lengthscaleU,self.lengthscaleY))
def _get_params(self): """return the value of the parameters.""" return np.hstack((self.varianceU,self.varianceY, self.lengthscaleU,self.lengthscaleY))
[ "return", "the", "value", "of", "the", "parameters", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/ODE_1.py#L43-L45
[ "def", "_get_params", "(", "self", ")", ":", "return", "np", ".", "hstack", "(", "(", "self", ".", "varianceU", ",", "self", ".", "varianceY", ",", "self", ".", "lengthscaleU", ",", "self", ".", "lengthscaleY", ")", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_1._set_params
set the value of the parameters.
GPy/kern/src/todo/ODE_1.py
def _set_params(self, x): """set the value of the parameters.""" assert x.size == self.num_params self.varianceU = x[0] self.varianceY = x[1] self.lengthscaleU = x[2] self.lengthscaleY = x[3]
def _set_params(self, x): """set the value of the parameters.""" assert x.size == self.num_params self.varianceU = x[0] self.varianceY = x[1] self.lengthscaleU = x[2] self.lengthscaleY = x[3]
[ "set", "the", "value", "of", "the", "parameters", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/ODE_1.py#L47-L53
[ "def", "_set_params", "(", "self", ",", "x", ")", ":", "assert", "x", ".", "size", "==", "self", ".", "num_params", "self", ".", "varianceU", "=", "x", "[", "0", "]", "self", ".", "varianceY", "=", "x", "[", "1", "]", "self", ".", "lengthscaleU", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_1.K
Compute the covariance matrix between X and X2.
GPy/kern/src/todo/ODE_1.py
def K(self, X, X2, target): """Compute the covariance matrix between X and X2.""" if X2 is None: X2 = X # i1 = X[:,1] # i2 = X2[:,1] # X = X[:,0].reshape(-1,1) # X2 = X2[:,0].reshape(-1,1) dist = np.abs(X - X2.T) ly=1/self.lengthscaleY lu=np.s...
def K(self, X, X2, target): """Compute the covariance matrix between X and X2.""" if X2 is None: X2 = X # i1 = X[:,1] # i2 = X2[:,1] # X = X[:,0].reshape(-1,1) # X2 = X2[:,0].reshape(-1,1) dist = np.abs(X - X2.T) ly=1/self.lengthscaleY lu=np.s...
[ "Compute", "the", "covariance", "matrix", "between", "X", "and", "X2", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/ODE_1.py#L60-L78
[ "def", "K", "(", "self", ",", "X", ",", "X2", ",", "target", ")", ":", "if", "X2", "is", "None", ":", "X2", "=", "X", "# i1 = X[:,1]", "# i2 = X2[:,1]", "# X = X[:,0].reshape(-1,1)", "# X2 = X2[:,0].reshape(-1,1)", "dist", "=", "np", ".", "abs", "(", "X", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_1.Kdiag
Compute the diagonal of the covariance matrix associated to X.
GPy/kern/src/todo/ODE_1.py
def Kdiag(self, X, target): """Compute the diagonal of the covariance matrix associated to X.""" ly=1/self.lengthscaleY lu=np.sqrt(3)/self.lengthscaleU #ly=self.lengthscaleY #lu=self.lengthscaleU k1 = (2*lu+ly)/(lu+ly)**2 k2 = (ly-2*lu + 2*lu-ly ) / (ly-l...
def Kdiag(self, X, target): """Compute the diagonal of the covariance matrix associated to X.""" ly=1/self.lengthscaleY lu=np.sqrt(3)/self.lengthscaleU #ly=self.lengthscaleY #lu=self.lengthscaleU k1 = (2*lu+ly)/(lu+ly)**2 k2 = (ly-2*lu + 2*lu-ly ) / (ly-l...
[ "Compute", "the", "diagonal", "of", "the", "covariance", "matrix", "associated", "to", "X", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/ODE_1.py#L80-L91
[ "def", "Kdiag", "(", "self", ",", "X", ",", "target", ")", ":", "ly", "=", "1", "/", "self", ".", "lengthscaleY", "lu", "=", "np", ".", "sqrt", "(", "3", ")", "/", "self", ".", "lengthscaleU", "#ly=self.lengthscaleY", "#lu=self.lengthscaleU", "k1", "="...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
ODE_1._param_grad_helper
derivative of the covariance matrix with respect to the parameters.
GPy/kern/src/todo/ODE_1.py
def _param_grad_helper(self, dL_dK, X, X2, target): """derivative of the covariance matrix with respect to the parameters.""" if X2 is None: X2 = X dist = np.abs(X - X2.T) ly=1/self.lengthscaleY lu=np.sqrt(3)/self.lengthscaleU #ly=self.lengthscaleY #lu=self.lengt...
def _param_grad_helper(self, dL_dK, X, X2, target): """derivative of the covariance matrix with respect to the parameters.""" if X2 is None: X2 = X dist = np.abs(X - X2.T) ly=1/self.lengthscaleY lu=np.sqrt(3)/self.lengthscaleU #ly=self.lengthscaleY #lu=self.lengt...
[ "derivative", "of", "the", "covariance", "matrix", "with", "respect", "to", "the", "parameters", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/kern/src/todo/ODE_1.py#L93-L144
[ "def", "_param_grad_helper", "(", "self", ",", "dL_dK", ",", "X", ",", "X2", ",", "target", ")", ":", "if", "X2", "is", "None", ":", "X2", "=", "X", "dist", "=", "np", ".", "abs", "(", "X", "-", "X2", ".", "T", ")", "ly", "=", "1", "/", "se...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GaussianGridInference.inference
Returns a GridPosterior class containing essential quantities of the posterior
GPy/inference/latent_function_inference/gaussian_grid_inference.py
def inference(self, kern, X, likelihood, Y, Y_metadata=None): """ Returns a GridPosterior class containing essential quantities of the posterior """ N = X.shape[0] #number of training points D = X.shape[1] #number of dimensions Kds = np.zeros(D, dtype=object) #vector fo...
def inference(self, kern, X, likelihood, Y, Y_metadata=None): """ Returns a GridPosterior class containing essential quantities of the posterior """ N = X.shape[0] #number of training points D = X.shape[1] #number of dimensions Kds = np.zeros(D, dtype=object) #vector fo...
[ "Returns", "a", "GridPosterior", "class", "containing", "essential", "quantities", "of", "the", "posterior" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/inference/latent_function_inference/gaussian_grid_inference.py#L50-L114
[ "def", "inference", "(", "self", ",", "kern", ",", "X", ",", "likelihood", ",", "Y", ",", "Y_metadata", "=", "None", ")", ":", "N", "=", "X", ".", "shape", "[", "0", "]", "#number of training points", "D", "=", "X", ".", "shape", "[", "1", "]", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Constant.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/constant.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 = sup...
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 = sup...
[ "Convert", "the", "object", "into", "a", "json", "serializable", "dictionary", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/mappings/constant.py#L42-L53
[ "def", "to_dict", "(", "self", ")", ":", "input_dict", "=", "super", "(", "Constant", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.mappings.Constant\"", "input_dict", "[", "\"value\"", "]", "=", "se...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.update_gradients
Pull out the gradients, be careful as the order must match the order in which the parameters are added
GPy/likelihoods/student_t.py
def update_gradients(self, grads): """ Pull out the gradients, be careful as the order must match the order in which the parameters are added """ self.sigma2.gradient = grads[0] self.v.gradient = grads[1]
def update_gradients(self, grads): """ Pull out the gradients, be careful as the order must match the order in which the parameters are added """ self.sigma2.gradient = grads[0] self.v.gradient = grads[1]
[ "Pull", "out", "the", "gradients", "be", "careful", "as", "the", "order", "must", "match", "the", "order", "in", "which", "the", "parameters", "are", "added" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L39-L45
[ "def", "update_gradients", "(", "self", ",", "grads", ")", ":", "self", ".", "sigma2", ".", "gradient", "=", "grads", "[", "0", "]", "self", ".", "v", ".", "gradient", "=", "grads", "[", "1", "]" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.pdf_link
Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\Gamma\\left(\\frac{v+1}{2}\\right)}{\\Gamma\\left(\\frac{v}{2}\\right)\\sqrt{v\\pi\\sigma^{2}}}\\left(1 + \\frac{1}{v}\\left(\\frac{(y_{i} - \\lambda(f_{i}))^{2}}{\\sigma^{2}}\\right)\\right)^{\\frac{-v+1}{2}} ...
GPy/likelihoods/student_t.py
def pdf_link(self, inv_link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\Gamma\\left(\\frac{v+1}{2}\\right)}{\\Gamma\\left(\\frac{v}{2}\\right)\\sqrt{v\\pi\\sigma^{2}}}\\left(1 + \\frac{1}{v}\\left(\\frac{(y_{i} - \\lamb...
def pdf_link(self, inv_link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: p(y_{i}|\\lambda(f_{i})) = \\frac{\\Gamma\\left(\\frac{v+1}{2}\\right)}{\\Gamma\\left(\\frac{v}{2}\\right)\\sqrt{v\\pi\\sigma^{2}}}\\left(1 + \\frac{1}{v}\\left(\\frac{(y_{i} - \\lamb...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L47-L69
[ "def", "pdf_link", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "assert", "np", ".", "atleast_1d", "(", "inv_link_f", ")", ".", "shape", "==", "np", ".", "atleast_1d", "(", "y", ")", ".", "shape", "e", "=", "y...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.logpdf_link
Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\Gamma\\left(\\frac{v+1}{2}\\right) - \\ln \\Gamma\\left(\\frac{v}{2}\\right) - \\ln \\sqrt{v \\pi\\sigma^{2}} - \\frac{v+1}{2}\\ln \\left(1 + \\frac{1}{v}\\left(\\frac{(y_{i} - \lambda(f_{i}))^{2}}{\\sigma^{2}}\\r...
GPy/likelihoods/student_t.py
def logpdf_link(self, inv_link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\Gamma\\left(\\frac{v+1}{2}\\right) - \\ln \\Gamma\\left(\\frac{v}{2}\\right) - \\ln \\sqrt{v \\pi\\sigma^{2}} - \\frac{v+1}{2}\\ln \\left(...
def logpdf_link(self, inv_link_f, y, Y_metadata=None): """ Log Likelihood Function given link(f) .. math:: \\ln p(y_{i}|\lambda(f_{i})) = \\ln \\Gamma\\left(\\frac{v+1}{2}\\right) - \\ln \\Gamma\\left(\\frac{v}{2}\\right) - \\ln \\sqrt{v \\pi\\sigma^{2}} - \\frac{v+1}{2}\\ln \\left(...
[ "Log", "Likelihood", "Function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L71-L97
[ "def", "logpdf_link", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "#FIXME:", "#Why does np.log(1 + (1/self.v)*((y-inv_link_f)**2)/self.sigma2) suppress the divide by zero?!", "#But np.log(1 + (1/float...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.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)} = \\frac{(v+1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i}))^{2} + \\sigma^{2}v} :param inv_link_f: latent variables (f) :type inv_link_f: Nx1 ar...
GPy/likelihoods/student_t.py
def dlogpdf_dlink(self, inv_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)} = \\frac{(v+1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i}))^{2} + \\sigma^{2}v} ...
def dlogpdf_dlink(self, inv_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)} = \\frac{(v+1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i}))^{2} + \\sigma^{2}v} ...
[ "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/student_t.py#L99-L117
[ "def", "dlogpdf_dlink", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "grad", "=", "(", "(", "self", ".", "v", "+", "1", ")", "*", "e", ")", "/", "(", "self", ".", "v", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.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)} = \\frac{(v+1)((y_{i}-\lambda(f_{i}))...
GPy/likelihoods/student_t.py
def d2logpdf_dlink2(self, inv_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...
def d2logpdf_dlink2(self, inv_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...
[ "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/student_t.py#L119-L142
[ "def", "d2logpdf_dlink2", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "hess", "=", "(", "(", "self", ".", "v", "+", "1", ")", "*", "(", "e", "**", "2", "-", "self", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.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)} = \\frac{-2(v+1)((y_{i} - \lambda(f_{i}))^3 - 3(y_{i} - \lambda(f_{i})) \\sigma^{2} v))}{((y_{i} - \lambda(f_{i})) + \\sigma^{2} v)^3} :par...
GPy/likelihoods/student_t.py
def d3logpdf_dlink3(self, inv_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)} = \\frac{-2(v+1)((y_{i} - \lambda(f_{i}))^3 - 3(y_{i} - \lambda(f_{i}...
def d3logpdf_dlink3(self, inv_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)} = \\frac{-2(v+1)((y_{i} - \lambda(f_{i}))^3 - 3(y_{i} - \lambda(f_{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/student_t.py#L144-L163
[ "def", "d3logpdf_dlink3", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "d3lik_dlink3", "=", "(", "-", "(", "2", "*", "(", "self", ".", "v", "+", "1", ")", "*", "(", "-", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.dlogpdf_link_dvar
Gradient of the log-likelihood function at y given f, w.r.t variance parameter (t_noise) .. math:: \\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{d\\sigma^{2}} = \\frac{v((y_{i} - \lambda(f_{i}))^{2} - \\sigma^{2})}{2\\sigma^{2}(\\sigma^{2}v + (y_{i} - \lambda(f_{i}))^{2})} :param inv_link_f: late...
GPy/likelihoods/student_t.py
def dlogpdf_link_dvar(self, inv_link_f, y, Y_metadata=None): """ Gradient of the log-likelihood function at y given f, w.r.t variance parameter (t_noise) .. math:: \\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{d\\sigma^{2}} = \\frac{v((y_{i} - \lambda(f_{i}))^{2} - \\sigma^{2})}{2\\sigma^{...
def dlogpdf_link_dvar(self, inv_link_f, y, Y_metadata=None): """ Gradient of the log-likelihood function at y given f, w.r.t variance parameter (t_noise) .. math:: \\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{d\\sigma^{2}} = \\frac{v((y_{i} - \lambda(f_{i}))^{2} - \\sigma^{2})}{2\\sigma^{...
[ "Gradient", "of", "the", "log", "-", "likelihood", "function", "at", "y", "given", "f", "w", ".", "r", ".", "t", "variance", "parameter", "(", "t_noise", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L165-L183
[ "def", "dlogpdf_link_dvar", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "e2", "=", "np", ".", "square", "(", "e", ")", "dlogpdf_dvar", "=", "self", ".", "v", "*", "(", "e2", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.dlogpdf_dlink_dvar
Derivative of the dlogpdf_dlink w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{df}) = \\frac{-2\\sigma v(v + 1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i}))^2 + \\sigma^2 v)^2} :param inv_link_f: latent variables inv_link_f ...
GPy/likelihoods/student_t.py
def dlogpdf_dlink_dvar(self, inv_link_f, y, Y_metadata=None): """ Derivative of the dlogpdf_dlink w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{df}) = \\frac{-2\\sigma v(v + 1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i})...
def dlogpdf_dlink_dvar(self, inv_link_f, y, Y_metadata=None): """ Derivative of the dlogpdf_dlink w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\lambda(f_{i}))}{df}) = \\frac{-2\\sigma v(v + 1)(y_{i}-\lambda(f_{i}))}{(y_{i}-\lambda(f_{i})...
[ "Derivative", "of", "the", "dlogpdf_dlink", "w", ".", "r", ".", "t", "variance", "parameter", "(", "t_noise", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L185-L202
[ "def", "dlogpdf_dlink_dvar", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "dlogpdf_dlink_dvar", "=", "(", "self", ".", "v", "*", "(", "self", ".", "v", "+", "1", ")", "*", "("...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.d2logpdf_dlink2_dvar
Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\lambda(f_{i}))}{d^{2}f}) = \\frac{v(v+1)(\\sigma^{2}v - 3(y_{i} - \lambda(f_{i}))^{2})}{(\\sigma^{2}v + (y_{i} - \lambda(f_{i}))^{2})^{3}} :param inv_li...
GPy/likelihoods/student_t.py
def d2logpdf_dlink2_dvar(self, inv_link_f, y, Y_metadata=None): """ Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\lambda(f_{i}))}{d^{2}f}) = \\frac{v(v+1)(\\sigma^{2}v - 3(y_{i} - \lambda(f_{...
def d2logpdf_dlink2_dvar(self, inv_link_f, y, Y_metadata=None): """ Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (t_noise) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\lambda(f_{i}))}{d^{2}f}) = \\frac{v(v+1)(\\sigma^{2}v - 3(y_{i} - \lambda(f_{...
[ "Gradient", "of", "the", "hessian", "(", "d2logpdf_dlink2", ")", "w", ".", "r", ".", "t", "variance", "parameter", "(", "t_noise", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/student_t.py#L204-L223
[ "def", "d2logpdf_dlink2_dvar", "(", "self", ",", "inv_link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "inv_link_f", "d2logpdf_dlink2_dvar", "=", "(", "(", "self", ".", "v", "*", "(", "self", ".", "v", "+", "1", ")", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
StudentT.samples
Returns a set of samples of observations based on a given value of the latent variable. :param gp: latent variable
GPy/likelihoods/student_t.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() #FIXME: Very slow as we are computing a new random variable ...
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() #FIXME: Very slow as we are computing a new random variable ...
[ "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/student_t.py#L283-L298
[ "def", "samples", "(", "self", ",", "gp", ",", "Y_metadata", "=", "None", ")", ":", "orig_shape", "=", "gp", ".", "shape", "gp", "=", "gp", ".", "flatten", "(", ")", "#FIXME: Very slow as we are computing a new random variable per input!", "#Can't get it to sample a...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPMiniBatch._inner_parameters_changed
This is the standard part, which usually belongs in parameters_changed. For automatic handling of subsampling (such as missing_data, stochastics etc.), we need to put this into an inner loop, in order to ensure a different handling of gradients etc of different subsets of data. The dic...
GPy/models/sparse_gp_minibatch.py
def _inner_parameters_changed(self, kern, X, Z, likelihood, Y, Y_metadata, Lm=None, dL_dKmm=None, psi0=None, psi1=None, psi2=None, **kwargs): """ This is the standard part, which usually belongs in parameters_changed. For automatic handling of subsampling (such as missing_data, stochastics etc....
def _inner_parameters_changed(self, kern, X, Z, likelihood, Y, Y_metadata, Lm=None, dL_dKmm=None, psi0=None, psi1=None, psi2=None, **kwargs): """ This is the standard part, which usually belongs in parameters_changed. For automatic handling of subsampling (such as missing_data, stochastics etc....
[ "This", "is", "the", "standard", "part", "which", "usually", "belongs", "in", "parameters_changed", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/sparse_gp_minibatch.py#L88-L108
[ "def", "_inner_parameters_changed", "(", "self", ",", "kern", ",", "X", ",", "Z", ",", "likelihood", ",", "Y", ",", "Y_metadata", ",", "Lm", "=", "None", ",", "dL_dKmm", "=", "None", ",", "psi0", "=", "None", ",", "psi1", "=", "None", ",", "psi2", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPMiniBatch._inner_take_over_or_update
This is for automatic updates of values in the inner loop of missing data handling. Both arguments are dictionaries and the values in full_values will be updated by the current_gradients. If a key from current_values does not exist in full_values, it will be initialized to the value in ...
GPy/models/sparse_gp_minibatch.py
def _inner_take_over_or_update(self, full_values=None, current_values=None, value_indices=None): """ This is for automatic updates of values in the inner loop of missing data handling. Both arguments are dictionaries and the values in full_values will be updated by the current_gradients....
def _inner_take_over_or_update(self, full_values=None, current_values=None, value_indices=None): """ This is for automatic updates of values in the inner loop of missing data handling. Both arguments are dictionaries and the values in full_values will be updated by the current_gradients....
[ "This", "is", "for", "automatic", "updates", "of", "values", "in", "the", "inner", "loop", "of", "missing", "data", "handling", ".", "Both", "arguments", "are", "dictionaries", "and", "the", "values", "in", "full_values", "will", "be", "updated", "by", "the"...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/sparse_gp_minibatch.py#L110-L147
[ "def", "_inner_take_over_or_update", "(", "self", ",", "full_values", "=", "None", ",", "current_values", "=", "None", ",", "value_indices", "=", "None", ")", ":", "for", "key", "in", "current_values", ".", "keys", "(", ")", ":", "if", "value_indices", "is",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPMiniBatch._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/sparse_gp_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. """ if self.has_uncertain_inputs(): #gradients wrt kernel dL_dKmm = full_values['dL_dKmm']...
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. """ if self.has_uncertain_inputs(): #gradients wrt kernel dL_dKmm = full_values['dL_dKmm']...
[ "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/sparse_gp_minibatch.py#L159-L198
[ "def", "_outer_values_update", "(", "self", ",", "full_values", ")", ":", "if", "self", ".", "has_uncertain_inputs", "(", ")", ":", "#gradients wrt kernel", "dL_dKmm", "=", "full_values", "[", "'dL_dKmm'", "]", "self", ".", "kern", ".", "update_gradients_full", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPMiniBatch._outer_init_full_values
If full_values has indices in values_indices, we might want to initialize the full_values differently, so that subsetting is possible. Here you can initialize the full_values for the values needed. Keep in mind, that if a key does not exist in full_values when updating values, it will ...
GPy/models/sparse_gp_minibatch.py
def _outer_init_full_values(self): """ If full_values has indices in values_indices, we might want to initialize the full_values differently, so that subsetting is possible. Here you can initialize the full_values for the values needed. Keep in mind, that if a key does not exis...
def _outer_init_full_values(self): """ If full_values has indices in values_indices, we might want to initialize the full_values differently, so that subsetting is possible. Here you can initialize the full_values for the values needed. Keep in mind, that if a key does not exis...
[ "If", "full_values", "has", "indices", "in", "values_indices", "we", "might", "want", "to", "initialize", "the", "full_values", "differently", "so", "that", "subsetting", "is", "possible", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/sparse_gp_minibatch.py#L200-L221
[ "def", "_outer_init_full_values", "(", "self", ")", ":", "retd", "=", "dict", "(", "dL_dKmm", "=", "np", ".", "zeros", "(", "(", "self", ".", "Z", ".", "shape", "[", "0", "]", ",", "self", ".", "Z", ".", "shape", "[", "0", "]", ")", ")", ")", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPClassification.to_dict
Store the object into a json serializable dictionary :param boolean save_data: if true, it adds the data self.X and self.Y to the dictionary :return dict: json serializable dictionary containing the needed information to instantiate the object
GPy/models/sparse_gp_classification.py
def to_dict(self, save_data=True): """ Store the object into a json serializable dictionary :param boolean save_data: if true, it adds the data self.X and self.Y to the dictionary :return dict: json serializable dictionary containing the needed information to instantiate the object ...
def to_dict(self, save_data=True): """ Store the object into a json serializable dictionary :param boolean save_data: if true, it adds the data self.X and self.Y to the dictionary :return dict: json serializable dictionary containing the needed information to instantiate the object ...
[ "Store", "the", "object", "into", "a", "json", "serializable", "dictionary" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/sparse_gp_classification.py#L58-L67
[ "def", "to_dict", "(", "self", ",", "save_data", "=", "True", ")", ":", "model_dict", "=", "super", "(", "SparseGPClassification", ",", "self", ")", ".", "to_dict", "(", "save_data", ")", "model_dict", "[", "\"class\"", "]", "=", "\"GPy.models.SparseGPClassifi...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
SparseGPClassification.from_dict
Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_dict method. :type data: tuple(:class:`np.ndarray`, :class:`np....
GPy/models/sparse_gp_classification.py
def from_dict(input_dict, data=None): """ Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_dict method. ...
def from_dict(input_dict, data=None): """ Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_dict method. ...
[ "Instantiate", "an", "SparseGPClassification", "object", "using", "the", "information", "in", "input_dict", "(", "built", "by", "the", "to_dict", "method", ")", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/models/sparse_gp_classification.py#L76-L89
[ "def", "from_dict", "(", "input_dict", ",", "data", "=", "None", ")", ":", "import", "GPy", "m", "=", "GPy", ".", "core", ".", "model", ".", "Model", ".", "from_dict", "(", "input_dict", ",", "data", ")", "from", "copy", "import", "deepcopy", "sparse_g...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.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/likelihoods/gaussian.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/likelihoods/gaussian.py#L49-L61
[ "def", "to_dict", "(", "self", ")", ":", "input_dict", "=", "super", "(", "Gaussian", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.likelihoods.Gaussian\"", "input_dict", "[", "\"variance\"", "]", "=",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.moments_match_ep
Moments match of the marginal approximation in EP algorithm :param i: number of observation (int) :param tau_i: precision of the cavity distribution (float) :param v_i: mean/variance of the cavity distribution (float)
GPy/likelihoods/gaussian.py
def moments_match_ep(self, data_i, tau_i, v_i, Y_metadata_i=None): """ Moments match of the marginal approximation in EP algorithm :param i: number of observation (int) :param tau_i: precision of the cavity distribution (float) :param v_i: mean/variance of the cavity distributio...
def moments_match_ep(self, data_i, tau_i, v_i, Y_metadata_i=None): """ Moments match of the marginal approximation in EP algorithm :param i: number of observation (int) :param tau_i: precision of the cavity distribution (float) :param v_i: mean/variance of the cavity distributio...
[ "Moments", "match", "of", "the", "marginal", "approximation", "in", "EP", "algorithm" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L88-L100
[ "def", "moments_match_ep", "(", "self", ",", "data_i", ",", "tau_i", ",", "v_i", ",", "Y_metadata_i", "=", "None", ")", ":", "sigma2_hat", "=", "1.", "/", "(", "1.", "/", "self", ".", "variance", "+", "tau_i", ")", "mu_hat", "=", "sigma2_hat", "*", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.pdf_link
Likelihood function given link(f) .. math:: \\ln p(y_{i}|\\lambda(f_{i})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_f: latent variables link(f) :type link_f: Nx1 array :param ...
GPy/likelihoods/gaussian.py
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: \\ln p(y_{i}|\\lambda(f_{i})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_f: late...
def pdf_link(self, link_f, y, Y_metadata=None): """ Likelihood function given link(f) .. math:: \\ln p(y_{i}|\\lambda(f_{i})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_f: late...
[ "Likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L121-L137
[ "def", "pdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "#Assumes no covariance, exp, sum, log for numerical stability", "return", "np", ".", "exp", "(", "np", ".", "sum", "(", "np", ".", "log", "(", "stats", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.logpdf_link
Log likelihood function given link(f) .. math:: \\ln p(y_{i}|\\lambda(f_{i})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_f: latent variables link(f) :type link_f: Nx1 array :pa...
GPy/likelihoods/gaussian.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})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_...
def logpdf_link(self, link_f, y, Y_metadata=None): """ Log likelihood function given link(f) .. math:: \\ln p(y_{i}|\\lambda(f_{i})) = -\\frac{N \\ln 2\\pi}{2} - \\frac{\\ln |K|}{2} - \\frac{(y_{i} - \\lambda(f_{i}))^{T}\\sigma^{-2}(y_{i} - \\lambda(f_{i}))}{2} :param link_...
[ "Log", "likelihood", "function", "given", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L139-L155
[ "def", "logpdf_link", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "ln_det_cov", "=", "np", ".", "log", "(", "self", ".", "variance", ")", "return", "-", "(", "1.0", "/", "(", "2", "*", "self", ".", "variance", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.dlogpdf_dlink
Gradient of the pdf at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\frac{1}{\\sigma^{2}}(y_{i} - \\lambda(f_{i})) :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array ...
GPy/likelihoods/gaussian.py
def dlogpdf_dlink(self, link_f, y, Y_metadata=None): """ Gradient of the pdf at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\frac{1}{\\sigma^{2}}(y_{i} - \\lambda(f_{i})) :param link_f: latent variables link(f) :...
def dlogpdf_dlink(self, link_f, y, Y_metadata=None): """ Gradient of the pdf at y, given link(f) w.r.t link(f) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)} = \\frac{1}{\\sigma^{2}}(y_{i} - \\lambda(f_{i})) :param link_f: latent variables link(f) :...
[ "Gradient", "of", "the", "pdf", "at", "y", "given", "link", "(", "f", ")", "w", ".", "r", ".", "t", "link", "(", "f", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L157-L174
[ "def", "dlogpdf_dlink", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "s2_i", "=", "1.0", "/", "self", ".", "variance", "grad", "=", "s2_i", "*", "y", "-", "s2_i", "*", "link_f", "return", "grad" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.d2logpdf_dlink2
Hessian at y, given link_f, w.r.t link_f. i.e. second derivative logpdf at y given link(f_i) 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}f} = -\\frac{1}{\\sigma^{2}} :param link_f: ...
GPy/likelihoods/gaussian.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) 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}|\...
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) 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}|\...
[ "Hessian", "at", "y", "given", "link_f", "w", ".", "r", ".", "t", "link_f", ".", "i", ".", "e", ".", "second", "derivative", "logpdf", "at", "y", "given", "link", "(", "f_i", ")", "link", "(", "f_j", ")", "w", ".", "r", ".", "t", "link", "(", ...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L176-L201
[ "def", "d2logpdf_dlink2", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "N", "=", "y", ".", "shape", "[", "0", "]", "D", "=", "link_f", ".", "shape", "[", "1", "]", "hess", "=", "-", "(", "1.0", "/", "self", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.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)} = 0 :param link_f: latent variables link(f) :type link_f: Nx1 array :param y: data :type y: Nx1 array :par...
GPy/likelihoods/gaussian.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)} = 0 :param link_f: latent variables link(f) :type link_...
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)} = 0 :param link_f: latent variables link(f) :type link_...
[ "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/gaussian.py#L203-L221
[ "def", "d3logpdf_dlink3", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "N", "=", "y", ".", "shape", "[", "0", "]", "D", "=", "link_f", ".", "shape", "[", "1", "]", "d3logpdf_dlink3", "=", "np", ".", "zeros", "("...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.dlogpdf_link_dvar
Gradient of the log-likelihood function at y given link(f), w.r.t variance parameter (noise_variance) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\sigma^{2}} = -\\frac{N}{2\\sigma^{2}} + \\frac{(y_{i} - \\lambda(f_{i}))^{2}}{2\\sigma^{4}} :param link_f: latent variables link(f) ...
GPy/likelihoods/gaussian.py
def dlogpdf_link_dvar(self, link_f, y, Y_metadata=None): """ Gradient of the log-likelihood function at y given link(f), w.r.t variance parameter (noise_variance) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\sigma^{2}} = -\\frac{N}{2\\sigma^{2}} + \\frac{(y_{i} - \\lambda(f_...
def dlogpdf_link_dvar(self, link_f, y, Y_metadata=None): """ Gradient of the log-likelihood function at y given link(f), w.r.t variance parameter (noise_variance) .. math:: \\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\sigma^{2}} = -\\frac{N}{2\\sigma^{2}} + \\frac{(y_{i} - \\lambda(f_...
[ "Gradient", "of", "the", "log", "-", "likelihood", "function", "at", "y", "given", "link", "(", "f", ")", "w", ".", "r", ".", "t", "variance", "parameter", "(", "noise_variance", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L223-L241
[ "def", "dlogpdf_link_dvar", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "e", "=", "y", "-", "link_f", "s_4", "=", "1.0", "/", "(", "self", ".", "variance", "**", "2", ")", "dlik_dsigma", "=", "-", "0.5", "/", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.dlogpdf_dlink_dvar
Derivative of the dlogpdf_dlink w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)}) = \\frac{1}{\\sigma^{4}}(-y_{i} + \\lambda(f_{i})) :param link_f: latent variables link(f) :type link_f: Nx1 array ...
GPy/likelihoods/gaussian.py
def dlogpdf_dlink_dvar(self, link_f, y, Y_metadata=None): """ Derivative of the dlogpdf_dlink w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)}) = \\frac{1}{\\sigma^{4}}(-y_{i} + \\lambda(f_{i})) ...
def dlogpdf_dlink_dvar(self, link_f, y, Y_metadata=None): """ Derivative of the dlogpdf_dlink w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d \\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)}) = \\frac{1}{\\sigma^{4}}(-y_{i} + \\lambda(f_{i})) ...
[ "Derivative", "of", "the", "dlogpdf_dlink", "w", ".", "r", ".", "t", "variance", "parameter", "(", "noise_variance", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L243-L260
[ "def", "dlogpdf_dlink_dvar", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "s_4", "=", "1.0", "/", "(", "self", ".", "variance", "**", "2", ")", "dlik_grad_dsigma", "=", "-", "s_4", "*", "y", "+", "s_4", "*", "link...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.d2logpdf_dlink2_dvar
Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\\lambda(f_{i}))}{d^{2}\\lambda(f)}) = \\frac{1}{\\sigma^{4}} :param link_f: latent variables link(f) :type link_f: Nx1 array :par...
GPy/likelihoods/gaussian.py
def d2logpdf_dlink2_dvar(self, link_f, y, Y_metadata=None): """ Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\\lambda(f_{i}))}{d^{2}\\lambda(f)}) = \\frac{1}{\\sigma^{4}} :par...
def d2logpdf_dlink2_dvar(self, link_f, y, Y_metadata=None): """ Gradient of the hessian (d2logpdf_dlink2) w.r.t variance parameter (noise_variance) .. math:: \\frac{d}{d\\sigma^{2}}(\\frac{d^{2} \\ln p(y_{i}|\\lambda(f_{i}))}{d^{2}\\lambda(f)}) = \\frac{1}{\\sigma^{4}} :par...
[ "Gradient", "of", "the", "hessian", "(", "d2logpdf_dlink2", ")", "w", ".", "r", ".", "t", "variance", "parameter", "(", "noise_variance", ")" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L262-L281
[ "def", "d2logpdf_dlink2_dvar", "(", "self", ",", "link_f", ",", "y", ",", "Y_metadata", "=", "None", ")", ":", "s_4", "=", "1.0", "/", "(", "self", ".", "variance", "**", "2", ")", "N", "=", "y", ".", "shape", "[", "0", "]", "D", "=", "link_f", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.samples
Returns a set of samples of observations based on a given value of the latent variable. :param gp: latent variable
GPy/likelihoods/gaussian.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() #orig_shape = gp.shape gp = gp.flatten() Ysi...
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() #orig_shape = gp.shape gp = gp.flatten() Ysi...
[ "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/gaussian.py#L316-L327
[ "def", "samples", "(", "self", ",", "gp", ",", "Y_metadata", "=", "None", ")", ":", "orig_shape", "=", "gp", ".", "shape", "gp", "=", "gp", ".", "flatten", "(", ")", "#orig_shape = gp.shape", "gp", "=", "gp", ".", "flatten", "(", ")", "Ysim", "=", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
Gaussian.log_predictive_density
assumes independence
GPy/likelihoods/gaussian.py
def log_predictive_density(self, y_test, mu_star, var_star, Y_metadata=None): """ assumes independence """ v = var_star + self.variance return -0.5*np.log(2*np.pi) -0.5*np.log(v) - 0.5*np.square(y_test - mu_star)/v
def log_predictive_density(self, y_test, mu_star, var_star, Y_metadata=None): """ assumes independence """ v = var_star + self.variance return -0.5*np.log(2*np.pi) -0.5*np.log(v) - 0.5*np.square(y_test - mu_star)/v
[ "assumes", "independence" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/likelihoods/gaussian.py#L329-L334
[ "def", "log_predictive_density", "(", "self", ",", "y_test", ",", "mu_star", ",", "var_star", ",", "Y_metadata", "=", "None", ")", ":", "v", "=", "var_star", "+", "self", ".", "variance", "return", "-", "0.5", "*", "np", ".", "log", "(", "2", "*", "n...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.to_dict
Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :param boolean save_data: if true, it adds the training data self.X and self.Y to the dictionary :return dict: json serializable dictionary containing the needed informati...
GPy/core/gp.py
def to_dict(self, save_data=True): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :param boolean save_data: if true, it adds the training data self.X and self.Y to the dictionary :return dict: json ...
def to_dict(self, save_data=True): """ Convert the object into a json serializable dictionary. Note: It uses the private method _save_to_input_dict of the parent. :param boolean save_data: if true, it adds the training data self.X and self.Y to the dictionary :return dict: json ...
[ "Convert", "the", "object", "into", "a", "json", "serializable", "dictionary", ".", "Note", ":", "It", "uses", "the", "private", "method", "_save_to_input_dict", "of", "the", "parent", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L112-L144
[ "def", "to_dict", "(", "self", ",", "save_data", "=", "True", ")", ":", "input_dict", "=", "super", "(", "GP", ",", "self", ")", ".", "_save_to_input_dict", "(", ")", "input_dict", "[", "\"class\"", "]", "=", "\"GPy.core.GP\"", "if", "not", "save_data", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.set_XY
Set the input / output data of the model This is useful if we wish to change our existing data but maintain the same model :param X: input observations :type X: np.ndarray :param Y: output observations :type Y: np.ndarray
GPy/core/gp.py
def set_XY(self, X=None, Y=None): """ Set the input / output data of the model This is useful if we wish to change our existing data but maintain the same model :param X: input observations :type X: np.ndarray :param Y: output observations :type Y: np.ndarray ...
def set_XY(self, X=None, Y=None): """ Set the input / output data of the model This is useful if we wish to change our existing data but maintain the same model :param X: input observations :type X: np.ndarray :param Y: output observations :type Y: np.ndarray ...
[ "Set", "the", "input", "/", "output", "data", "of", "the", "model", "This", "is", "useful", "if", "we", "wish", "to", "change", "our", "existing", "data", "but", "maintain", "the", "same", "model" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L202-L238
[ "def", "set_XY", "(", "self", ",", "X", "=", "None", ",", "Y", "=", "None", ")", ":", "self", ".", "update_model", "(", "False", ")", "if", "Y", "is", "not", "None", ":", "if", "self", ".", "normalizer", "is", "not", "None", ":", "self", ".", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict
Predict the function(s) at the new point(s) Xnew. This includes the likelihood variance added to the predicted underlying function (usually referred to as f). In order to predict without adding in the likelihood give `include_likelihood=False`, or refer to self.predict_noiseless(). ...
GPy/core/gp.py
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None, likelihood=None, include_likelihood=True): """ Predict the function(s) at the new point(s) Xnew. This includes the likelihood variance added to the predicted underlying function (usually referred to as f)...
def predict(self, Xnew, full_cov=False, Y_metadata=None, kern=None, likelihood=None, include_likelihood=True): """ Predict the function(s) at the new point(s) Xnew. This includes the likelihood variance added to the predicted underlying function (usually referred to as f)...
[ "Predict", "the", "function", "(", "s", ")", "at", "the", "new", "point", "(", "s", ")", "Xnew", ".", "This", "includes", "the", "likelihood", "variance", "added", "to", "the", "predicted", "underlying", "function", "(", "usually", "referred", "to", "as", ...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L297-L354
[ "def", "predict", "(", "self", ",", "Xnew", ",", "full_cov", "=", "False", ",", "Y_metadata", "=", "None", ",", "kern", "=", "None", ",", "likelihood", "=", "None", ",", "include_likelihood", "=", "True", ")", ":", "# Predict the latent function values", "me...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict_noiseless
Convenience function to predict the underlying function of the GP (often referred to as f) without adding the likelihood variance on the prediction function. This is most likely what you want to use for your predictions. :param Xnew: The points at which to make a prediction :ty...
GPy/core/gp.py
def predict_noiseless(self, Xnew, full_cov=False, Y_metadata=None, kern=None): """ Convenience function to predict the underlying function of the GP (often referred to as f) without adding the likelihood variance on the prediction function. This is most likely what you want to ...
def predict_noiseless(self, Xnew, full_cov=False, Y_metadata=None, kern=None): """ Convenience function to predict the underlying function of the GP (often referred to as f) without adding the likelihood variance on the prediction function. This is most likely what you want to ...
[ "Convenience", "function", "to", "predict", "the", "underlying", "function", "of", "the", "GP", "(", "often", "referred", "to", "as", "f", ")", "without", "adding", "the", "likelihood", "variance", "on", "the", "prediction", "function", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L356-L382
[ "def", "predict_noiseless", "(", "self", ",", "Xnew", ",", "full_cov", "=", "False", ",", "Y_metadata", "=", "None", ",", "kern", "=", "None", ")", ":", "return", "self", ".", "predict", "(", "Xnew", ",", "full_cov", ",", "Y_metadata", ",", "kern", ","...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict_quantiles
Get the predictive quantiles around the prediction at X :param X: The points at which to make a prediction :type X: np.ndarray (Xnew x self.input_dim) :param quantiles: tuple of quantiles, default is (2.5, 97.5) which is the 95% interval :type quantiles: tuple :param kern: optio...
GPy/core/gp.py
def predict_quantiles(self, X, quantiles=(2.5, 97.5), Y_metadata=None, kern=None, likelihood=None): """ Get the predictive quantiles around the prediction at X :param X: The points at which to make a prediction :type X: np.ndarray (Xnew x self.input_dim) :param quantiles: tuple ...
def predict_quantiles(self, X, quantiles=(2.5, 97.5), Y_metadata=None, kern=None, likelihood=None): """ Get the predictive quantiles around the prediction at X :param X: The points at which to make a prediction :type X: np.ndarray (Xnew x self.input_dim) :param quantiles: tuple ...
[ "Get", "the", "predictive", "quantiles", "around", "the", "prediction", "at", "X" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L384-L405
[ "def", "predict_quantiles", "(", "self", ",", "X", ",", "quantiles", "=", "(", "2.5", ",", "97.5", ")", ",", "Y_metadata", "=", "None", ",", "kern", "=", "None", ",", "likelihood", "=", "None", ")", ":", "m", ",", "v", "=", "self", ".", "_raw_predi...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predictive_gradients
Compute the derivatives of the predicted latent function with respect to X* Given a set of points at which to predict X* (size [N*,Q]), compute the derivatives of the mean and variance. Resulting arrays are sized: dmu_dX* -- [N*, Q ,D], where D is the number of output in this GP ...
GPy/core/gp.py
def predictive_gradients(self, Xnew, kern=None): """ Compute the derivatives of the predicted latent function with respect to X* Given a set of points at which to predict X* (size [N*,Q]), compute the derivatives of the mean and variance. Resulting arrays are sized: ...
def predictive_gradients(self, Xnew, kern=None): """ Compute the derivatives of the predicted latent function with respect to X* Given a set of points at which to predict X* (size [N*,Q]), compute the derivatives of the mean and variance. Resulting arrays are sized: ...
[ "Compute", "the", "derivatives", "of", "the", "predicted", "latent", "function", "with", "respect", "to", "X", "*" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L407-L454
[ "def", "predictive_gradients", "(", "self", ",", "Xnew", ",", "kern", "=", "None", ")", ":", "if", "kern", "is", "None", ":", "kern", "=", "self", ".", "kern", "mean_jac", "=", "np", ".", "empty", "(", "(", "Xnew", ".", "shape", "[", "0", "]", ",...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict_jacobian
Compute the derivatives of the posterior of the GP. Given a set of points at which to predict X* (size [N*,Q]), compute the mean and variance of the derivative. Resulting arrays are sized: dL_dX* -- [N*, Q ,D], where D is the number of output in this GP (usually one). Note that this...
GPy/core/gp.py
def predict_jacobian(self, Xnew, kern=None, full_cov=False): """ Compute the derivatives of the posterior of the GP. Given a set of points at which to predict X* (size [N*,Q]), compute the mean and variance of the derivative. Resulting arrays are sized: dL_dX* -- [N*, Q ,D], w...
def predict_jacobian(self, Xnew, kern=None, full_cov=False): """ Compute the derivatives of the posterior of the GP. Given a set of points at which to predict X* (size [N*,Q]), compute the mean and variance of the derivative. Resulting arrays are sized: dL_dX* -- [N*, Q ,D], w...
[ "Compute", "the", "derivatives", "of", "the", "posterior", "of", "the", "GP", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L456-L519
[ "def", "predict_jacobian", "(", "self", ",", "Xnew", ",", "kern", "=", "None", ",", "full_cov", "=", "False", ")", ":", "if", "kern", "is", "None", ":", "kern", "=", "self", ".", "kern", "mean_jac", "=", "np", ".", "empty", "(", "(", "Xnew", ".", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict_wishart_embedding
Predict the wishart embedding G of the GP. This is the density of the input of the GP defined by the probabilistic function mapping f. G = J_mean.T*J_mean + output_dim*J_cov. :param array-like Xnew: The points at which to evaluate the magnification. :param :py:class:`~GPy.kern.Kern` ker...
GPy/core/gp.py
def predict_wishart_embedding(self, Xnew, kern=None, mean=True, covariance=True): """ Predict the wishart embedding G of the GP. This is the density of the input of the GP defined by the probabilistic function mapping f. G = J_mean.T*J_mean + output_dim*J_cov. :param array-like ...
def predict_wishart_embedding(self, Xnew, kern=None, mean=True, covariance=True): """ Predict the wishart embedding G of the GP. This is the density of the input of the GP defined by the probabilistic function mapping f. G = J_mean.T*J_mean + output_dim*J_cov. :param array-like ...
[ "Predict", "the", "wishart", "embedding", "G", "of", "the", "GP", ".", "This", "is", "the", "density", "of", "the", "input", "of", "the", "GP", "defined", "by", "the", "probabilistic", "function", "mapping", "f", ".", "G", "=", "J_mean", ".", "T", "*",...
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L521-L550
[ "def", "predict_wishart_embedding", "(", "self", ",", "Xnew", ",", "kern", "=", "None", ",", "mean", "=", "True", ",", "covariance", "=", "True", ")", ":", "if", "kern", "is", "None", ":", "kern", "=", "self", ".", "kern", "mu_jac", ",", "var_jac", "...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.predict_magnification
Predict the magnification factor as sqrt(det(G)) for each point N in Xnew. :param bool mean: whether to include the mean of the wishart embedding. :param bool covariance: whether to include the covariance of the wishart embedding. :param array-like dimensions: which dimensions...
GPy/core/gp.py
def predict_magnification(self, Xnew, kern=None, mean=True, covariance=True, dimensions=None): """ Predict the magnification factor as sqrt(det(G)) for each point N in Xnew. :param bool mean: whether to include the mean of the wishart embedding. :param bool covariance:...
def predict_magnification(self, Xnew, kern=None, mean=True, covariance=True, dimensions=None): """ Predict the magnification factor as sqrt(det(G)) for each point N in Xnew. :param bool mean: whether to include the mean of the wishart embedding. :param bool covariance:...
[ "Predict", "the", "magnification", "factor", "as" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L556-L579
[ "def", "predict_magnification", "(", "self", ",", "Xnew", ",", "kern", "=", "None", ",", "mean", "=", "True", ",", "covariance", "=", "True", ",", "dimensions", "=", "None", ")", ":", "G", "=", "self", ".", "predict_wishart_embedding", "(", "Xnew", ",", ...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.posterior_samples_f
Samples the posterior GP at the points X. :param X: The points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim) :param size: the number of a posteriori samples. :type size: int. :returns: set of simulations :rtype: np.ndarray (Nnew x D x samples)
GPy/core/gp.py
def posterior_samples_f(self,X, size=10, **predict_kwargs): """ Samples the posterior GP at the points X. :param X: The points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim) :param size: the number of a posteriori samples. :type size: int. ...
def posterior_samples_f(self,X, size=10, **predict_kwargs): """ Samples the posterior GP at the points X. :param X: The points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim) :param size: the number of a posteriori samples. :type size: int. ...
[ "Samples", "the", "posterior", "GP", "at", "the", "points", "X", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L581-L609
[ "def", "posterior_samples_f", "(", "self", ",", "X", ",", "size", "=", "10", ",", "*", "*", "predict_kwargs", ")", ":", "predict_kwargs", "[", "\"full_cov\"", "]", "=", "True", "# Always use the full covariance for posterior samples. ", "m", ",", "v", "=", "self...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.posterior_samples
Samples the posterior GP at the points X. :param X: the points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim.) :param size: the number of a posteriori samples. :type size: int. :param noise_model: for mixed noise likelihood, the noise model to use in t...
GPy/core/gp.py
def posterior_samples(self, X, size=10, Y_metadata=None, likelihood=None, **predict_kwargs): """ Samples the posterior GP at the points X. :param X: the points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim.) :param size: the number of a posteriori samp...
def posterior_samples(self, X, size=10, Y_metadata=None, likelihood=None, **predict_kwargs): """ Samples the posterior GP at the points X. :param X: the points at which to take the samples. :type X: np.ndarray (Nnew x self.input_dim.) :param size: the number of a posteriori samp...
[ "Samples", "the", "posterior", "GP", "at", "the", "points", "X", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L611-L632
[ "def", "posterior_samples", "(", "self", ",", "X", ",", "size", "=", "10", ",", "Y_metadata", "=", "None", ",", "likelihood", "=", "None", ",", "*", "*", "predict_kwargs", ")", ":", "fsim", "=", "self", ".", "posterior_samples_f", "(", "X", ",", "size"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.optimize
Optimize the model using self.log_likelihood and self.log_likelihood_gradient, as well as self.priors. kwargs are passed to the optimizer. They can be: :param max_iters: maximum number of function evaluations :type max_iters: int :param messages: whether to display during optimisation ...
GPy/core/gp.py
def optimize(self, optimizer=None, start=None, messages=False, max_iters=1000, ipython_notebook=True, clear_after_finish=False, **kwargs): """ Optimize the model using self.log_likelihood and self.log_likelihood_gradient, as well as self.priors. kwargs are passed to the optimizer. They can be: ...
def optimize(self, optimizer=None, start=None, messages=False, max_iters=1000, ipython_notebook=True, clear_after_finish=False, **kwargs): """ Optimize the model using self.log_likelihood and self.log_likelihood_gradient, as well as self.priors. kwargs are passed to the optimizer. They can be: ...
[ "Optimize", "the", "model", "using", "self", ".", "log_likelihood", "and", "self", ".", "log_likelihood_gradient", "as", "well", "as", "self", ".", "priors", ".", "kwargs", "are", "passed", "to", "the", "optimizer", ".", "They", "can", "be", ":" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L643-L664
[ "def", "optimize", "(", "self", ",", "optimizer", "=", "None", ",", "start", "=", "None", ",", "messages", "=", "False", ",", "max_iters", "=", "1000", ",", "ipython_notebook", "=", "True", ",", "clear_after_finish", "=", "False", ",", "*", "*", "kwargs"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.infer_newX
Infer X for the new observed data *Y_new*. :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) :type optimize: boolean :return: a tuple containing the posterior estimation of X ...
GPy/core/gp.py
def infer_newX(self, Y_new, optimize=True): """ Infer X for the new observed data *Y_new*. :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) :type optimize: boolean ...
def infer_newX(self, Y_new, optimize=True): """ Infer X for the new observed data *Y_new*. :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) :type optimize: boolean ...
[ "Infer", "X", "for", "the", "new", "observed", "data", "*", "Y_new", "*", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L666-L678
[ "def", "infer_newX", "(", "self", ",", "Y_new", ",", "optimize", "=", "True", ")", ":", "from", ".", ".", "inference", ".", "latent_function_inference", ".", "inferenceX", "import", "infer_newX", "return", "infer_newX", "(", "self", ",", "Y_new", ",", "optim...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.log_predictive_density
Calculation of the log predictive density .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_test: (Nx1) array :param y_test: test observations (y_{*}) :type y_test: (Nx1) array :param Y_metadata...
GPy/core/gp.py
def log_predictive_density(self, x_test, y_test, Y_metadata=None): """ Calculation of the log predictive density .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_test: (Nx1) array :param y_test...
def log_predictive_density(self, x_test, y_test, Y_metadata=None): """ Calculation of the log predictive density .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_test: (Nx1) array :param y_test...
[ "Calculation", "of", "the", "log", "predictive", "density" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L680-L694
[ "def", "log_predictive_density", "(", "self", ",", "x_test", ",", "y_test", ",", "Y_metadata", "=", "None", ")", ":", "mu_star", ",", "var_star", "=", "self", ".", "_raw_predict", "(", "x_test", ")", "return", "self", ".", "likelihood", ".", "log_predictive_...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.log_predictive_density_sampling
Calculation of the log predictive density by sampling .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_test: (Nx1) array :param y_test: test observations (y_{*}) :type y_test: (Nx1) array :para...
GPy/core/gp.py
def log_predictive_density_sampling(self, x_test, y_test, Y_metadata=None, num_samples=1000): """ Calculation of the log predictive density by sampling .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_...
def log_predictive_density_sampling(self, x_test, y_test, Y_metadata=None, num_samples=1000): """ Calculation of the log predictive density by sampling .. math: p(y_{*}|D) = p(y_{*}|f_{*})p(f_{*}|\mu_{*}\\sigma^{2}_{*}) :param x_test: test locations (x_{*}) :type x_...
[ "Calculation", "of", "the", "log", "predictive", "density", "by", "sampling" ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L696-L712
[ "def", "log_predictive_density_sampling", "(", "self", ",", "x_test", ",", "y_test", ",", "Y_metadata", "=", "None", ",", "num_samples", "=", "1000", ")", ":", "mu_star", ",", "var_star", "=", "self", ".", "_raw_predict", "(", "x_test", ")", "return", "self"...
54c32d79d289d622fb18b898aee65a2a431d90cf
train
GP.posterior_covariance_between_points
Computes the posterior covariance between points. :param X1: some input observations :param X2: other input observations
GPy/core/gp.py
def posterior_covariance_between_points(self, X1, X2): """ Computes the posterior covariance between points. :param X1: some input observations :param X2: other input observations """ return self.posterior.covariance_between_points(self.kern, self.X, X1, X2)
def posterior_covariance_between_points(self, X1, X2): """ Computes the posterior covariance between points. :param X1: some input observations :param X2: other input observations """ return self.posterior.covariance_between_points(self.kern, self.X, X1, X2)
[ "Computes", "the", "posterior", "covariance", "between", "points", "." ]
SheffieldML/GPy
python
https://github.com/SheffieldML/GPy/blob/54c32d79d289d622fb18b898aee65a2a431d90cf/GPy/core/gp.py#L714-L721
[ "def", "posterior_covariance_between_points", "(", "self", ",", "X1", ",", "X2", ")", ":", "return", "self", ".", "posterior", ".", "covariance_between_points", "(", "self", ".", "kern", ",", "self", ".", "X", ",", "X1", ",", "X2", ")" ]
54c32d79d289d622fb18b898aee65a2a431d90cf
train
generate_dims_coords
Generate default dimensions and coordinates for a variable. Parameters ---------- shape : tuple[int] Shape of the variable var_name : str Name of the variable. Used in the default name, if necessary dims : list List of dimensions for the variable coords : dict[str] -> li...
arviz/data/base.py
def generate_dims_coords(shape, var_name, dims=None, coords=None, default_dims=None): """Generate default dimensions and coordinates for a variable. Parameters ---------- shape : tuple[int] Shape of the variable var_name : str Name of the variable. Used in the default name, if neces...
def generate_dims_coords(shape, var_name, dims=None, coords=None, default_dims=None): """Generate default dimensions and coordinates for a variable. Parameters ---------- shape : tuple[int] Shape of the variable var_name : str Name of the variable. Used in the default name, if neces...
[ "Generate", "default", "dimensions", "and", "coordinates", "for", "a", "variable", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/base.py#L30-L82
[ "def", "generate_dims_coords", "(", "shape", ",", "var_name", ",", "dims", "=", "None", ",", "coords", "=", "None", ",", "default_dims", "=", "None", ")", ":", "if", "default_dims", "is", "None", ":", "default_dims", "=", "[", "]", "if", "dims", "is", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
numpy_to_data_array
Convert a numpy array to an xarray.DataArray. The first two dimensions will be (chain, draw), and any remaining dimensions will be "shape". If the numpy array is 1d, this dimension is interpreted as draw If the numpy array is 2d, it is interpreted as (chain, draw) If the numpy array is 3 or more di...
arviz/data/base.py
def numpy_to_data_array(ary, *, var_name="data", coords=None, dims=None): """Convert a numpy array to an xarray.DataArray. The first two dimensions will be (chain, draw), and any remaining dimensions will be "shape". If the numpy array is 1d, this dimension is interpreted as draw If the numpy array...
def numpy_to_data_array(ary, *, var_name="data", coords=None, dims=None): """Convert a numpy array to an xarray.DataArray. The first two dimensions will be (chain, draw), and any remaining dimensions will be "shape". If the numpy array is 1d, this dimension is interpreted as draw If the numpy array...
[ "Convert", "a", "numpy", "array", "to", "an", "xarray", ".", "DataArray", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/base.py#L85-L143
[ "def", "numpy_to_data_array", "(", "ary", ",", "*", ",", "var_name", "=", "\"data\"", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "# manage and transform copies", "default_dims", "=", "[", "\"chain\"", ",", "\"draw\"", "]", "ary", "=", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
dict_to_dataset
Convert a dictionary of numpy arrays to an xarray.Dataset. Parameters ---------- data : dict[str] -> ndarray Data to convert. Keys are variable names. attrs : dict Json serializable metadata to attach to the dataset, in addition to defaults. library : module Library used for...
arviz/data/base.py
def dict_to_dataset(data, *, attrs=None, library=None, coords=None, dims=None): """Convert a dictionary of numpy arrays to an xarray.Dataset. Parameters ---------- data : dict[str] -> ndarray Data to convert. Keys are variable names. attrs : dict Json serializable metadata to attach...
def dict_to_dataset(data, *, attrs=None, library=None, coords=None, dims=None): """Convert a dictionary of numpy arrays to an xarray.Dataset. Parameters ---------- data : dict[str] -> ndarray Data to convert. Keys are variable names. attrs : dict Json serializable metadata to attach...
[ "Convert", "a", "dictionary", "of", "numpy", "arrays", "to", "an", "xarray", ".", "Dataset", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/base.py#L146-L180
[ "def", "dict_to_dataset", "(", "data", ",", "*", ",", "attrs", "=", "None", ",", "library", "=", "None", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "if", "dims", "is", "None", ":", "dims", "=", "{", "}", "data_vars", "=", "{"...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
make_attrs
Make standard attributes to attach to xarray datasets. Parameters ---------- attrs : dict (optional) Additional attributes to add or overwrite Returns ------- dict attrs
arviz/data/base.py
def make_attrs(attrs=None, library=None): """Make standard attributes to attach to xarray datasets. Parameters ---------- attrs : dict (optional) Additional attributes to add or overwrite Returns ------- dict attrs """ default_attrs = {"created_at": datetime.datetim...
def make_attrs(attrs=None, library=None): """Make standard attributes to attach to xarray datasets. Parameters ---------- attrs : dict (optional) Additional attributes to add or overwrite Returns ------- dict attrs """ default_attrs = {"created_at": datetime.datetim...
[ "Make", "standard", "attributes", "to", "attach", "to", "xarray", "datasets", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/base.py#L183-L210
[ "def", "make_attrs", "(", "attrs", "=", "None", ",", "library", "=", "None", ")", ":", "default_attrs", "=", "{", "\"created_at\"", ":", "datetime", ".", "datetime", ".", "utcnow", "(", ")", ".", "isoformat", "(", ")", "}", "if", "library", "is", "not"...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
get_data_home
Return the path of the arviz data dir. This folder is used by some dataset loaders to avoid downloading the data several times. By default the data dir is set to a folder named 'arviz_data' in the user home folder. Alternatively, it can be set by the 'ARVIZ_DATA' environment variable or progr...
arviz/data/datasets.py
def get_data_home(data_home=None): """Return the path of the arviz data dir. This folder is used by some dataset loaders to avoid downloading the data several times. By default the data dir is set to a folder named 'arviz_data' in the user home folder. Alternatively, it can be set by the 'ARV...
def get_data_home(data_home=None): """Return the path of the arviz data dir. This folder is used by some dataset loaders to avoid downloading the data several times. By default the data dir is set to a folder named 'arviz_data' in the user home folder. Alternatively, it can be set by the 'ARV...
[ "Return", "the", "path", "of", "the", "arviz", "data", "dir", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/datasets.py#L68-L93
[ "def", "get_data_home", "(", "data_home", "=", "None", ")", ":", "if", "data_home", "is", "None", ":", "data_home", "=", "os", ".", "environ", ".", "get", "(", "\"ARVIZ_DATA\"", ",", "os", ".", "path", ".", "join", "(", "\"~\"", ",", "\"arviz_data\"", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_sha256
Calculate the sha256 hash of the file at path.
arviz/data/datasets.py
def _sha256(path): """Calculate the sha256 hash of the file at path.""" sha256hash = hashlib.sha256() chunk_size = 8192 with open(path, "rb") as buff: while True: buffer = buff.read(chunk_size) if not buffer: break sha256hash.update(buffer) ...
def _sha256(path): """Calculate the sha256 hash of the file at path.""" sha256hash = hashlib.sha256() chunk_size = 8192 with open(path, "rb") as buff: while True: buffer = buff.read(chunk_size) if not buffer: break sha256hash.update(buffer) ...
[ "Calculate", "the", "sha256", "hash", "of", "the", "file", "at", "path", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/datasets.py#L108-L118
[ "def", "_sha256", "(", "path", ")", ":", "sha256hash", "=", "hashlib", ".", "sha256", "(", ")", "chunk_size", "=", "8192", "with", "open", "(", "path", ",", "\"rb\"", ")", "as", "buff", ":", "while", "True", ":", "buffer", "=", "buff", ".", "read", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
load_arviz_data
Load a local or remote pre-made dataset. Run with no parameters to get a list of all available models. The directory to save to can also be set with the environement variable `ARVIZ_HOME`. The checksum of the dataset is checked against a hardcoded value to watch for data corruption. Run `az.clear...
arviz/data/datasets.py
def load_arviz_data(dataset=None, data_home=None): """Load a local or remote pre-made dataset. Run with no parameters to get a list of all available models. The directory to save to can also be set with the environement variable `ARVIZ_HOME`. The checksum of the dataset is checked against a hardco...
def load_arviz_data(dataset=None, data_home=None): """Load a local or remote pre-made dataset. Run with no parameters to get a list of all available models. The directory to save to can also be set with the environement variable `ARVIZ_HOME`. The checksum of the dataset is checked against a hardco...
[ "Load", "a", "local", "or", "remote", "pre", "-", "made", "dataset", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/datasets.py#L121-L167
[ "def", "load_arviz_data", "(", "dataset", "=", "None", ",", "data_home", "=", "None", ")", ":", "if", "dataset", "in", "LOCAL_DATASETS", ":", "resource", "=", "LOCAL_DATASETS", "[", "dataset", "]", "return", "from_netcdf", "(", "resource", ".", "filename", "...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
list_datasets
Get a string representation of all available datasets with descriptions.
arviz/data/datasets.py
def list_datasets(): """Get a string representation of all available datasets with descriptions.""" lines = [] for name, resource in itertools.chain(LOCAL_DATASETS.items(), REMOTE_DATASETS.items()): if isinstance(resource, LocalFileMetadata): location = "local: {}".format(resource.filen...
def list_datasets(): """Get a string representation of all available datasets with descriptions.""" lines = [] for name, resource in itertools.chain(LOCAL_DATASETS.items(), REMOTE_DATASETS.items()): if isinstance(resource, LocalFileMetadata): location = "local: {}".format(resource.filen...
[ "Get", "a", "string", "representation", "of", "all", "available", "datasets", "with", "descriptions", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/datasets.py#L170-L183
[ "def", "list_datasets", "(", ")", ":", "lines", "=", "[", "]", "for", "name", ",", "resource", "in", "itertools", ".", "chain", "(", "LOCAL_DATASETS", ".", "items", "(", ")", ",", "REMOTE_DATASETS", ".", "items", "(", ")", ")", ":", "if", "isinstance",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
_verify_names
Make sure var_names and arg_names are assigned reasonably. This is meant to run before loading emcee objects into InferenceData. In case var_names or arg_names is None, will provide defaults. If they are not None, it verifies there are the right number of them. Throws a ValueError in case validation f...
arviz/data/io_emcee.py
def _verify_names(sampler, var_names, arg_names): """Make sure var_names and arg_names are assigned reasonably. This is meant to run before loading emcee objects into InferenceData. In case var_names or arg_names is None, will provide defaults. If they are not None, it verifies there are the right numb...
def _verify_names(sampler, var_names, arg_names): """Make sure var_names and arg_names are assigned reasonably. This is meant to run before loading emcee objects into InferenceData. In case var_names or arg_names is None, will provide defaults. If they are not None, it verifies there are the right numb...
[ "Make", "sure", "var_names", "and", "arg_names", "are", "assigned", "reasonably", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_emcee.py#L6-L58
[ "def", "_verify_names", "(", "sampler", ",", "var_names", ",", "arg_names", ")", ":", "# There are 3 possible cases: emcee2, emcee3 and sampler read from h5 file (emcee3 only)", "if", "hasattr", "(", "sampler", ",", "\"args\"", ")", ":", "num_vars", "=", "sampler", ".", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
from_emcee
Convert emcee data into an InferenceData object. Parameters ---------- sampler : emcee.EnsembleSampler Fitted sampler from emcee. var_names : list[str] (Optional) A list of names for variables in the sampler arg_names : list[str] (Optional) A list of names for args in the sa...
arviz/data/io_emcee.py
def from_emcee(sampler=None, *, var_names=None, arg_names=None, coords=None, dims=None): """Convert emcee data into an InferenceData object. Parameters ---------- sampler : emcee.EnsembleSampler Fitted sampler from emcee. var_names : list[str] (Optional) A list of names for variable...
def from_emcee(sampler=None, *, var_names=None, arg_names=None, coords=None, dims=None): """Convert emcee data into an InferenceData object. Parameters ---------- sampler : emcee.EnsembleSampler Fitted sampler from emcee. var_names : list[str] (Optional) A list of names for variable...
[ "Convert", "emcee", "data", "into", "an", "InferenceData", "object", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_emcee.py#L109-L269
[ "def", "from_emcee", "(", "sampler", "=", "None", ",", "*", ",", "var_names", "=", "None", ",", "arg_names", "=", "None", ",", "coords", "=", "None", ",", "dims", "=", "None", ")", ":", "return", "EmceeConverter", "(", "sampler", "=", "sampler", ",", ...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
EmceeConverter.posterior_to_xarray
Convert the posterior to an xarray dataset.
arviz/data/io_emcee.py
def posterior_to_xarray(self): """Convert the posterior to an xarray dataset.""" data = {} for idx, var_name in enumerate(self.var_names): # Use emcee3 syntax, else use emcee2 data[var_name] = ( self.sampler.get_chain()[(..., idx)].T if has...
def posterior_to_xarray(self): """Convert the posterior to an xarray dataset.""" data = {} for idx, var_name in enumerate(self.var_names): # Use emcee3 syntax, else use emcee2 data[var_name] = ( self.sampler.get_chain()[(..., idx)].T if has...
[ "Convert", "the", "posterior", "to", "an", "xarray", "dataset", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_emcee.py#L75-L85
[ "def", "posterior_to_xarray", "(", "self", ")", ":", "data", "=", "{", "}", "for", "idx", ",", "var_name", "in", "enumerate", "(", "self", ".", "var_names", ")", ":", "# Use emcee3 syntax, else use emcee2", "data", "[", "var_name", "]", "=", "(", "self", "...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
EmceeConverter.observed_data_to_xarray
Convert observed data to xarray.
arviz/data/io_emcee.py
def observed_data_to_xarray(self): """Convert observed data to xarray.""" data = {} for idx, var_name in enumerate(self.arg_names): # Use emcee3 syntax, else use emcee2 data[var_name] = ( self.sampler.log_prob_fn.args[idx] if hasattr(self.s...
def observed_data_to_xarray(self): """Convert observed data to xarray.""" data = {} for idx, var_name in enumerate(self.arg_names): # Use emcee3 syntax, else use emcee2 data[var_name] = ( self.sampler.log_prob_fn.args[idx] if hasattr(self.s...
[ "Convert", "observed", "data", "to", "xarray", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_emcee.py#L87-L97
[ "def", "observed_data_to_xarray", "(", "self", ")", ":", "data", "=", "{", "}", "for", "idx", ",", "var_name", "in", "enumerate", "(", "self", ".", "arg_names", ")", ":", "# Use emcee3 syntax, else use emcee2", "data", "[", "var_name", "]", "=", "(", "self",...
d04d8da07f029fd2931f48d2f7f324cf393e5277
train
from_tfp
Convert tfp data into an InferenceData object.
arviz/data/io_tfp.py
def from_tfp( posterior=None, *, var_names=None, model_fn=None, feed_dict=None, posterior_predictive_samples=100, posterior_predictive_size=1, observed=None, coords=None, dims=None ): """Convert tfp data into an InferenceData object.""" return TfpConverter( ...
def from_tfp( posterior=None, *, var_names=None, model_fn=None, feed_dict=None, posterior_predictive_samples=100, posterior_predictive_size=1, observed=None, coords=None, dims=None ): """Convert tfp data into an InferenceData object.""" return TfpConverter( ...
[ "Convert", "tfp", "data", "into", "an", "InferenceData", "object", "." ]
arviz-devs/arviz
python
https://github.com/arviz-devs/arviz/blob/d04d8da07f029fd2931f48d2f7f324cf393e5277/arviz/data/io_tfp.py#L169-L192
[ "def", "from_tfp", "(", "posterior", "=", "None", ",", "*", ",", "var_names", "=", "None", ",", "model_fn", "=", "None", ",", "feed_dict", "=", "None", ",", "posterior_predictive_samples", "=", "100", ",", "posterior_predictive_size", "=", "1", ",", "observe...
d04d8da07f029fd2931f48d2f7f324cf393e5277