plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | tum-vision/csd_lmnn-master | likT.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likT.m | 4,776 | utf_8 | 6463e0fed8f6484854dd3dd212db5202 | function [varargout] = likT(hyp, y, mu, s2, inf, i)
% likT - Student's t likelihood function for regression.
% The expression for the likelihood is
% likT(t) = Z * ( 1 + (t-y)^2/(nu*sn^2) ).^(-(nu+1)/2),
% where Z = gamma((nu+1)/2) / (gamma(nu/2)*sqrt(nu*pi)*sn)
% and y is the mean (for nu>1) and nu*sn^2/(nu-2) is ... |
github | tum-vision/csd_lmnn-master | likLaplace.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likLaplace.m | 6,922 | iso_8859_13 | 9673b9c57508bdbfd0dc917f10944f80 | function [varargout] = likLaplace(hyp, y, mu, s2, inf, i)
% likLaplace - Laplacian likelihood function for regression.
% The expression for the likelihood is
% likLaplace(t) = exp(-|t-y|/b)/(2*b) with b = sn/sqrt(2),
% where y is the mean and sn^2 is the variance.
%
% The hyperparameters are:
%
% hyp = [ log(sn) ... |
github | tum-vision/csd_lmnn-master | likGaussWarp.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likGaussWarp.m | 9,118 | utf_8 | baca6bc6eb9f081dff2f85d7a4eb8318 | function [varargout] = likGaussWarp(warp, hyp, y, mu, varargin)
% likGaussWarp - Warped Gaussian likelihood for regression.
% The expression for the likelihood is
% likGaussWarp( y | t ) = likGauss( g(y) | t ) * g'(y),
% where likGauss is the Gaussian likelihood and g is the warping function.
%
% The hyperparamete... |
github | tum-vision/csd_lmnn-master | likWeibull.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likWeibull.m | 4,548 | utf_8 | 5134b34b56b016f15d716469fb93c583 | function [varargout] = likWeibull(link, hyp, y, mu, s2, inf, i)
% likWeibull - Weibull likelihood function for strictly positive data y. The
% expression for the likelihood is
% likWeibull(f) = g1*ka/mu * (g1*y/mu)^(ka-1) * exp(-(g1*y/mu)^ka) with
% gj = gamma(1+j/ka), mean=mu and variance=mu^2*(g2/g1^2-1) where mu... |
github | tum-vision/csd_lmnn-master | likGamma.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likGamma.m | 4,573 | utf_8 | 30195b20deb79baed3429087b58977a8 | function [varargout] = likGamma(link, hyp, y, mu, s2, inf, i)
% likGamma - Gamma likelihood function for strictly positive data y. The
% expression for the likelihood is
% likGamma(f) = al^al*y^(al-1)/gamma(al) * exp(-y*al/mu) / mu^al with
% mean=mu and variance=mu^2/al where mu = g(f) is the Gamma intensity, f is... |
github | tum-vision/csd_lmnn-master | likInvGauss.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likInvGauss.m | 4,679 | utf_8 | 1bffc204bfdee3ee427008906bce81ad | function [varargout] = likInvGauss(link, hyp, y, mu, s2, inf, i)
% likInvGauss - Inverse Gaussian likelihood function for strictly positive data
% y. The expression for the likelihood is
% likInvGauss(f) = sqrt(lam/(2*pi*y^3))*exp(-lam*(mu-y)^2/(2*mu^2*y)) with
% mean=mu and variance=mu^3/lam where mu = g(f) is th... |
github | tum-vision/csd_lmnn-master | likPoisson.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likPoisson.m | 4,178 | utf_8 | 9bdb4f7a4905445839d4697149efc827 | function [varargout] = likPoisson(link, hyp, y, mu, s2, inf, i)
% likPoisson - Poisson likelihood function for count data y. The expression for
% the likelihood is
% likPoisson(f) = mu^y * exp(-mu) / y! with mean=variance=mu
% where mu = g(f) is the Poisson intensity, f is a
% Gaussian process, y is the non-negativ... |
github | tum-vision/csd_lmnn-master | likLogistic.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likLogistic.m | 6,137 | utf_8 | 0227c40f8798f8f47d1f32e9dfd6e946 | function [varargout] = likLogistic(hyp, y, mu, s2, inf, i)
% likLogistic - logistic function for binary classification or logit regression.
% The expression for the likelihood is
% likLogistic(t) = 1./(1+exp(-t)).
%
% Several modes are provided, for computing likelihoods, derivatives and moments
% respectively, see... |
github | tum-vision/csd_lmnn-master | likSech2.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likSech2.m | 8,514 | utf_8 | 25a639e43b4bcdc60d8fd113ded18611 | function [varargout] = likSech2(hyp, y, mu, s2, inf, i)
% likSech2 - sech-square likelihood function for regression. Often, the sech-
% square distribution is also referred to as the logistic distribution not to be
% confused with the logistic function for classification. The expression for the
% likelihood is
% li... |
github | tum-vision/csd_lmnn-master | likGumbel.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/lik/likGumbel.m | 3,976 | utf_8 | e181712e58f8360c4d43c5c354d8431a | function [varargout] = likGumbel(sign, hyp, y, mu, s2, inf, i)
% likGumbel - Gumbel likelihood function for extremal value regression.
% The expression for the likelihood is
% likGumbel(t) = exp(-z-exp(-z))/be, z = ga+s*(y-t)/be, be = sn*sqrt(6)/pi
% where s={+1,-1} is a sign switching between left and right skewed... |
github | tum-vision/csd_lmnn-master | priorSmoothBox1.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/prior/priorSmoothBox1.m | 1,617 | utf_8 | df60218e999e45adf5f4204501f3c42f | function [lp,dlp] = priorSmoothBox1(a,b,eta,x)
% Univariate smoothed box prior distribution with linear decay in the log domain
% and infinite support over the whole real axis.
% Compute log-likelihood and its derivative or draw a random sample.
% The prior distribution is parameterized as:
%
% p(x) = sigmoid(... |
github | tum-vision/csd_lmnn-master | logphi.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/logphi.m | 2,261 | utf_8 | 69fbcfc9d9913da15644d5f0a0368d5f | % Safe computation of logphi(z) = log(normcdf(z)) and its derivatives
% dlogphi(z) = normpdf(x)/normcdf(x).
% The function is based on index 5725 in Hart et al. and gsl_sf_log_erfc_e.
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2013-11-13.
function [lp,dlp,d2lp,d3lp] = logphi(z)
... |
github | tum-vision/csd_lmnn-master | gauher.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/gauher.m | 2,245 | utf_8 | 441ef6c145fe66f1b7ca9da6207f6003 | % compute abscissas and weight factors for Gaussian-Hermite quadrature
%
% CALL: [x,w] = gauher(N)
%
% x = base points (abscissas)
% w = weight factors
% N = number of base points (abscissas) (integrates an up to (2N-1)th order
% polynomial exactly)
%
% p(x)=exp(-x^2/2)/sqrt(2*pi), a =-Inf, b = Inf
%
% Th... |
github | tum-vision/csd_lmnn-master | elsympol.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/elsympol.m | 699 | utf_8 | 33e751b982c07eb890d26629bf71f595 | % Evaluate the order R elementary symmetric polynomial Newton's identity aka
% the Newton–Girard formulae: http://en.wikipedia.org/wiki/Newton's_identities
%
% Copyright (c) by Carl Edward Rasmussen and Hannes Nickisch, 2010-01-10.
function E = elsympol(Z,R)
% evaluate 'power sums' of the individual terms in Z
sz = si... |
github | tum-vision/csd_lmnn-master | minimize.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize.m | 11,194 | utf_8 | 8fe1cb1627b6094c42fce517aa678a6d | function [X, fX, i] = minimize(X, f, length, varargin)
% Minimize a differentiable multivariate function using conjugate gradients.
%
% Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to the funct... |
github | tum-vision/csd_lmnn-master | minimize_v2.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize_v2.m | 11,952 | utf_8 | d8aad9cf50639371a892fbcc202eed7c | % minimize.m - minimize a smooth differentiable multivariate function using
% LBFGS (Limited memory LBFGS) or CG (Conjugate Gradients)
% Usage: [X, fX, i] = minimize(X, F, p, other, ... )
% where
% X is an initial guess (any type: vector, matrix, cell array, struct)
% F is the objective function (function poi... |
github | tum-vision/csd_lmnn-master | sq_dist.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/sq_dist.m | 1,967 | utf_8 | 75b906d47729b33d7567f1353ced2f83 | % sq_dist - a function to compute a matrix of all pairwise squared distances
% between two sets of vectors, stored in the columns of the two matrices, a
% (of size D by n) and b (of size D by m). If only a single argument is given
% or the second matrix is empty, the missing matrix is taken to be identical
% to the fir... |
github | tum-vision/csd_lmnn-master | cov_deriv_sq_dist.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/cov_deriv_sq_dist.m | 1,906 | utf_8 | 625e697b220630f920d967bce06884e7 | % Compute derivative k'(x^p,x^q) of a stationary covariance k(d2) (ard or iso)
% w.r.t. to squared distance d2 = (x^p - x^q)'*inv(P)*(x^p - x^q) measure. Here
% P is either diagonal with ARD parameters ell_1^2,...,ell_D^2 where D is the
% dimension of the input space or ell^2 times the unit matrix for isotropic
% covar... |
github | tum-vision/csd_lmnn-master | unwrap.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/unwrap.m | 651 | utf_8 | 47d4deafec9cfdde0a4c291b3825c401 | % Extract the numerical values from "s" into the column vector "v". The
% variable "s" can be of any type, including struct and cell array.
% Non-numerical elements are ignored. See also the reverse rewrap.m.
function v = unwrap(s)
v = [];
if isnumeric(s)
v = s(:); % numeric values are re... |
github | tum-vision/csd_lmnn-master | glm_invlink_expexp.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/glm_invlink_expexp.m | 427 | utf_8 | 99a5cdb9880a947109671401c7398199 | % Compute the log intensity for the inverse link function g(f) = exp(-exp(-f)).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_expexp(f)
lg = -exp(-f);
if nargout>1
... |
github | tum-vision/csd_lmnn-master | glm_invlink_logistic.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/glm_invlink_logistic.m | 686 | utf_8 | b21f086f037b6560c290e0044e0beef5 | % Compute the log intensity for the inverse link function g(f) = log(1+exp(f))).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_logistic(f)
l1pef = max(0,f) + log(1+exp(-a... |
github | tum-vision/csd_lmnn-master | minimize_v1.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize_v1.m | 11,202 | utf_8 | cd58ba0b83b1121423ed9a53b33562a1 | function [X, fX, i] = minimize_old(X, f, length, varargin)
% Minimize a differentiable multivariate function using conjugate gradients.
%
% Usage: [X, fX, i] = minimize(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to the f... |
github | tum-vision/csd_lmnn-master | rewrap.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/rewrap.m | 1,014 | utf_8 | 64b6d7c0f51a8c77ddd012370a288b20 | % Map the numerical elements in the vector "v" onto the variables "s" which can
% be of any type. The number of numerical elements must match; on exit "v"
% should be empty. Non-numerical entries are just copied. See also unwrap.m.
function [s v] = rewrap(s, v)
if isnumeric(s)
if numel(v) < numel(s)
error('The ... |
github | tum-vision/csd_lmnn-master | solve_chol.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/solve_chol.m | 994 | utf_8 | f4d6cd4b9e7b0a955c2c8709a4894dd3 | % solve_chol - solve linear equations from the Cholesky factorization.
% Solve A*X = B for X, where A is square, symmetric, positive definite. The
% input to the function is R the Cholesky decomposition of A and the matrix B.
% Example: X = solve_chol(chol(A),B);
%
% NOTE: The program code is written in the C language ... |
github | tum-vision/csd_lmnn-master | glm_invlink_logit.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/glm_invlink_logit.m | 786 | utf_8 | b2fc9a03b835c7f6643f37b29eac8c0b | % Compute the log intensity for the inverse link function g(f) = 1/(1+exp(-f)).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function varargout = glm_invlink_logit(f)
varargout = cell(nargout, 1); % allocate th... |
github | tum-vision/csd_lmnn-master | minimize_lbfgsb_gradfun.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize_lbfgsb_gradfun.m | 2,390 | utf_8 | 0eca58fc12d068780d735fd5a83ebdfa | function G = minimize_lbfgsb_gradfun(X,varargin)
% extract input arguments
varargin = varargin{1}; strctX = varargin{2}; f = varargin{1};
% global variables serve as communication interface between calls
global minimize_lbfgsb_iteration_number
global minimize_lbfgsb_objective
global minimize_lbfgsb_gradie... |
github | tum-vision/csd_lmnn-master | minimize_lbfgsb.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize_lbfgsb.m | 4,476 | utf_8 | 10c2d1fef0bdc071cd35d3904c88f0ed | function [X, fX, i] = minimize_lbfgsb(X, f, length, varargin)
% Minimize a differentiable multivariate function using quasi Newton.
%
% Usage: [X, fX, i] = minimize_lbfgsb(X, f, length, P1, P2, P3, ... )
%
% X initial guess; may be of any type, including struct and cell array
% f the name or pointer to th... |
github | tum-vision/csd_lmnn-master | minimize_lbfgsb_objfun.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/minimize_lbfgsb_objfun.m | 2,695 | utf_8 | d9bbd3614b193a06603c12f33f877104 | function y = minimize_lbfgsb_objfun(X,varargin)
% extract input arguments
varargin = varargin{1}; strctX = varargin{2}; f = varargin{1};
% global variables serve as communication interface between calls
global minimize_lbfgsb_iteration_number
global minimize_lbfgsb_objective
global minimize_lbfgsb_gradien... |
github | tum-vision/csd_lmnn-master | logsumexp2.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/logsumexp2.m | 454 | utf_8 | aa7e4f12a67c8f2e12bc5d9113b9abd0 | % Compute y = log( sum(exp(x),2) ), the softmax in a numerically safe way by
% subtracting the row maximum to avoid cancelation after taking the exp
% the sum is done along the rows.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [y,x] = logsumexp2(logx)
N = size(logx,2); max_logx = max(logx,[],2);
%... |
github | tum-vision/csd_lmnn-master | lik_epquad.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/lik_epquad.m | 1,622 | utf_8 | 9f92aef26b02e08fcee8f74617ebd05d | % Compute infEP part of a likelihood function based on the infLaplace part using
% Gaussian-Hermite quadrature.
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function varargout = lik_epquad(lik,hyp,y,mu,s2)
n = m... |
github | tum-vision/csd_lmnn-master | glm_invlink_exp.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/util/glm_invlink_exp.m | 443 | utf_8 | af4bb74d42054f7b470ed8aecfcf4607 | % Compute the log intensity for the inverse link function g(f) = exp(f).
%
% The function is used in GLM likelihoods such as likPoisson, likGamma, likBeta
% and likInvGauss.
%
% Copyright (c) by Hannes Nickisch, 2013-10-16.
function [lg,dlg,d2lg,d3lg] = glm_invlink_exp(f)
lg = f;
if nargout>1
dlg = ones(size(f... |
github | tum-vision/csd_lmnn-master | covPeriodicNoDC.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/cov/covPeriodicNoDC.m | 3,630 | utf_8 | 32d02bd08932f22fe8302ce97b797d39 | function K = covPeriodicNoDC(hyp, x, z, i)
% Stationary covariance function for a smooth periodic function, with period p:
%
% k(x,x') = sf^2 * [k0(pi*(x-x')/p) - f(ell)] / [1 - f(ell)]
% with k0(t) = exp( -2*sin^2(t)/ell^2 ) and f(ell) = \int 0..pi k0(t) dt.
%
% The constant (DC component) has been removed and... |
github | tum-vision/csd_lmnn-master | covGrid.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/cov/covGrid.m | 7,051 | utf_8 | 45064e9c69d8e20f1122e20679e25085 | function [K,Mx,xe] = covGrid(cov, xg, hyp, x, z, i)
% covGrid - Kronecker covariance function based on a grid.
%
% The grid g is represented by its p axes xg = {x1,x2,..xp}. An axis xi is of
% size (ni,di) and the grid g has size (n1,n2,..,np,D), where D=d1+d2+..+dp.
% Hence, the grid contains N=n1*n2*..*np data point... |
github | tum-vision/csd_lmnn-master | covPERiso.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/cov/covPERiso.m | 3,145 | utf_8 | 7308c3f2001744df0d77cd5dc190c637 | function K = covPERiso(cov, hyp, x, z, i)
% Stationary periodic covariance function for an isotropic stationary covariance
% function k0 such as covMaterniso, covPPiso, covRQiso and covSEiso.
% Isotropic stationary means that the covariance function k0(x,z) depends on the
% data points x,z only through the squared dis... |
github | tum-vision/csd_lmnn-master | covADD.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/cov/covADD.m | 3,632 | utf_8 | 45875a6c0e52c3f98448f40f6b6fc599 | function K = covADD(cov, hyp, x, z, i)
% Additive covariance function using a 1d base covariance function
% cov(x^p,x^q;hyp) with individual hyperparameters hyp.
%
% k(x^p,x^q) = \sum_{r \in R} sf_r \sum_{|I|=r}
% \prod_{i \in I} cov(x^p_i,x^q_i;hyp_i)
%
% hyp = [ hyp_1
% hyp_2
% ...
... |
github | tum-vision/csd_lmnn-master | covPERard.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/cov/covPERard.m | 3,588 | utf_8 | 47dfb8b9857ef5e9bc3693bb6e5c0aa9 | function K = covPERard(cov, hyp, x, z, i)
% Stationary periodic covariance function for a stationary covariance function
% k0 such as covMaternard, covPPard, covRQard and covSEard.
% Stationary means that the covariance function k0(x,z) depends on the
% data points x,z only through the squared distance
% dxz = (x-z)'*... |
github | tum-vision/csd_lmnn-master | infMCMC.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infMCMC.m | 10,673 | utf_8 | 346201720f95a22a681c50bd2535b84c | function [post nlZ dnlZ] = infMCMC(hyp, mean, cov, lik, x, y, par)
% Markov Chain Monte Carlo (MCMC) sampling from posterior and
% Annealed Importance Sampling (AIS) for marginal likelihood estimation.
%
% The algorithms are not to be used as a black box, since the acceptance rate
% of the samplers need to be careful... |
github | tum-vision/csd_lmnn-master | infKL.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infKL.m | 10,925 | utf_8 | 25a0bb16b3bced105beb3520acf7f57e | function [post nlZ dnlZ] = infKL(hyp, mean, cov, lik, x, y)
% Approximation to the posterior Gaussian Process by minimization of the
% KL-divergence. The function is structurally very similar to infEP; the
% only difference being the local divergence measure minimised.
% In infEP, one minimises KL(p,q) whereas in inf... |
github | tum-vision/csd_lmnn-master | infFITC_EP.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infFITC_EP.m | 12,117 | utf_8 | a2c1fccebe29502421d32ed7ab5fcd14 | function [post nlZ dnlZ] = infFITC_EP(hyp, mean, cov, lik, x, y)
% FITC-EP approximation to the posterior Gaussian process. The function is
% equivalent to infEP with the covariance function:
% Kt = Q + G; G = diag(g); g = diag(K-Q); Q = Ku'*inv(Kuu + snu2*eye(nu))*Ku;
% where Ku and Kuu are covariances w.r.t.... |
github | tum-vision/csd_lmnn-master | infFITC_Laplace.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infFITC_Laplace.m | 11,364 | utf_8 | 1de345e37242cee549b4d7841e348f84 | function [post nlZ dnlZ] = infFITC_Laplace(hyp, mean, cov, lik, x, y)
% FITC-Laplace approximation to the posterior Gaussian process. The function is
% equivalent to infLaplace with the covariance function:
% Kt = Q + G; G = diag(g); g = diag(K-Q); Q = Ku'*inv(Kuu + snu2*eye(nu))*Ku;
% where Ku and Kuu are covarian... |
github | tum-vision/csd_lmnn-master | infGrid.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infGrid.m | 7,627 | utf_8 | cca2d1208eb8763b1f518d5106ec6fd5 | function [post nlZ dnlZ] = infGrid(hyp, mean, cov, lik, x, y, opt)
% Inference for a GP with Gaussian likelihood and covGrid covariance.
% The (Kronecker) covariance matrix used is given by:
% K = kron( kron(...,K{2}), K{1} ) = K_p x .. x K_2 x K_1.
%
% Compute a parametrization of the posterior, the negative log ma... |
github | tum-vision/csd_lmnn-master | infEP.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infEP.m | 5,886 | utf_8 | bc70721e1eea7c28c46653d36d1cd851 | function [post nlZ dnlZ] = infEP(hyp, mean, cov, lik, x, y)
% Expectation Propagation approximation to the posterior Gaussian Process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.... |
github | tum-vision/csd_lmnn-master | infVB.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infVB.m | 6,024 | utf_8 | ff46ca9c2cce23402f0058955fe60b93 | function [post, nlZ, dnlZ] = infVB(hyp, mean, cov, lik, x, y, opt)
% Variational approximation to the posterior Gaussian process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.
%
% ... |
github | tum-vision/csd_lmnn-master | infLaplace.m | .m | csd_lmnn-master/code/thirdparty/LMNN/lmnn3/lmnncore/gpml/inf/infLaplace.m | 7,949 | utf_8 | 297780be514bf1d87f826763094f104f | function [post nlZ dnlZ] = infLaplace(hyp, mean, cov, lik, x, y, opt)
% Laplace approximation to the posterior Gaussian process.
% The function takes a specified covariance function (see covFunctions.m) and
% likelihood function (see likFunctions.m), and is designed to be used with
% gp.m. See also infMethods.m.
%
% C... |
github | tum-vision/csd_lmnn-master | mshlp_matrix.m | .m | csd_lmnn-master/code/thirdparty/calc_LB/mshlp_matrix.m | 1,748 | utf_8 | 1c0ba7d6b619f68b2da3eb7a5fffa938 | function [W, A] = mshlp_matrix(shape, opt)
%
% Compute the Laplace-Beltrami matrix from mesh
%
% INPUTS
% filename: off file of triangle mesh.
% opt.htype: the way to compute the parameter h. h = hs * neighborhoodsize
% if htype = 'ddr' (data driven); h = hs if hytpe = 'psp' (pre-specify)
% D... |
github | bartgips/SWM-master | bg_swm_extract.m | .m | SWM-master/bg_swm_extract.m | 7,126 | utf_8 | f7e00c80b862c216a8c91e0f1273cc17 | function [s, z, cfg]=bg_swm_extract(cfg, dat)
% [s, z, cfg]=bg_swm_extract(cfg, dat)
%
% input:
% cfg: output from bg_SWM
% can contain optional new field: .newLen;
% this is the length of the windows that should be cut out of the
% dataset (symetrically around the orignal window positions)
%... |
github | bartgips/SWM-master | bg_SWM_SA.m | .m | SWM-master/bg_SWM_SA.m | 27,584 | utf_8 | f0b4b023058cdf0c22269f0bacee258e | function [cfg]=bg_SWM_SA(cfg, dat)
% [cfg]=bg_SWM(cfg, dat)
%
% Sliding Window Matching algorithm for detecting consistent, reocurring
% shapes in a data set. Using simulated annealing. Useful when minumum is
% found by bg_SWM, but temperature was still to high, and therefore
% convergence not yet complete.
%
% %%%%%%%... |
github | bartgips/SWM-master | bg_SWM.m | .m | SWM-master/bg_SWM.m | 43,392 | utf_8 | 0f68b613d1adc6be95d5a25222ea41cd | function [cfg]=bg_SWM(cfg, dat)
% [cfg]=bg_SWM(cfg, dat)
%
% Sliding Window Matching algorithm for detecting consistent, reocurring
% shapes in a data set.
%
% %%%%%%%
% INPUT:
% %%%%%%%
% cfg: a structure that contains all parameters
% dat: optional the data on which you want to apply the algorithm
% (not necc... |
github | bartgips/SWM-master | bg_swm_TFR.m | .m | SWM-master/bg_swm_TFR.m | 6,643 | utf_8 | c77887b1cdd6840020c8bf02bdd7e02a | function [TFR, f, sd, sem, PLV]=bg_swm_TFR(cfg, freqoi, dat)
% [TFR, f, sd, sem, PLV]=bg_extract_TFR(cfg, freqoi, dat)
%
% input:
% cfg: output from bg_SWM
% freqoi: frequencies of interest
% dat: optional; data that the cfg belongs to. (only relevant if cfg
% does not contain .varName and .fName
%
% las... |
github | bartgips/SWM-master | bg_bootstrap_sawtooth.m | .m | SWM-master/related_functions/bg_bootstrap_sawtooth.m | 5,629 | utf_8 | deb9c984da0394213562a6dcd2010568 | function [stats]=bg_bootstrap_sawtooth(shapeMat, frac, numIt, lenFac, verbose, fignum)
% stats = bg_jackknife_sawtooth(shapeMat, frac, numIt, lenFac, verbose, fignum)
%
% Estimates confidence interval of skewness of noisy shapes contained in
% 'shapeMat' using bootstrap resampling.
%
% This method is useful when the in... |
github | bartgips/SWM-master | bg_bootstrap_interpolate.m | .m | SWM-master/related_functions/bg_bootstrap_interpolate.m | 7,030 | utf_8 | 86d401a67714570cb0c1d410b2a90d96 | function [stats]=bg_bootstrap_interpolate(shapeMat, numIt, frac, verbose, numExtr, fignum, smoothflag)
% stats = bg_bootstrap_interpolate(shapeMat, numIt, frac, verbose, numExtr, fignum, smoothflag)
%
% Uses interpolation together with detection of extrema to calculate skweness index based on T_up/T_down ratio.
% Like ... |
github | bartgips/SWM-master | bg_skewness_pktg_harsh.m | .m | SWM-master/related_functions/bg_skewness_pktg_harsh.m | 8,186 | utf_8 | c4de098f9311ee49d3b1d61efce1f906 | function [skwIdx, brdOut, xOut]=bg_skewness_pktg_harsh(x, bias, interpFac, numExtr)
% [skwIdx, brdOut, xOut]=bg_skewness_pktg_harsh(x, bias, interpFac, numExtr)
% Calculates skewness by finding the extrema of a shape. This shape is
% first interpolated (cubic spline) with factor "interpFac".
% The extrema are found by ... |
github | bartgips/SWM-master | bg_jackknife_sawtooth.m | .m | SWM-master/related_functions/bg_jackknife_sawtooth.m | 3,891 | utf_8 | 50116b62f6b178b07f2fad5ad79e9ff9 | function [stats]=bg_jackknife_sawtooth(shapeMat,verbose,fignum)
% stats = bg_jackknife_sawtooth(shapeMat, verbose, fignum)
%
% Estimates confidence interval of skewness of noisy shapes contained in
% 'shapeMat' using delete-1 jackknife. This means the number of samples used
% for estimation is equal to the number of sh... |
github | sjgershm/ccnl-fmri-master | ccnl_results_table.m | .m | ccnl-fmri-master/ccnl_results_table.m | 13,958 | utf_8 | 9c858a869dd32b58b4b66a6219d0ed32 | function table = ccnl_results_table(varargin)
%
% Same as bspmview -> Show Results Table (after cluster FWE correction). Except useful.
% Given a contrast, extract all the activation clusters from the t-map after cluster FWE correction.
% Returns result as a table with the cluster names, extents, t-stat... |
github | sjgershm/ccnl-fmri-master | ccnl_vifs.m | .m | ccnl-fmri-master/ccnl_vifs.m | 12,487 | utf_8 | 276ceacf1e4cc9fda58d1b949aaba5a0 | function [vifs, names] = ccnl_vifs(EXPT, model, subjects)
% Compute Variance Inflation Factors (VIFs) for given GLM.
% Need to run ccnl_fmri_glm first to compute the SPM.mat's
%
% USAGE:
% [vifs, names] = ccnl_vifs(EXPT, glmodel, [subjects])
%
% INPUTS:
% EXPT - experiment structure... |
github | sjgershm/ccnl-fmri-master | get_mask_format_helper.m | .m | ccnl-fmri-master/get_mask_format_helper.m | 792 | utf_8 | 41e3030fd952c60ca371f824a4ee9b77 | % helper function that figures out the what format a list of voxels is in
% potentially actually loads the mask
%
% Momchil Tomov, Aug 2018
%
function [mask_format, mask, Vmask] = get_mask_format_helper(mask)
% figure out how voxels are provided
mask_format = 'none';
if ischar(mask)
% load mask
... |
github | sjgershm/ccnl-fmri-master | ccnl_get_design.m | .m | ccnl-fmri-master/ccnl_get_design.m | 2,692 | utf_8 | 275a82186f54b109061c3cf4e2773956 | function [X, names, X_raw, res] = ccnl_get_design(EXPT, glmodel, subj, run)
% Compute the design matrix for a given run by convolving the
% regressors with the HRF. Useful for plotting and sanity checks.
% Notice that this does not rely on the SPM structure (unlike ccnl_plot_regressors).
%
% USAGE... |
github | sjgershm/ccnl-fmri-master | ccnl_searchlight_rdms.m | .m | ccnl-fmri-master/ccnl_searchlight_rdms.m | 6,304 | utf_8 | afe9e296ac237fb825b3399c7a084c50 | function [Neural, cor] = ccnl_searchlight_rdms(EXPT, rsa_idx, inds, radius, subjects, distance_metric)
% Compute the searchlight neural RDMs
% Requires Kriegeskorte's RSA toolbox: http://www.mrc-cbu.cam.ac.uk/methods-and-resources/toolboxes/license/ (Nili et al., 2014)
%
% USAGE:
% [Neural] = ccn... |
github | sjgershm/ccnl-fmri-master | get_beta_or_tmap_helper.m | .m | ccnl-fmri-master/get_beta_or_tmap_helper.m | 1,660 | utf_8 | 274b0ef20b0868e30ca068573e27a166 | % helper function that extracts quantities from .nii files
%
% Momchil Tomov, Aug 2018
%
function y = get_beta_or_tmap_helper(regressor, modeldir, Vmask, mask, names, mask_format, prefix)
n = 0;
for i = 1:length(names)
if (ischar(regressor) && (~isempty(strfind(names{i},[regressor,'*'])) || ~isempty(str... |
github | sjgershm/ccnl-fmri-master | ccnl_extract_clusters.m | .m | ccnl-fmri-master/ccnl_extract_clusters.m | 19,267 | utf_8 | 333443b31e3eb1f860d3c16f26409ed9 | function [V, Y, C, CI, region, extent, stat, mni, cor, results_table, spmT] = ccnl_extract_clusters(EXPT, model, contrast, p, direct, alpha, Dis, Num, clusterFWEcorrect, extent, df)
%
% Given a contrast, extract all the activation clusters from the t-map
% after cluster FWE correction. Code is copy-pasted ... |
github | ChristineWaiting/DTD_SMC-master | impvalue_annual.m | .m | DTD_SMC-master/Subfunction/impvalue_annual.m | 5,377 | utf_8 | a4b24ba7564f527b0b025915dec4f95d | %IMPVALUE
%Purpose : Compute the implied asset value given equity value. A bisection
%search is used until the upper and lower bounds are within bi_eps of each
%other (relative).
%Then Newton-Raphson iterations are performed until the step taken
%is less than bi_nr * av. If a Newton-Raphson iterations take a ste... |
github | ChristineWaiting/DTD_SMC-master | Transf_lnL_wMissing.m | .m | DTD_SMC-master/Subfunction/Transf_lnL_wMissing.m | 3,874 | utf_8 | 27a70ce49495440097a7f817c13674f3 | % The log-likelihood function of
% Purpose : Compute log-likelihood function value for a given parameter
% vector
% Input : PARAM = [mu, sig, beta, weight] annualized
% data1 at time t+1/ data0 : at time t+1
% n by 7 matrix with the following variables:
% 1. market capitalization 2. short term deb... |
github | ChristineWaiting/DTD_SMC-master | ols.m | .m | DTD_SMC-master/Subfunction/ols.m | 9,322 | utf_8 | ed70a6bb5dfe7df40dbb8e7a6563a55f | function results = ols(y, x)
%% This function is to perform ordinary least squares regression.
%% This function is a slightly-revised version of the one from 'spatial-econometrics'.
% PURPOSE: least-squares regression
%---------------------------------------------------
% USAGE: results = ols(y,x)
% where: y =... |
github | ChristineWaiting/DTD_SMC-master | Transf_lnL_woMissing.m | .m | DTD_SMC-master/Subfunction/Transf_lnL_woMissing.m | 3,640 | utf_8 | f568191ff24a94772843e6931ed14b4a | % The log-likelihood function of
% Purpose : Compute log-likelihood function value for a given parameter
% vector
% Input : PARAM = [mu, sig, beta, weight] annualized
% data : n by 7 matrix with the following variables:
% 1. market capitalization 2. short term debt 3. long term debt
% 4. o... |
github | ChristineWaiting/DTD_SMC-master | Transf_lnL_main.m | .m | DTD_SMC-master/Subfunction/Transf_lnL_main.m | 1,602 | utf_8 | 920afa04825d41606285501728b523bc | % The log-likelihood function of
% Purpose : Compute log-likelihood function value for a given parameter
% vector with missing data
% Input : PARAM = [mu, sig, beta, weight] annualized
% data : n by 7 matrix with the following variables:
% 1. market capitalization 2. short term debt 3. long term d... |
github | rballester/tucker_compression-master | zigzag.m | .m | tucker_compression-master/thresholding/zigzag.m | 1,920 | utf_8 | faf9e12e5bcb252eb63336d5306e6a82 | % Given a 3D tensor X, returns a vector containing the indices resulting
% from visiting all its elements sequentially, following a 3D zigzag
% pattern that develops from a corner in the fashion of a 3D
% generalization of the JPEG zigzag scheme for quantization
% (http://en.wikipedia.org/wiki/JPEG#Entropy_coding)
%... |
github | rballester/tucker_compression-master | thresholding_compression.m | .m | tucker_compression-master/thresholding/thresholding_compression.m | 4,325 | utf_8 | 052ed520c8026ce959f55267deac56ee | % Compress a 3D tensor using Tucker thresholding, following
% http://www.ifi.uzh.ch/en/vmml/publications/lossycompression.html
%
% Inputs:
%
% X: the input volume
%
% metric: a string specified how the desired accuracy is expressed
% ("relative error", "rmse" or "psnr")
%
% target: the desired value; see "metric"
%
% R... |
github | rballester/tucker_compression-master | log_dequantize.m | .m | tucker_compression-master/thresholding/log_dequantize.m | 581 | utf_8 | b3deb93ef7c6c126f19a36fc98bdade8 | % Dequantizes the vector X_quantized. See log_quantize.m
function X = log_dequantize(X_quantized,maximum,quantization_bits,use_hot_corner)
X = zeros(size(X_quantized));
start = 1;
if use_hot_corner
start = 2;
X(1) = X_quantized(1); % We assume the hot corner lies untouched in the first pos... |
github | rballester/tucker_compression-master | log_quantize.m | .m | tucker_compression-master/thresholding/log_quantize.m | 1,324 | utf_8 | e30f6dc5666e4459ee3d5733a7d86c88 | % Quantizes the elements of an input vector X. Each element uses 9 bits:
% 1 for the sign, the rest for quantizing (logarithmically) its absolute
% value. Optionally, the maximum value ("hot corner") is stored aside.
% This strategy was first used in "Interactive Multiscale Tensor Reconstruction for
% Multiresolution ... |
github | rballester/tucker_compression-master | bounding_box.m | .m | tucker_compression-master/thresholding/bounding_box.m | 401 | utf_8 | e658d59a2abd3da05d180200968c46ad | % Returns the side sizes of the minimal bounding box (with one corner placed at the hot corner) of the elements
% of the input (where zeros are considered empty space)
function R = bounding_box(core)
proj1 = sum(sum(core,2),3);
R1 = find(proj1);
proj2 = sum(sum(core,1),3);
R2 = find(proj2);
proj3 =... |
github | rballester/tucker_compression-master | thresholding_compression_batch.m | .m | tucker_compression-master/thresholding/thresholding_compression_batch.m | 3,543 | utf_8 | dda77bf3bf026211a0d077d413b1f338 | % Compress a 3D tensor using Tucker thresholding, following
% http://www.ifi.uzh.ch/en/vmml/publications/lossycompression.html
%
% In this version (cf. thresholding_compression.m), fraction and
% quantization_bits can be 1D arrays. If they have size F and Q
% respectively, then the function returns two matrices of size... |
github | rballester/tucker_compression-master | dct_matrix.m | .m | tucker_compression-master/hooi/dct_matrix.m | 433 | utf_8 | 0020475fd65f461408d187e86eeba13f | % Create a matrix containing DCT frequencies arranged as columns,
% starting from the lowest on the left
function U = dct_matrix(rows,cols)
U = zeros(rows,cols);
for i = 1:rows
for j = 1:cols
if j == 1
U(i,j)=sqrt(1/rows)*cos((2*(i-1)+1)*(j-1)*pi/(2*rows));
else... |
github | rballester/tucker_compression-master | hooi.m | .m | tucker_compression-master/hooi/hooi.m | 1,777 | utf_8 | 8d0b0564bb8822fe33d7eaaf4aaa1320 | % Higher-order orthogonal iteration (HOOI) to compute the Tucker
% decomposition of a 3D array with the given ranks
% Reference: "On the best rank-1 and rank-(R1, R2,...,RN ) approximation of
% higher-order tensors" (L. de Lathauwer, B. de Moor, J. Vandewalle)
function [core,U] = hooi(X,R,init,n_iterations)
N = n... |
github | rballester/tucker_compression-master | ttm.m | .m | tucker_compression-master/hooi/ttm.m | 1,198 | utf_8 | 0d463f0f20171815b40c31bdf1e7dc7b | % Compute the TTM (tensor-times-matrix) between a tensor and a sequence of
% factors
%
% X: the input tensor with N dimensions
%
% U: a cell containing 1 or more matrices. If direction is "compress",
% the number of rows of U{i} must be equal to the i-th size of X.
% If "decompress", then the number of columns must be ... |
github | rballester/tucker_compression-master | unfold.m | .m | tucker_compression-master/hooi/unfold.m | 255 | utf_8 | 17e29693a40ad59f7896015e0bb2bd06 | % Compute the unfolding (matricization) of a tensor along a specified mode.
function X_unf = unfold(X,mode)
N = ndims(X);
modes = 1:N;
modes(mode) = [];
X_unf = reshape(permute(X,[mode,modes]),[size(X,mode),numel(X(:))/size(X,mode)]);
end |
github | vijaykbg/deep-patchmatch-master | feature_extract_2chstream.m | .m | deep-patchmatch-master/code/feature_extract_2chstream.m | 3,565 | utf_8 | 4cfa54636cb4120b0de8f0c8f5d172b5 | function Sim_score = feature_extract_2chstream(patches,net_path)
% pathces: is a is a tensor of size [64x64x2xN] where the patches that
% needs to be compared are stacked along the 3rd dimension
% Eg: If two patches I1 and I2 are to be compared, then dimension of the
% patches would be [64x64x2](I1 and I2 stacked alon... |
github | wkool/demandavoidance-master | decks_randposHome.m | .m | demandavoidance-master/dst_multidecks/decks_randposHome.m | 27,232 | utf_8 | b1d6b56e23da6956ae96255aa0f3d170 | function [] = decks_randposHome(prac)
% decks_randposHome
%
% This function presents the demand selection task.
% Cognitive demand is manipulated using magnitude/parity task switching.
% Input:
% prac (optional) - if set to 'p', runs in practice mode
% -begins with several blocks of isolated numbers
% -th... |
github | wkool/demandavoidance-master | decks_math.m | .m | demandavoidance-master/decks_math/decks_math.m | 19,934 | utf_8 | 62c704d15cf00fd85fe74c2b824c991f | function []=decks_math()
try
%% Preparatory steps
% basic experiment settings
randSeed=sum(100*clock);
rand('twister',randSeed); %reset the random number generator
mon=0; %which monitor to use? 1 for secondary, 0 for primary
nRuns=8; %normally 8
secsPerRun=.5*60; %runs are timed. normally 5mins... |
github | clarkzinzow/Nonlinear-Optimization-Algorithms-master | StepSizeSW.m | .m | Nonlinear-Optimization-Algorithms-master/src/StepSizeSW.m | 1,521 | utf_8 | 9228d8338091b3f8072288af84008a66 | function [alpha,xp] = StepSizeSW(f,x,d,alpha,params)
% Line search algorithm satisfying strong Wolfe conditions.
% Algorithms 3.5 on pages 60-61 in Nocedal and Wright.
% Requires x.p, x.f and x.g to be initialized.
alpha0 = params.stpmin;
c1 = params.ftol;
c2 = params.gtol;
% alpha is alpha_i
gxd = x.g'*d;
% alphap is... |
github | clarkzinzow/Nonlinear-Optimization-Algorithms-master | DogLeg.m | .m | Nonlinear-Optimization-Algorithms-master/src/DogLeg.m | 6,064 | utf_8 | 5b3ff9fe91d2fae8b8db199d8b6b2829 | function [inform, x] = DogLeg(fun, x, dlparams)
% Implements the dogleg method for finding a solution to the subproblem
%
% min m(p) = f + g'p + 1/2 * p' B p s.t. ||p|| <= Del
%
% Input:
% fun - a pointer to a function
% x - the following structure:
% * x.p - the starting ... |
github | clarkzinzow/Nonlinear-Optimization-Algorithms-master | cgTrust.m | .m | Nonlinear-Optimization-Algorithms-master/src/cgTrust.m | 4,880 | utf_8 | 52d4d5903f30347989d11dbdc254ee57 | function [inform, x] = cgTrust(fun, x, cgtparams)
% Implements the Steihaug-Toint conjugate gradient trust region method for
% finding an approximate solution to the subproblem:
%
% min m(p) = f + g'p + 1/2 * p' B p s.t. ||p|| <= Del
%
% Input:
% fun - a pointer to a function
% x - th... |
github | clarkzinzow/Nonlinear-Optimization-Algorithms-master | StepSize.m | .m | Nonlinear-Optimization-Algorithms-master/src/StepSize.m | 999 | utf_8 | 65bfd57dd62ffe9fd7ddcfae188d3688 | function [alfa,x] = StepSize(fun, x, d, alfa, params)
% Implements simple Wolfe conditions.
x0 = x.p;
Dphi0 = x.g'*d;
if ( (alfa <= 0) || (Dphi0 > 0) )
error('Initialization of step incorrect');
end;
c1 = params.ftol;
c2 = params.gtol;
phi0 = x.f;
alfaL = 0;
alfaR = inf;
iter = 0;
while abs(alfaR-alfaL) > params... |
github | glajoie/BBCI_spiking_plasticity_model-master | STDPJ_exp.m | .m | BBCI_spiking_plasticity_model-master/functions/STDPJ_exp.m | 801 | utf_8 | eb2eef830e1950ca02f441b28e2e4f73 | %function that gives the STDP rule
function [y]=STDPJ_exp(delta_t,j,w_max,gamma,varargin)
% t_post is a scalar
% t_pre can be a vector
%ARGUMENT GOES : delta_t=t_pre-t_post
if ~isempty(varargin)
d=varargin{1};
c_p=d.c_p;
tau_p=d.tau_p;
c_d=d.c_d;
tau_d=d.t... |
github | glajoie/BBCI_spiking_plasticity_model-master | STDPJ.m | .m | BBCI_spiking_plasticity_model-master/functions/STDPJ.m | 969 | utf_8 | 200bf897a0f6db6d6a5ab182d3297001 | %function that gives the STDP rule
function [y]=STDPJ(delta_t,j,w_max,gamma,varargin)
% t_post is a scalar
% t_pre can be a vector
%ARGUMENT GOES : delta_t=t_pre-t_post
if ~isempty(varargin)
d=varargin{1};
c_p=d.c_p;
tau_p=d.tau_p;
c_d=d.c_d;
tau_d=d.tau_d... |
github | glajoie/BBCI_spiking_plasticity_model-master | C_hat2C.m | .m | BBCI_spiking_plasticity_model-master/functions/C_hat2C.m | 4,857 | utf_8 | 115ed0f39b1d178d49d15762cffe520e | %GL Feb 2016
%Function that does expansion of estimate for network cross-corr C(u) to
%desired order
%INPUTS:
%expected_count= expected number of spikes in epoch from each group.
%C_hat: external cross-corr
%lags_xc: time axis for C_hat
%J: connectivity matrix average TOTAL INCOMING SYNAPSES
%A: spike triggered stim... |
github | glajoie/BBCI_spiking_plasticity_model-master | dshift.m | .m | BBCI_spiking_plasticity_model-master/functions/dshift.m | 259 | utf_8 | cb56f1fca304905548a1756a575b3ad1 | %function that shifts cross-corr matrices by a delay ammount
function [A]=dshift(B,t_shift,dt)
d_shift=t_shift/dt;
index=1:size(B,3);
index=index+d_shift;
index(index>length(index))=length(index);
index(index<1)=1;
A=B(:,:,index);
end |
github | glajoie/BBCI_spiking_plasticity_model-master | C_hat2Jeq.m | .m | BBCI_spiking_plasticity_model-master/functions/C_hat2Jeq.m | 1,271 | utf_8 | ea8385eb453d3f34a38821330ccad6bd | %function that returns the estimate J equilibrium matrix
%as well as the associated stationary cross-corr, for a C_hat and some
%parameters p.
function [Jeq,C]=C_hat2Jeq(expansion,W_rule,J_init,lags_xc,p)
%internal parameters
max_it=10;
tol=1e-7;
dt=lags_xc(2)-lags_xc(1);
%range of synaptic strength for D function
j... |
github | subha5gemini/SMAIproject-master | fisherfaces.m | .m | SMAIproject-master/FisherFaces/code/fisherfaces.m | 1,684 | utf_8 | 9841106ebace09152f6d32537834c3c9 | % class 1 == male
% class 2 == female
% train data directory
chdir('../../UNRDatabase/train/Male');
list_1 = dir;
% constants
M_1 = 317;
M_2 = 322;
h = 20;
w = 16;
epsilon = 0.01;
% since, in absence of other information we are equally likely to
% encounter male and female faces, the prior probablity P1 & P2 is ... |
github | subha5gemini/SMAIproject-master | KNNtrain.m | .m | SMAIproject-master/KNN/KNNtrain.m | 1,597 | utf_8 | 2e1e1d991f9d40874a9618c5b082d4ac | pkg load statistics
%train female data directory
chdir('../UNRDatabase/train/Female');
list = dir;
M = 317; %no. of samples, same for both classes
h = 20; %size of the image
w = 16;
n_clusters = 10;
D = h*w;
data1 = zeros (M,D);
%load female train data
for k = 1:M
G = imread(list(k+2).name);
... |
github | subha5gemini/SMAIproject-master | eigen_faces.m | .m | SMAIproject-master/EigenFaces/code/eigen_faces.m | 3,159 | utf_8 | 17d8333415c9fffc1485651405ba991c | % train data directory
chdir('../../UNRDatabase/train/Female');
list = dir ;
% constants
M = 317;
h = 20;
w = 16;
n_faces = 50;
n_lighting_variation = 3;
D = h*w;
data = zeros(2*M,D); % twice because equal number of male and female images
% load the train data
for k = 1:M
G = imread(list(k+2).name);
G = reshape(... |
github | zhouyuanzxcv/Hyperspectral-master | optimize_gradient_descent.m | .m | Hyperspectral-master/Fusion/optimize_gradient_descent.m | 1,822 | utf_8 | 5bfe1cb73cc499faeaeef3bcd46a44a6 | function R = optimize_gradient_descent(I, I1, options)
delta_t0 = parse_param(options,'delta_t0',1e-6);
max_iter = parse_param(options,'max_iter',500);
convergence_t = parse_param(options,'convergence_t',0.001);
R = init_R(I,I1,options);
errors = eval_obj_fun_R(R, options);
delta_t_R = delta_t0;
for iter = 1:max_it... |
github | zhouyuanzxcv/Hyperspectral-master | calc_regularization.m | .m | Hyperspectral-master/Fusion/calc_regularization.m | 8,754 | utf_8 | 376287c0d28429cec6699eb525a956ce | function L = calc_regularization(I1, options)
% eta = parse_param(options,'eta',0.05);
k = parse_param(options,'K_neighbor',3);
% step = parse_param(options,'window_step',10);
% window = parse_param(options,'window_size',30);
% tau = parse_param(options,'tau',10);
r2 = parse_param(options,'r2',15);
r1 = parse_param(opt... |
github | zhouyuanzxcv/Hyperspectral-master | estimate_PSF_SRF.m | .m | Hyperspectral-master/Fusion/estimate_PSF_SRF.m | 2,353 | utf_8 | 1cdaec1c53aeacc42268dcee25070df8 | function [I1,wl1,rgb1,g,H1,extra,s,G,S] = estimate_PSF_SRF(I,wl,bbl,rgb,s,extra,options)
%ESTIMATE_PSF_SRF Estimate point spread function (PSF) and spectral
%response function (SRF)
disp('Start estimating PSF and SRF');
show_fig = parse_param(options,'show_fig',0);
I1 = I(:,:,bbl);
wl1 = wl(bbl);
rgb1 = rgb;
Y = res... |
github | zhouyuanzxcv/Hyperspectral-master | unmixP_NCM.m | .m | Hyperspectral-master/GMM_SantaBarbara/competing_methods/unmixP_NCM/unmixP_NCM.m | 2,290 | utf_8 | 3f3a8f6e2e69e32aa447de9e373993aa | function [P] = unmixP_NCM(X,E,Sigma,Parameters)
%% Input:
% X - d-by-N HSI data, matrix
% E - d-by-M endmember mean set, matrix
% Sigma - d-by-d-by-M endmember covariance set, matrix
% Output:
% P - M-by-N proportion matrix
% Author: Alina Zare et al. Rewriten by Sheng Zou
% Department of E... |
github | zhouyuanzxcv/Hyperspectral-master | test_bcm.m | .m | Hyperspectral-master/GMM_SantaBarbara/competing_methods/BCM/test_bcm.m | 1,180 | utf_8 | e8348c231de453e5a05fac55addefc0b | function [ output_args ] = test_bcm(dataset)
%TEST_BCM Summary of this function goes here
% Detailed explanation goes here
addpath('../GMM');
if nargin < 1
dataset = '001';
end
options = struct('force_positive_I',1);
[endmembers,I,Y,R_gt,A_gt,names,wl] = prepare_supervised_unmixing(dataset,options);
M = siz... |
github | zhouyuanzxcv/Hyperspectral-master | unmixGaussian.m | .m | Hyperspectral-master/GMM_SantaBarbara/competing_methods/BCM/unmixGaussian.m | 5,456 | utf_8 | c216cbdb39b419db68c27bd8cfedc5ba | function [Pbest] = unmixGaussian(X,Parameters)
% This function performs NCM-MH unmixing (Normal Compositional Model, MH Sampling approach).
% Update Proportions Part ONLY (given endmembers), Gaussian Sampling method unmix
% INPUTS
% X - double Mat - NxD image data.
% Parameters - struct - Parameters.
% OUTP... |
github | zhouyuanzxcv/Hyperspectral-master | MESMA_bruteforce.m | .m | Hyperspectral-master/GMM_SantaBarbara/competing_methods/AAM/MESMA_bruteforce.m | 2,389 | utf_8 | 3252bc896cba769d5d69710b8ee13e2a | function [idx, A, rec, minerr]=MESMA_bruteforce (x,L)
% MESMA_BRUTEFORCE Efficient brute force approach for MESMA problems with
% a low number of endmember libraries.
%
% input: x contains the mixed spectra (dimension x number of spectra)
% L contains the libraries as a cell array containing p matrices
% ... |
github | zhouyuanzxcv/Hyperspectral-master | gmm_hu_ex.m | .m | Hyperspectral-master/GMM/gmm_hu_ex.m | 4,831 | utf_8 | 3086235e01f26e885d013f567e4631cd | function [A,R,w_jk,mu_jk,sigma_jk,extra] = gmm_hu_ex(I, endmembers, options)
%GMM_EX Summary of this function goes here
% Detailed explanation goes here
if nargin < 3
options = [];
end
if max(I(:)) > 10 || max(endmembers{1}(:)) > 10
disp('Warning! I or endmember spectra are not in the range 0 - 1.');
end
if... |
github | zhouyuanzxcv/Hyperspectral-master | estimate_num_comp.m | .m | Hyperspectral-master/GMM/estimate_num_comp.m | 4,435 | utf_8 | b5e38bbb8a428c55ddcfe88aa5513ef3 | function [K,w_jk,mu_jk,sigma_jk,A1] = estimate_num_comp(Y, A, ...
sizes, shrink_size, max_num_comp, options)
%ESTIMATE_NUM_COMP Summary of this function goes here
% Detailed explanation goes here
if nargin < 6
options = [];
end
thresh = 0.99;
ignore_small_prior = 0.1;
[N,M] = size(A);
K = ones(1,M);
w_jk = ... |
github | zhouyuanzxcv/Hyperspectral-master | gmm_hu_endmember.m | .m | Hyperspectral-master/GMM/gmm_hu_endmember.m | 4,712 | utf_8 | 5b6e2ed73f1fcc47194a9a6cbe155cec | function [E] = gmm_hu_endmember(I,A,D,w_jk,mu_jk,sigma_jk)
%GMM_HU_ENDMEMBER Estimated endmembers for each pixel based on estimated
%GMM parameters and abundances
% Input:
% I - rows by cols by B image cube
% A - estimated N by M abundance matrix
% D - noise covariance matrix
% Output:
% E - M by B by N matrix... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.