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 | e5k/TOTGS-master | TOTGS.m | .m | TOTGS-master/TOTGS.m | 34,000 | utf_8 | 865a0d1ccfd9de7f21bdef6390121455 | % Program for the determination of the total grainsize distribution of tephra-fall deposits
%
% Usage: >> TOTGS
%
% Code: TOTGS
% By: Costanza Bonadonna (SOEST, University of Hawaii) and Giacomo Marani (Autonomous Systems Laboratory, University of Hawaii)
% Copyright (C) 2004 C. Bonadonna and G. Marani
%
% Data... |
github | haoqipaopao/feature_selection-master | plotProperties.m | .m | feature_selection-master/plotProperties.m | 2,955 | utf_8 | ff16e89b4b92e5f5c162f94d184b7491 | %% plot CGFR
function plotProperties(m,gamma,klist,SW,obj,acc,path,name)
%%
% plot m_SW
figure;
lineType={'b-*','r-+','k-o','c-x','g-*','c-.','m-s','c-o','c-s','m-+'};
labelW=cell(length(m),1);
OW=zeros(size(SW,3)+1,length(m)+1);
OW(1,2:length(m)+1)=m';
OW(2:size(SW,3)+1,1)=1:size(SW,3);
for i=1:length(m)
sw=SW(i,1... |
github | haoqipaopao/feature_selection-master | F22norm.m | .m | feature_selection-master/function/F22norm.m | 157 | utf_8 | 68e38585db37eb6b149c115f79bf8f02 | % compute squared F-norm
% ||A-B||_F^2
function d = F22norm(a,b)
% a,b: two matrices. each column is a data
% d: distance value
c=a-b;
d=sum(sum(c.*c));
|
github | haoqipaopao/feature_selection-master | L1_distance.m | .m | feature_selection-master/function/L1_distance.m | 290 | utf_8 | ba863af14a5c20dd151070903d51a0b6 | % compute L1 norm distance
% |A-B|
function d = L1_distance(a,b)
% a,b: two matrices. each column is a data
% d: distance matrix of a and b
d=zeros(size(a,2),size(b,2));
for i=1:size(a,2)
for j=1:size(b,2)
d(i,j)=sum(abs(a(:,i)-b(:,j)));
end
end
d = real(d);
d = max(d,0); |
github | haoqipaopao/feature_selection-master | L2_distance.m | .m | feature_selection-master/function/L2_distance.m | 489 | utf_8 | 60d97f06ecff95d68ac6b579756c035d | % compute squared Euclidean distance
% ||A-B||^2 = ||A||^2 + ||B||^2 - 2*A'*B
function d = L2_distance(a,b)
% a,b: two matrices. each column is a data
% d: distance matrix of a and b
if (size(a,1) == 1)
a = [a; zeros(1,size(a,2))];
b = [b; zeros(1,size(b,2))];
end
aa=sum(a.*a); bb=sum(b.*b); ab=a'*b;
d = r... |
github | haoqipaopao/feature_selection-master | L2_distance_1.m | .m | feature_selection-master/function/L2_distance_1.m | 491 | utf_8 | 2f9db3fa2b71ea0e0afa9786182f85ed | % compute squared Euclidean distance
% ||A-B||^2 = ||A||^2 + ||B||^2 - 2*A'*B
function d = L2_distance_1(a,b)
% a,b: two matrices. each column is a data
% d: distance matrix of a and b
if (size(a,1) == 1)
a = [a; zeros(1,size(a,2))];
b = [b; zeros(1,size(b,2))];
end
aa=sum(a.*a); bb=sum(b.*b); ab=a'*b;
d =... |
github | haoqipaopao/feature_selection-master | L21norm.m | .m | feature_selection-master/function/L21norm.m | 169 | utf_8 | 02b76276142140c9c41ce3d41c8823a4 | % compute squared Euclidean distance
% ||A-B||
function d = L21norm(a,b)
% a,b: two matrices. each column is a data
% d: distance value
c=a-b;
d=sum(sqrt(sum(c.*c))); |
github | haoqipaopao/feature_selection-master | selftuning.m | .m | feature_selection-master/function/selftuning.m | 1,096 | utf_8 | 06aeaa2f01c88ffe97d6d3d90fded55e | % self-tuning
function [A An] = selftuning(X_total, k)
% each row is a data point
AA = L2_distance(X_total,X_total);
AA(find(AA<0)) = 0;
clear X_total;
AA = sqrt(AA);
n = size(AA, 1);
[dumb idx] = sort(AA, 2); % sort each row
clear dumb;
A = zeros(n);
for i = 1:n
A(i, idx(i,2:k+1)) = AA(i, idx(i,2:k+1)) + eps;
end... |
github | haoqipaopao/feature_selection-master | LDA.m | .m | feature_selection-master/feature selection/LDA.m | 476 | utf_8 | 60f25b00cfe9e161b864b6905bbb80d1 | % by Xiaojun Chen
function W = LDA(X,Y,m)
epsilon=1e-10;
if nargin < 3
m = ceil(min(sqrt(size(X,1)),100));
end;
d=size(X,1);
label=unique(Y);
mu=mean(X,2);
cmu=zeros(d,length(label));
SW=zeros(d,d);
SB=zeros(d,d);
for i=1:length(label)
cmu(:,i)=mean(X(:,Y==i),2);
idx=find(Y==i);
SB=SB+length(idx)*(c... |
github | haoqipaopao/feature_selection-master | mrmr_mid_d.m | .m | feature_selection-master/feature selection/mrmr_mid_d.m | 2,831 | utf_8 | 83cc6292ade794122c5a21bbf128e3a5 | function [fea] = mrmr_mid_d(d, f, K)
% function [fea] = mrmr_mid_d(d, f, K)
%
% The MID scheme of minimum redundancy maximal relevance (mRMR) feature selection
%
% The parameters:
% d - a N*M matrix, indicating N samples, each having M dimensions. Must be integers.
% f - a N*1 matrix (vector), indicating the class/c... |
github | haoqipaopao/feature_selection-master | PCAN.m | .m | feature_selection-master/feature selection/PCAN.m | 2,869 | utf_8 | df48e231d68ddbfbed7c26a95df1942d | % min_{A>=0, A*1=1, W'*St*W=I, F'*F=I} \sum_ij aij*||W'*xi-W'*xj||^2 + r*||A||^2 + 2*lambda*trace(F'*L*F)
% written by Feiping Nie on 2/9/2014
function [W, y, A, evs] = PCAN(X, c, d, k, r, islocal)
% X: dim*num data matrix, each column is a data point
% c: number of clusters
% d: projected dimension
% k: number of nei... |
github | haoqipaopao/feature_selection-master | LDFS.m | .m | feature_selection-master/feature selection/LDFS.m | 844 | utf_8 | ffaa733944c4dcd8a93694d63985d3be | % by Xiaojun Chen
function [ranked, SW, W] = LDFS(X,Y,m,k)
epsilon=1e-10;
if nargin < 3
m = ceil(min(sqrt(size(X,1)),100));
end;
if nargin < 4
k=10;
end;
A = KNNDistance(X, k);
num=size(X,2);
d=size(X,1);
label=unique(Y);
SW=zeros(d,d);
SB=zeros(d,d);
Aw=zeros(num,num);
Ab=ones(num,num)/num;
for i=1:leng... |
github | haoqipaopao/feature_selection-master | mrmr_miq_d.m | .m | feature_selection-master/feature selection/mrmr_miq_d.m | 2,911 | utf_8 | 97d8e54df57f0c136815b828e147b95f | function [fea] = mrmr_miq_d(d, f, K)
% function [fea] = mrmr_miq_d(d, f, K)
%
% The MIQ scheme of minimum redundancy maximal relevance (mRMR) feature selection
%
% The parameters:
% d - a N*M matrix, indicating N samples, each having M dimensions. Must be integers.
% f - a N*1 matrix (vector), indicating the class/... |
github | haoqipaopao/feature_selection-master | objdall1.m | .m | feature_selection-master/feature selection/HSICLasso/dal/objdall1.m | 1,653 | utf_8 | f8f07991b55d78e02276937115eed5c2 | % objdall1 - objective function of DAL with L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdall1(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
n = length(ww);
if isempty(info.ATaa)
info.ATaa=A.Ttime... |
github | haoqipaopao/feature_selection-master | set_defaults.m | .m | feature_selection-master/feature selection/HSICLasso/dal/set_defaults.m | 3,789 | utf_8 | 0e8b39e4e024e4a421db1d70b82356b4 | function [opt, isdefault]= set_defaults(opt, varargin)
%[opt, isdefault]= set_defaults(opt, defopt)
%[opt, isdefault]= set_defaults(opt, field/value list)
%
% This functions fills in the given struct opt some new fields with
% default values, but only when these fields DO NOT exist before in opt.
% Existing fields are ... |
github | haoqipaopao/feature_selection-master | dalsqgl.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalsqgl.m | 2,937 | utf_8 | 9a16d566635bbc7d0402d4923ef0fd3c | % dalsqgl - DAL with squared loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx.^2)))
% (grouped L1 norm)
%
% Syntax:
% [xx,status]=dalsqgl(xx0, A, bb, lambda, <opt>)
%
% Inputs:
% xx0 : ini... |
github | haoqipaopao/feature_selection-master | spdiag.m | .m | feature_selection-master/feature selection/HSICLasso/dal/spdiag.m | 279 | utf_8 | 9b8b3f51944fa204e2aaa7a8f26dd3fb | % spdiag - sparse diagonal matrix
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function D = spdiag(d)
if isempty(d)
D = [];
return;
end
if size(d,1)<size(d,2)
d = d';
end
D = spdiags(d,0,size(d,1),size(d,1)); |
github | haoqipaopao/feature_selection-master | mvarfilter.m | .m | feature_selection-master/feature selection/HSICLasso/dal/mvarfilter.m | 484 | utf_8 | 346fef31c23fcfd976223fd915c1ff30 | % mvarfilter - Multivariate AR filter
%
% Example:
% H=randmvar(20,3,10);
% Z=mvarfilter(H0, 2/pi*log(tan(pi*rand(N,M)/2)))';
%
% Copyright(c) 2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function Y=mvarfilter(A, X)
[M1,M2,P]=size(A);
[N,M]=size(X);
if M1~=M2 || M1~=M
... |
github | haoqipaopao/feature_selection-master | objdall1n.m | .m | feature_selection-master/feature selection/HSICLasso/dal/objdall1n.m | 1,720 | utf_8 | 7aca684d4daf6cff938b12704fc52d13 | % objdall1n - objective function of DAL with non-negative L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function varargout=objdall1n(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
n = ... |
github | haoqipaopao/feature_selection-master | dalsql1.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalsql1.m | 2,492 | utf_8 | b0862789d0daef46502b547e330befcd | % dalsql1 - DAL with the squared loss and the L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + lambda*||x||_1
%
% Syntax:
% [xx,status]=dalsql1(xx, A, bb, lambda, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1])
% A : the design matrix A ([mm,nn]) or a... |
github | haoqipaopao/feature_selection-master | loss_lrp.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_lrp.m | 419 | utf_8 | debb2d715476d14a5b1787d9f05415d5 | % loss_lrp - logistic loss function
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_lrp(zz, yy)
zy = zz.*yy;
z2 = 0.5*[zy, -zy];
outmax = max(z2,[],2);
sumexp = sum(exp(z2-outmax(:,[1,1])),2);
logpout = z2-(outmax+log(su... |
github | haoqipaopao/feature_selection-master | ds_softth.m | .m | feature_selection-master/feature selection/HSICLasso/dal/ds_softth.m | 762 | utf_8 | 2c4da40b882920caf0281d081453d696 | % ds_softth - soft threshold function for DS regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss,info]=ds_softth(vv,lambda,info)
ss=zeros(sum(min(info.blks,[],2)),1);
ixs=0;
ixv=0;
for kk=1:size(info.blks,1)
blk=info.blks(kk,:);
... |
github | haoqipaopao/feature_selection-master | loss_hsp.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_hsp.m | 445 | utf_8 | bb5ab7baf7e75b9ee81111490527ddf7 | % loss_hsp - hyperbolic secant loss function
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2009 Stefan Haufe
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_hsp(zz, bb)
% floss = -sum(log(sech(bb-zz)./pi));
% gloss = tanh(zz-bb);
zz = zz-bb;
mz = abs(z... |
github | haoqipaopao/feature_selection-master | l1n_softth.m | .m | feature_selection-master/feature selection/HSICLasso/dal/l1n_softth.m | 354 | utf_8 | 815a804eca57e0d586b959f724bdc41c | % l1n_softth - soft threshold function for non-negative L1 regularization
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=l1n_softth(vv,lambda,info)
n = size(vv,1);
I=find(vv>lambda);
vv=sparse(I,1... |
github | haoqipaopao/feature_selection-master | en_dnorm.m | .m | feature_selection-master/feature selection/HSICLasso/dal/en_dnorm.m | 341 | utf_8 | b360a589f93eedfdd3e0c5f739049d8c | % en_dnorm - conjugate of the Elastic-net regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=en_dnorm(ww,lambda,theta)
if theta<1
ishard=0;
nm = 0.5*sum(max(0,abs(ww)-lambda*theta).^2)/(lambda*(1-theta));
else
ishard=1;
nm ... |
github | haoqipaopao/feature_selection-master | hessMultdalds.m | .m | feature_selection-master/feature selection/HSICLasso/dal/hessMultdalds.m | 1,632 | utf_8 | 3b780b4611bf0790d4b1393d2b48cd92 | % hessMultdalds - function that computes H*x for DAL with the
% dual spectral norm (trace norm) regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function bb = hessMultdalds(aa, A, eta, Hinfo)
info=Hinfo.info;
hloss=Hinfo.hloss;
la... |
github | haoqipaopao/feature_selection-master | dal.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dal.m | 11,038 | utf_8 | 42c560d4a8e9ad063d2387660f202954 | % dal - dual augmented Lagrangian method for sparse learaning/reconstruction
%
% Overview:
% Solves the following optimization problem
% xx = argmin f(x) + lambda*c(x)
% where f is a user specified (convex, smooth) loss function and c
% is a measure of sparsity (currently L1 or grouped L1)
%
% Syntax:
% [ww, uu, ... |
github | haoqipaopao/feature_selection-master | dallrl1.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dallrl1.m | 2,586 | utf_8 | 23fe3ceb4e6ff62f718590fd25c21ec7 | % dallrl1 - DAL with logistic loss and the L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*||x||_1
%
% Syntax:
% [ww,bias,status]=dallrl1(ww0, bias0, A, yy, lambda, <opt>)
%
% Inputs:
% ww0 : initial solution ([nn,1])
% bias0 :... |
github | haoqipaopao/feature_selection-master | l1_softth.m | .m | feature_selection-master/feature selection/HSICLasso/dal/l1_softth.m | 338 | utf_8 | b5cfb9ee5042e9a3ec5ee4f76bdc9934 | % l1_softth - soft threshold function for L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=l1_softth(vv,lambda,info)
n = size(vv,1);
Ip=find(vv>lambda);
In=find(vv<-lambda);
vv=sparse([Ip;In],1,[vv(Ip)-lambda;vv(In)+lambda],... |
github | haoqipaopao/feature_selection-master | objdalgl.m | .m | feature_selection-master/feature selection/HSICLasso/dal/objdalgl.m | 2,680 | utf_8 | 2e2a3317d137d233ef8b8c14763f8010 | % objdalgl - objective function of DAL with grouped L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalgl(aa, info, prob, ww, uu, A, B, lambda, eta)
nn=sum(info.blks);
if isempty(info.ATaa)
info.ATaa=A.Ttimes(aa);
end... |
github | haoqipaopao/feature_selection-master | hessMultdalgl.m | .m | feature_selection-master/feature selection/HSICLasso/dal/hessMultdalgl.m | 681 | utf_8 | bc168bca3a884574a4b2262ba694e29b | % hessMultdalgl - function that computes H*x for DAL with grouped
% L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function yy = hessMultdalgl(xx, A, eta, Hinfo)
blks =Hinfo.blks;
hloss=Hinfo.hloss;
I =Hinfo.I;
vv =Hinfo... |
github | haoqipaopao/feature_selection-master | dallren.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dallren.m | 2,309 | utf_8 | 0114b7779a5493a550be329c06d4aca9 | % dallren - DAL with logistic loss and the Elastic-net regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*sum(theta*abs(x)+0.5*(1-theta)*x.^2)
%
% Syntax:
% [xx,bias,status]=dallren(xx, bias,A, yy, lambda, <opt>)
%
% Inputs:
% xx : in... |
github | haoqipaopao/feature_selection-master | gl_dnorm.m | .m | feature_selection-master/feature selection/HSICLasso/dal/gl_dnorm.m | 310 | utf_8 | 548ff135b603e34521e688eaf10f3709 | % gl_dnorm - conjugate of the grouped L1 regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=gl_dnorm(ww,blks)
nm=0;
ix0=0;
for kk=1:length(blks)
I=ix0+(1:blks(kk));
ix0=I(end);
nm=max(nm, norm(ww(I)));
end
ishard=1; |
github | haoqipaopao/feature_selection-master | vec.m | .m | feature_selection-master/feature selection/HSICLasso/dal/vec.m | 197 | utf_8 | b1da0371244534faa076d4892c1f5bec | % vec - vectorize an array
%
% Copyright(c) 2009-2011 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function V=vec(M)
sz=size(M);
V=reshape(M, [prod(sz), 1]);
|
github | haoqipaopao/feature_selection-master | dalsqds.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalsqds.m | 2,795 | utf_8 | aaf16ed514999fd0313e7a1e3327c880 | % dalsqds - DAL with squared loss and the dual spectral norm
% (trace norm) regularization
%
% Overview:
% Solves the optimization problem:
% ww = argmin 0.5||A*x-bb||^2 + lambda*||w||_DS
%
% where ||w||_DS = sum(svd(w))
%
% Syntax:
% [ww,bias,status]=dalsqds(ww, bias, A, yy, lambda, <opt>)
%
% Inputs:... |
github | haoqipaopao/feature_selection-master | archive.m | .m | feature_selection-master/feature selection/HSICLasso/dal/archive.m | 284 | utf_8 | f6095975ffda71bd8c3d6d9aae23a25e | % archive - pack variables into a struct
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function S=archive(varargin)
S = [];
for i=1:length(varargin)
name =varargin{i};
S = setfield(S, name, evalin('caller', name));
end
|
github | haoqipaopao/feature_selection-master | loss_hsd.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_hsd.m | 697 | utf_8 | 318eb18ee26cd792789ce9e7874a4f59 | % loss_hsd - conjugate hyperbolic secant loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_hsd(aa, yy)
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2009 Stefan Haufe
% This software is distributed under the MIT license. See license.txt
function varargout=loss_hsd(zz, bb)
m=length(bb);
glos... |
github | haoqipaopao/feature_selection-master | en_spec.m | .m | feature_selection-master/feature selection/HSICLasso/dal/en_spec.m | 240 | utf_8 | 5c3c02603f633b327c2329792acd9f75 | % en_spec - spectrum function for the Elastic-net regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function nm=en_spec(ww,theta)
nm=theta*abs(ww)+0.5*(1-theta)*ww.^2;
|
github | haoqipaopao/feature_selection-master | l1n_spec.m | .m | feature_selection-master/feature selection/HSICLasso/dal/l1n_spec.m | 377 | utf_8 | f6ec361bb27d59f27d21647d93e32ec7 | % l1n_spec - spectrum function for the non-negative L1 regularizer
%
% Copyright(c) 2009-2011 Ryota Tomioka
% 2011 Shigeyuki Oba
% This software is distributed under the MIT license. See license.txt
function ss=l1n_spec(ww)
n=size(ww,1);
Ip=find(ww>0); lenp=length(Ip);
In=find(ww<0); lenn=length(I... |
github | haoqipaopao/feature_selection-master | loss_lrd.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_lrd.m | 574 | utf_8 | f1fa72d1eff87af2af3f4fccf018fd9c | % loss_lrd - conjugate logistic loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_lrd(aa, yy)
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout = loss_lrd(aa, yy)
mm=length(aa);
gloss=nan*ones(mm,1);
ya = aa.*yy;
I = find(0<ya & ... |
github | haoqipaopao/feature_selection-master | dallrgl.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dallrgl.m | 3,477 | utf_8 | 071af63f08df43fe71b5ee06e941cad2 | % dallrgl - DAL with logistic loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx,bias] = argmin sum(log(1+exp(-yy.*(A*x+bias)))) + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx(Ii).^2)))
% (Ii is the index-set of the i-th group
%
% Syntax:
% [xx,bias,status]=dallrg... |
github | haoqipaopao/feature_selection-master | objdalds.m | .m | feature_selection-master/feature selection/HSICLasso/dal/objdalds.m | 1,484 | utf_8 | 670fbfb2f3845d2ffc874b8d01c0cddc | % objdalds - objective function of DAL with the dual spectral norm
% (trace norm) regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalds(aa, info, prob, ww, uu, A, B, lambda, eta)
m = length(aa);
if isempty(info.... |
github | haoqipaopao/feature_selection-master | objdalen.m | .m | feature_selection-master/feature selection/HSICLasso/dal/objdalen.m | 1,755 | utf_8 | aa6b61658201fdf31f6acc14007caeba | % objdalen - objective function of DAL with the Elastic-net regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout=objdalen(aa, info, prob, ww, uu, A, B, lambda, eta)
theta=info.theta;
m = length(aa);
n = length(ww);
if isempty(inf... |
github | haoqipaopao/feature_selection-master | ds_dnorm.m | .m | feature_selection-master/feature selection/HSICLasso/dal/ds_dnorm.m | 353 | utf_8 | 2989cfee52d30f7227684a727837bcb5 | % ds_dnorm - conjugate of the dual spectral norm regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [nm,ishard]=ds_dnorm(ww,blks)
nm=0;
ix0=0;
for kk=1:size(blks,1)
blk=blks(kk,:);
I=ix0+(1:blk(1)*blk(2));
ix0=I(end);
nm=max(nm,norm(re... |
github | haoqipaopao/feature_selection-master | evalgap.m | .m | feature_selection-master/feature selection/HSICLasso/dal/evalgap.m | 594 | utf_8 | 2335b40b2884ed2677231e2068a39e40 | function gap = evalgap(fnc, fspec, dnorm, ww, uu, A, B, lambda)
[ff,gg]=evalloss(fnc,ww,uu,A,B);
fval = ff+lambda*sum(fspec(ww));
dval = evaldual(fnc,dnorm,-gg,A,B,lambda);
gap = (fval+dval)/fval;
function [fval,gg]=evalloss(fnc, ww, uu, A, B)
if ~isempty(uu)
zz=A*ww+B*uu;
else
zz=A*ww;
end
[fval, gg] =fnc.p(... |
github | haoqipaopao/feature_selection-master | hessMultdall1.m | .m | feature_selection-master/feature selection/HSICLasso/dal/hessMultdall1.m | 421 | utf_8 | 0b74b26b2f1ac5be768d661e759c297b | % hessMultdall1 - function that computes H*x for DAL with L1
% regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function yy = hessMultdall1(xx, A, eta, Hinfo)
hloss=Hinfo.hloss;
AF=Hinfo.AF;
I=Hinfo.I;
n=Hinfo.n;
len=length(I);
yy... |
github | haoqipaopao/feature_selection-master | gl_spec.m | .m | feature_selection-master/feature selection/HSICLasso/dal/gl_spec.m | 324 | utf_8 | 85b9979a663d9937f3cfa0f3ef96c135 | % gl_spec - spectrum function for the grouped L1 regularizer
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function nm=gl_spec(ww,blks)
nn=length(blks);
nm=zeros(nn,1);
ixw=0;
for kk=1:length(blks)
I=ixw+(1:blks(kk));
ixw=I(end);
nm(kk)=norm(ww(I));
... |
github | haoqipaopao/feature_selection-master | loss_sqp.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_sqp.m | 224 | utf_8 | 22264a52cbc12f19b18430efdb90d6a9 | % loss_sqp - squared loss function
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [floss, gloss]=loss_sqp(zz, bb)
gloss = zz-bb;
floss = 0.5*sum(gloss.^2); |
github | haoqipaopao/feature_selection-master | dalhsgl.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalhsgl.m | 3,258 | utf_8 | 7094eb2149ed9308f5af6fc035a3755c | % dalhsgl - DAL with hyperbolic secant loss and grouped L1 regularization
%
% Overview:
% Solves the optimization problem:
% [xx,bias] = argmin sum(log(sech(A*x+bias))) + lambda*||x||_G1
% where
% ||x||_G1 = sum(sqrt(sum(xx(Ii).^2)))
% (Ii is the index-set of the i-th group
%
% Syntax:
% [xx,bias,status]=dallr... |
github | haoqipaopao/feature_selection-master | dallrds.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dallrds.m | 2,882 | utf_8 | 2ec9546bce6e8b6b9424f0ff1e4aee2a | % dallrds - DAL with logistic loss and the dual spectral norm
% (trace norm) regularization
%
% Overview:
% Solves the optimization problem:
% ww = argmin sum(log(1+exp(-yy.*(A*w+b)))) + lambda*||w||_DS
%
% where ||w||_DS = sum(svd(w))
%
% Syntax:
% [ww,bias,status]=dallrds(ww, bias, A, yy, lambda, <op... |
github | haoqipaopao/feature_selection-master | lbfgs.m | .m | feature_selection-master/feature selection/HSICLasso/dal/lbfgs.m | 4,442 | utf_8 | 83c09fde390bb3fe637fb9bd8997bdfb | % lbfgs - L-BFGS algorithm
%
% Syntax:
% [xx, status] = lbfgs(fun, xx, ll, uu, <opt>)
%
% Input:
% fun - objective function
% xx - Initial point for optimization
% ll - lower bound on xx
% uu - upper bound on xx
% Ac - inequality constraint:
% bc - Ac*xx<=bc
% opt - Struct o... |
github | haoqipaopao/feature_selection-master | dalsql1n.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalsql1n.m | 2,565 | utf_8 | 29827f9adfbbda961080d78bedcfa02d | % dalsql1n - DAL with the squared loss and the non-negative L1 regularization
%
% Overview:
% Solves the optimization problem:
% xx = argmin 0.5||A*x-bb||^2 + lambda*||x||_1 s.t. x>=0
%
% Syntax:
% [xx,status]=dalsql1(xx, A, bb, lambda, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1])
% A : the design... |
github | haoqipaopao/feature_selection-master | gl_softth.m | .m | feature_selection-master/feature selection/HSICLasso/dal/gl_softth.m | 682 | utf_8 | 97ffdab8eb4b1716a4209208d6012268 | % gl_softth - soft threshold function for grouped L1 regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=gl_softth(vv, lambda,info)
if all(info.blks==info.blks(1))
n=length(vv);
bsz=info.blks(1);
vv=reshape(vv,[bsz,n/bsz]);
... |
github | haoqipaopao/feature_selection-master | randsparse.m | .m | feature_selection-master/feature selection/HSICLasso/dal/randsparse.m | 525 | utf_8 | 9edbce6f3773a80edb5dbfbea5e78b89 | % randsparse - generates a random sparse vector or a column-wise
% sparse matrix
%
% Example:
% ww = randsparse(64, 8);
% ww = randsparse([64, 64], 8);
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function ww = randsparse(n, k, r)
if length(n)... |
github | haoqipaopao/feature_selection-master | loss_sqd.m | .m | feature_selection-master/feature selection/HSICLasso/dal/loss_sqd.m | 456 | utf_8 | 5e1a573866b0ab6ef9dbf2dab1a96d33 | % loss_sqd - conjugate squared loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_sqd(aa, bb)
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout = loss_sqd(aa, bb)
gloss = aa-bb;
floss = 0.5*sum(gloss.^2)-0.5*sum(bb.^2);
hloss = spdia... |
github | haoqipaopao/feature_selection-master | dalsqen.m | .m | feature_selection-master/feature selection/HSICLasso/dal/dalsqen.m | 2,721 | utf_8 | c3d31a07e41eed3c3facdb9c94eebd6a | % dalsqen - DAL with squared loss and the Elastic-net regularization
%
% Overview:
% Solves the optimization problem:
% [xx, bias] = argmin 0.5||A*x-bb||^2 + lambda*sum(theta*abs(x)+0.5*(1-theta)*x.^2)
%
% Syntax:
% [xx,status]=dalsqen(xx, A, bb, lambda, theta, <opt>)
%
% Inputs:
% xx : initial solution ([nn,1... |
github | haoqipaopao/feature_selection-master | en_softth.m | .m | feature_selection-master/feature selection/HSICLasso/dal/en_softth.m | 450 | utf_8 | eb1b8dde47c826e2bcb46d180aa69e05 | % en_softth - soft threshold function for the Elastic-net regularization
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=en_softth(vv,lambda,info)
n = size(vv,1);
theta = info.theta;
if theta<1
I=find(abs(vv)>lambda*theta);
vv=sparse(I,1... |
github | haoqipaopao/feature_selection-master | newton.m | .m | feature_selection-master/feature selection/HSICLasso/dal/newton.m | 2,870 | utf_8 | 86ab8f25bd6ab5b755f157d6b6f04e6a | % newton - a simple implementation of the Newton method
%
% Syntax:
% [xx,fval,gg,status]=newton(fun, xx, ll, uu, Ac, bc, tol, finddir, info, verbose, varargin);
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
%
function [xx,fval,gg,status]=newton(fun, xx, ll, ... |
github | haoqipaopao/feature_selection-master | L21R21.m | .m | feature_selection-master/feature selection/RFS/L21R21.m | 933 | utf_8 | 7b3b336d66c46fc5757e00b641c57def | function [X, obj]=L21R21(A, Y, r)
%% 21-norm loss with 21-norm regularization
%% Problem
%
% min_X || A X - Y||_21 + r * ||X||_21 is equivalent to:
%
% min_X ||X||_21 + ||E||_21
% s.t. A X + r*E = Y
% Ref: Feiping Nie, Heng Huang, Xiao Cai, Chris Ding.
% Efficient and Robust Feature Selection via Joint ... |
github | haoqipaopao/feature_selection-master | mRMR.m | .m | feature_selection-master/feature selection/FSLib_v4.0_2016/methods/mRMR.m | 2,153 | utf_8 | c72943faf5258f69039e550c5d14671d | function [ranked, score] = mRMR(X_train, Y_train, K)
% X_train : n x d, n is numbers of samples and d is numbers of features
% Y_train : n x 1, n is numbers of samples
% Matlab Code-Library for Feature Selection
% Support: Giorgio Roffo email: giorgio.roffo@univr.it
% If you use our toolbox please cite our paper:
%
% ... |
github | alexbaucom17/RoboCupSoccerSim-master | behavior_simpleFSM.m | .m | RoboCupSoccerSim-master/@player/behavior_simpleFSM.m | 2,415 | utf_8 | 757209b865f7f26106eb10d4b8e5d823 | function obj = behavior_simpleFSM(obj,world)
%BEHAVIOR runs simple fsm to simulate player behavior
%simple FSM
if obj.behaviorState == player.KICK
obj = behavior_kick(obj,world);
elseif obj.behaviorState == player.MOVE
obj = behavior_move(obj,world);
elseif obj.behaviorState == player.SEARCH;
obj ... |
github | alexbaucom17/RoboCupSoccerSim-master | behavior_advancedFSM.m | .m | RoboCupSoccerSim-master/@player/behavior_advancedFSM.m | 3,622 | utf_8 | 79ecb12f0ce3aa74363a082c3a1695a4 | function obj = behavior_advancedFSM(obj,world)
%BEHAVIOR runs simple fsm to simulate player behavior
%simple FSM
if obj.behaviorState == player.KICK
obj = behavior_kick(obj,world);
elseif obj.behaviorState == player.MOVE
obj = behavior_move(obj,world);
elseif obj.behaviorState == player.SEARCH;
ob... |
github | alexbaucom17/RoboCupSoccerSim-master | VisPFF.m | .m | RoboCupSoccerSim-master/pff/VisPFF.m | 2,572 | utf_8 | e7b41577ea09eeb6f18b0b61d50e4033 | function [] = VisPFF(p,b,w,cfg,num,clr,ax)
%VISPFF Visualize potential field function
%graph params
xmin = -cfg.field_length_max;
xmax = cfg.field_length_max;
ymin = -cfg.field_width_max;
ymax = cfg.field_width_max;
step_size = 0.1;
%set up grid
[X,Y] = meshgrid(xmin:step_size:xmax,ymin:step_size:ymax);
%get info a... |
github | alexbaucom17/RoboCupSoccerSim-master | calculate_distances.m | .m | RoboCupSoccerSim-master/pff/calculate_distances.m | 1,286 | utf_8 | 046074b856aa6ef891db5fe4da48dc56 | function [dball,dshotpath,dshotpathDef,dgoalAtt,dgoalDef,dbehindball,dsideline,dteammate] ...
= calculate_distances(cfg,Pxy,Pa,Bxy,Txy,dir)
%distance to boundaries
xb = cfg.field_length_max;
yb = cfg.field_width_max;
dsideline = abs([xb-Pxy(:,1), -xb-Pxy(:,1), yb-Pxy(:,2),-yb-Pxy(:,2)]);
%distance to ... |
github | alexbaucom17/RoboCupSoccerSim-master | HandleCollisions.m | .m | RoboCupSoccerSim-master/game/HandleCollisions.m | 6,006 | utf_8 | d8d5ded67f6d527094013ab50bd69106 | function [p,b,w] = HandleCollisions(p,b,cfg,w)
%HANDLECOLLISIONS Checks for collisions between players and ball as well as
%kicks
% Checks if there are colisions and calculates new velocities based on
% elastic collision model. New velocites are updated in objects and
% output as Pnew and Bnew
%get config parame... |
github | jugg1024/py-faster-rcnn-master | voc_eval.m | .m | py-faster-rcnn-master/lib/datasets/VOCdevkit-matlab-wrapper/voc_eval.m | 1,332 | utf_8 | 3ee1d5373b091ae4ab79d26ab657c962 | function res = voc_eval(path, comp_id, test_set, output_dir)
VOCopts = get_voc_opts(path);
VOCopts.testset = test_set;
for i = 1:length(VOCopts.classes)
cls = VOCopts.classes{i};
res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir);
end
fprintf('\n~~~~~~~~~~~~~~~~~~~~\n');
fprintf('Results:\n');
aps = [res(:... |
github | Haoran-S/DNN_WMMSE-master | trainDNN.m | .m | DNN_WMMSE-master/trainDNN.m | 1,881 | utf_8 | 5dc901fee1396e9b7215537eadf2b36c | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b prerelease platform.
%
% Refer... |
github | Haoran-S/DNN_WMMSE-master | trainperformance.m | .m | DNN_WMMSE-master/trainperformance.m | 1,402 | utf_8 | f62992236b324e1434f04ba96b709419 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b prerelease platform.
%
% Refer... |
github | Haoran-S/DNN_WMMSE-master | obj_IA_sum_rate.m | .m | DNN_WMMSE-master/obj_IA_sum_rate.m | 871 | utf_8 | 870582ddc6689faa057f41d942993441 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b prerelease platform.
%
% Refer... |
github | Haoran-S/DNN_WMMSE-master | generate.m | .m | DNN_WMMSE-master/generate.m | 1,164 | utf_8 | 286f1f2a4fd4fc0cdce404691c1b23b5 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b platform.
%
% References:... |
github | Haoran-S/DNN_WMMSE-master | WMMSE_sum_rate.m | .m | DNN_WMMSE-master/WMMSE_sum_rate.m | 1,456 | utf_8 | 08c2709a6e878ff8be13bbaf22b09c3d | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b prerelease platform.
%
% Refer... |
github | Haoran-S/DNN_WMMSE-master | testperformance.m | .m | DNN_WMMSE-master/testperformance.m | 2,261 | utf_8 | ba9ae1083e1bfcfbe86fe8516f3295dc | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MATLAB code to reproduce our work on DNN research for ICASSP 2017.
% To run our code, Neuron Network Toolbox and Deep Learning Toolbox need to be installed first.
% Code has been tested successfully on MATLAB 2016b prerelease platform.
%
% Refer... |
github | karaimer/camera-pipeline-UI-master | camera_pipeline.m | .m | camera-pipeline-UI-master/camera_pipeline.m | 24,691 | utf_8 | ba33f59a54bd3dc647fd27f8f305147e | function varargout = camera_pipeline(varargin)
% CAMERA_PIPELINE MATLAB code for camera_pipeline.fig
% CAMERA_PIPELINE, by itself, creates a new CAMERA_PIPELINE or raises the existing
% singleton*.
%
% H = CAMERA_PIPELINE returns the handle to a new CAMERA_PIPELINE or the handle to
% the existing si... |
github | mws262/MATLAB-Reinforcement-Learning-Pendulum-master | QlearnPend.m | .m | MATLAB-Reinforcement-Learning-Pendulum-master/QlearnPend.m | 11,383 | utf_8 | 61d711acfe132d5141f8584d0de4c884 | function QlearnPend
%% Example reinforcement learning - Q-learning code
% Learn a control policy to optimally swing a pendulum from vertical down,
% to vertical up with torque limits and (potentially) noise. Both the
% pendulum and the policy are animated as the process is going. The
% difference from dynamic programmi... |
github | ShaoqingRen/caffe-fast-rcnn-master | classification_demo.m | .m | caffe-fast-rcnn-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | NeuroInfoPrimer/primer-master | dlogloss.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/dlogloss.m | 1,374 | utf_8 | 5b290d23538f067577f725ebb528ad73 | %%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%%%%***###!!!$$$^^^<<<{{{[[[(((%%%)))]]]}}}>>>^^^$$$!!!###***%%%%%
%%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%% %%%
%%% Gradient of the log loss funct... |
github | NeuroInfoPrimer/primer-master | dlinmin.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/dlinmin.m | 1,154 | utf_8 | dd2820a0e01e3e22b4fd8005927fd847 | %| FUNCTION: dlinmin
%|
%| PURPOSE: Given an n-dimensional point p[1..n] and an
%| n-dimensional direction xi[1..n], moves and resets p to where
%| the function func(p) takes on a minimum along the direction xi
%| from p, and replaces xi by the actual vector displacement that
%| p was moved. Also ret... |
github | NeuroInfoPrimer/primer-master | logloss.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/logloss.m | 1,422 | utf_8 | ad19504c26aaeaac487f78b28cf14833 | %%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%%%%***###!!!$$$^^^<<<{{{[[[(((%%%)))]]]}}}>>>^^^$$$!!!###***%%%%%
%%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%% %%%
%%% The log loss function ... |
github | NeuroInfoPrimer/primer-master | dbrent.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/dbrent.m | 3,670 | utf_8 | 0d2c81dafe58996db6bd31f1247ab485 | %| FUNCTION: dbrent
%|
%| PURPOSE: Given a function f and its derivative function df, and
%| given a bracketing triplet of abscissas ax, bx, cx [such that
%| bx is between ax and cx, and f(bx) is less than both f(ax) and
%| f(cx)], this routine isolates the minimum to a fractional precision
%| of abou... |
github | NeuroInfoPrimer/primer-master | df1dim.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/df1dim.m | 213 | utf_8 | f9e40143ce3d6dc45cdfe724290966fd |
function [df] = df1dim(x, stim, avgs, order)
% Must accompany linmin.
global pcom; % Defned in linmin.
global xicom;
global nrdfun;
df = dot(feval(nrdfun, pcom + x.*xicom, stim, avgs, order),xicom); |
github | NeuroInfoPrimer/primer-master | f1dim.m | .m | primer-master/RetinaScripts/RetinaMNEGLM/f1dim.m | 280 | utf_8 | d34aa9e52f8841e546acac1b9c33eb71 | % Move pcom (x units in xicom direction), and then evaluate the function there.
function [f] = f1dim(x, stim, resp, order)
% Must accompany linmin.
global pcom; % Defned in linmin.
global xicom;
global nrfunc;
f = feval(nrfunc, pcom + x.*xicom, stim, resp, order);
|
github | NeuroInfoPrimer/primer-master | lars.m | .m | primer-master/MotorScripts/L1Group/misc/lars.m | 6,896 | utf_8 | 1b6635966f0fc004e75d4443e5a44672 | function beta = lars(X, y, method, stop, useGram, Gram, trace)
% LARS The LARS algorithm for performing LAR or LASSO.
% BETA = LARS(X, Y) performs least angle regression on the variables in
% X to approximate the response Y. Variables X are assumed to be
% normalized (zero mean, unit length), the response... |
github | NeuroInfoPrimer/primer-master | myProcessOptions.m | .m | primer-master/MotorScripts/L1Group/misc/myProcessOptions.m | 674 | utf_8 | b94d252a960faa95a3074129247619e6 | function [varargout] = myProcessOptions(options,varargin)
% Similar to processOptions, but case insensitive and
% using a struct instead of a variable length list
options = toUpper(options);
for i = 1:2:length(varargin)
if isfield(options,upper(varargin{i}))
v = getfield(options,upper(varargin{i}));
... |
github | NeuroInfoPrimer/primer-master | minConf_PQN.m | .m | primer-master/MotorScripts/L1Group/minConf/minConf_PQN.m | 8,246 | utf_8 | 982955326f59fecc4cf6993c3b7428aa | function [x,f,funEvals] = minConf_PQN(funObj,x,funProj,options)
% function [x,f] = minConf_PQN(funObj,funProj,x,options)
%
% Function for using a limited-memory projected quasi-Newton to solve problems of the form
% min funObj(x) s.t. x in C
%
% The projected quasi-Newton sub-problems are solved the spectral pr... |
github | NeuroInfoPrimer/primer-master | minConf_QNST.m | .m | primer-master/MotorScripts/L1Group/minConf/minConf_QNST.m | 5,460 | utf_8 | d3af055fa412ac52b199c8238fc83783 | function [x,f,funEvals] = minConf_QNST(funObj1,funObj2,x,funProj,options)
nVars = length(x);
if nargin < 5
options = [];
end
[verbose,numDiff,optTol,progTol,maxIter,maxProject,suffDec,corrections,adjustStep,bbInit,...
BBSToptTol,BBSTprogTol,BBSTiters,BBSTtestOpt] = ...
myProcessOptions(...
... |
github | NeuroInfoPrimer/primer-master | auxGroupLinfProject.m | .m | primer-master/MotorScripts/L1Group/L1GeneralGroup/auxGroupLinfProject.m | 1,001 | utf_8 | beb66218882b76d74e58a8e4e86a0591 | function w = groupLinfProject(w,p,groupStart,groupPtr)
alpha = w(p+1:end);
w = w(1:p);
for i = 1:length(groupStart)-1
groupInd = groupPtr(groupStart(i):groupStart(i+1)-1);
[w(groupInd) alpha(i)] = projectAuxSort(w(groupInd),alpha(i));
end
w = [w;alpha];
end
%% Function to solve the projection f... |
github | NeuroInfoPrimer/primer-master | auxGroupL2Project.m | .m | primer-master/MotorScripts/L1Group/L1GeneralGroup/auxGroupL2Project.m | 605 | utf_8 | 9c39c0d039de49b67d1d078c6467f3e3 | function w = groupL2Proj(w,p,groupStart,groupPtr)
alpha = w(p+1:end);
w = w(1:p);
for i = 1:length(groupStart)-1
groupInd = groupPtr(groupStart(i):groupStart(i+1)-1);
[w(groupInd) alpha(i)] = projectAux(w(groupInd),alpha(i));
end
w = [w;alpha];
end
%% Function to solve the projection for a sing... |
github | NeuroInfoPrimer/primer-master | auxGroupTraceProject.m | .m | primer-master/MotorScripts/L1Group/L1GeneralGroup/auxGroupTraceProject.m | 471 | utf_8 | 75aefb7ec1bc20dd5b98fc309b19da0a | function w = auxGroupTraceProject(w,p,groupStart,groupPtr)
for i = 1:length(groupStart)-1
groupInd = groupPtr(groupStart(i):groupStart(i+1)-1);
[w(groupInd) w(p+i)] = projectAux(w(groupInd),w(p+i));
end
end
%% Function to solve the projection for a single group
function [w,alpha] = projectAux(w,alpha)
... |
github | NeuroInfoPrimer/primer-master | WolfeLineSearch.m | .m | primer-master/MotorScripts/L1Group/minFunc/WolfeLineSearch.m | 10,940 | utf_8 | e22d61df54bf0f9435499fe9e088dc7c | function [t,f_new,g_new,funEvals,H] = WolfeLineSearch(...
x,t,d,f,g,gtd,c1,c2,LS_interp,LS_multi,maxLS,progTol,debug,doPlot,saveHessianComp,funObj,varargin)
%
% Bracketing Line Search to Satisfy Wolfe Conditions
%
% Inputs:
% x: starting location
% t: initial step size
% d: descent direction
% f: f... |
github | NeuroInfoPrimer/primer-master | minFunc_processInputOptions.m | .m | primer-master/MotorScripts/L1Group/minFunc/minFunc_processInputOptions.m | 4,051 | utf_8 | 03b67f61e5a46b98f2b6d82c3cdf76b1 |
function [verbose,verboseI,debug,doPlot,maxFunEvals,maxIter,optTol,progTol,method,...
corrections,c1,c2,LS_init,cgSolve,qnUpdate,cgUpdate,initialHessType,...
HessianModify,Fref,useComplex,numDiff,LS_saveHessianComp,...
Damped,HvFunc,bbType,cycle,...
HessianIter,outputFcn,useMex,useNegCurv,precFunc... |
github | NeuroInfoPrimer/primer-master | plot_gaussian_ellipsoid.m | .m | primer-master/MotorScripts/MotorGLM/plot_gaussian_ellipsoid.m | 3,937 | utf_8 | ae2127fbc22ee6e04ff9fa0b51052530 | function h = plot_gaussian_ellipsoid(m, C, sdwidth, npts, axh)
% PLOT_GAUSSIAN_ELLIPSOIDS plots 2-d and 3-d Gaussian distributions
%
% H = PLOT_GAUSSIAN_ELLIPSOIDS(M, C) plots the distribution specified by
% mean M and covariance C. The distribution is plotted as an ellipse (in
% 2-d) or an ellipsoid (in 3-d).... |
github | NeuroInfoPrimer/primer-master | addpath_recurse.m | .m | primer-master/MotorScripts/MotorGLM/addpath_recurse.m | 8,674 | utf_8 | a2d45a9c2aefb5990bd2657c6872e3c2 | function addpath_recurse(strStartDir, caStrsIgnoreDirs, strXorIntAddpathMode, blnRemDirs, blnDebug)
%ADDPATH_RECURSE Adds (or removes) the specified directory and its subfolders
% addpath_recurse(strStartDir, caStrsIgnoreDirs, strXorIntAddpathMode, blnRemDirs, blnDebug)
%
% By default, all hidden directories (prec... |
github | NeuroInfoPrimer/primer-master | simGLM_monkey.m | .m | primer-master/MotorScripts/MotorGLM/simGLM_monkey.m | 4,986 | utf_8 | c7d3b172144b620fc5edf9e54e0ebb67 | function [tsp,Vmem,Ispk,conv] = simGLM(glmprs,Stim, time_limit, offset);
% [tsp, Vmem,Ispk] = simGLM(glmprs,Stim);
%
% Compute response of glm to stimulus Stim.
%
% Uses time rescaling instead of Bernouli approximation to conditionally
% Poisson process
%
% Dynamics: Filters the Stimulus with glmprs.k, passes... |
github | NeuroInfoPrimer/primer-master | get_slow_var.m | .m | primer-master/WhiskerScripts/get_slow_var.m | 1,468 | utf_8 | f275c954b30b76cbfd149c609befb7e4 | %
% Use the phase (p) to find the turning points of the whisks (tops and
% bottoms), and calculate a value on each consecutive whisk using the
% function handle (operation). The values are calculated twice per
% whisk cycle using both bottom-to-bottom and top-to-top. The values
% are linearly interpolated betw... |
github | NeuroInfoPrimer/primer-master | phase_from_hilbert.m | .m | primer-master/WhiskerScripts/phase_from_hilbert.m | 1,415 | utf_8 | 8f92f7ca8ddd9be4cf629146bf19f040 | % Computationally, the Hilbert Transform is the Fourier
% Transform with zero amplitude at all negative frequenices. This
% is equivalent to phase-shifting the time-domain signal by 90 degrees
% at all frequencies and then adding this as an imaginary signal to the
% original signal.
% So ... |
github | NeuroInfoPrimer/primer-master | dlogloss.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/dlogloss.m | 1,374 | utf_8 | 5b290d23538f067577f725ebb528ad73 | %%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%%%%***###!!!$$$^^^<<<{{{[[[(((%%%)))]]]}}}>>>^^^$$$!!!###***%%%%%
%%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%% %%%
%%% Gradient of the log loss funct... |
github | NeuroInfoPrimer/primer-master | dlinmin.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/dlinmin.m | 1,154 | utf_8 | dd2820a0e01e3e22b4fd8005927fd847 | %| FUNCTION: dlinmin
%|
%| PURPOSE: Given an n-dimensional point p[1..n] and an
%| n-dimensional direction xi[1..n], moves and resets p to where
%| the function func(p) takes on a minimum along the direction xi
%| from p, and replaces xi by the actual vector displacement that
%| p was moved. Also ret... |
github | NeuroInfoPrimer/primer-master | logloss.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/logloss.m | 1,422 | utf_8 | ad19504c26aaeaac487f78b28cf14833 | %%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%%%%***###!!!$$$^^^<<<{{{[[[(((%%%)))]]]}}}>>>^^^$$$!!!###***%%%%%
%%%%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%%%
%%% %%%
%%% The log loss function ... |
github | NeuroInfoPrimer/primer-master | dbrent.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/dbrent.m | 3,670 | utf_8 | 0d2c81dafe58996db6bd31f1247ab485 | %| FUNCTION: dbrent
%|
%| PURPOSE: Given a function f and its derivative function df, and
%| given a bracketing triplet of abscissas ax, bx, cx [such that
%| bx is between ax and cx, and f(bx) is less than both f(ax) and
%| f(cx)], this routine isolates the minimum to a fractional precision
%| of abou... |
github | NeuroInfoPrimer/primer-master | df1dim.m | .m | primer-master/WhiskerScripts/WhiskerMNEGLM/df1dim.m | 213 | utf_8 | f9e40143ce3d6dc45cdfe724290966fd |
function [df] = df1dim(x, stim, avgs, order)
% Must accompany linmin.
global pcom; % Defned in linmin.
global xicom;
global nrdfun;
df = dot(feval(nrdfun, pcom + x.*xicom, stim, avgs, order),xicom); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.