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 | tonyabracadabra/Factorization-Machine-10725-master | dallrds.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dallrds.m | 2,884 | utf_8 | 50683ef2a90204c94427e7061ae0a319 | % 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 | tonyabracadabra/Factorization-Machine-10725-master | loss_sqdw.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/loss_sqdw.m | 516 | utf_8 | 61ee88516875cda0bd1bd4a5ed3b0468 | % loss_sqd - conjugate of weighted squared loss function
%
% Syntax:
% [floss, gloss, hloss, hmin]=loss_sqd(aa, bb, weight)
%
% Copyright(c) 2009 Ryota Tomioka
% This software is distributed under the MIT license. See license.txt
function varargout = loss_sqdw(aa, bb, weight)
gloss = aa./weight-bb;
floss = 0.5*sum(we... |
github | tonyabracadabra/Factorization-Machine-10725-master | lbfgs.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/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 | tonyabracadabra/Factorization-Machine-10725-master | al1_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/al1_softth.m | 366 | utf_8 | 0d5966a03bcccf0e0716ff9eb364d7db | % al1_softth - soft threshold function for adaptive L1 regularization
%
% Copyright(c) 2009- Ryota Tomioka, Satoshi Hara
% This software is distributed under the MIT license. See license.txt
function [vv,ss]=al1_softth(vv,pp,info)
n = size(vv,1);
Ip=find(vv>pp);
In=find(vv<-pp);
vv=sparse([Ip;In],1,[vv(... |
github | tonyabracadabra/Factorization-Machine-10725-master | dalsql1n.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsql1n.m | 2,567 | utf_8 | 27b15aa096a461993cbae97a0f61271d | % 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 | tonyabracadabra/Factorization-Machine-10725-master | gl_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/gl_softth.m | 733 | utf_8 | 69690be9f0204d2642cd8d56d0ed6ed9 | % 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 | tonyabracadabra/Factorization-Machine-10725-master | randsparse.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/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 | tonyabracadabra/Factorization-Machine-10725-master | loss_sqd.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/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 | tonyabracadabra/Factorization-Machine-10725-master | dalsqen.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/dalsqen.m | 2,723 | utf_8 | b11b42e4545b2161126346d59ede35f7 | % 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 | tonyabracadabra/Factorization-Machine-10725-master | en_softth.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/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 | tonyabracadabra/Factorization-Machine-10725-master | newton.m | .m | Factorization-Machine-10725-master/yanyu_code/dal/matlab/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 | tudelft/paparazzi_log_parsing-master | messages.m | .m | paparazzi_log_parsing-master/matlab/tools/messages.m | 4,711 | utf_8 | 8d350b0e4ba09a799b5d88dc89f191cb | function s = messages(filename)
% Parse the messages XML file
% General variables
paparazzi_home = getenv('PAPARAZZI_HOME');
% When no filename is given
if nargin < 1 || isempty(filename)
% First use PAPARAZZI_HOME else use messages xml from current folder
if isempty(paparazzi_home)
paparazzi_var = pw... |
github | tudelft/paparazzi_log_parsing-master | parselog.m | .m | paparazzi_log_parsing-master/matlab/tools/parselog.m | 6,535 | utf_8 | cf67c195aef0fffc84b6e76b8bc5ba13 | function s = parselog(filename, msgs)
% Check if the data file exists
[filepath, name,] = fileparts(filename);
filename = strcat(filepath, filesep, name, '.data');
if exist(filename, 'file') ~= 2
error("The log file does not exist '%s'", filename)
end
% Try to find the correct messages xml file
got_log = false;
... |
github | tudelft/paparazzi_log_parsing-master | pprz_3d_animation.m | .m | paparazzi_log_parsing-master/matlab/3d_animation/pprz_3d_animation.m | 23,452 | utf_8 | dc45cc53435adba0cbe150bdab05b392 | function [] = pprz_3d_animation(...
model_mat_file, ...
quat, ...
quat_ref, ...
actuators, ...
rc_commands, ...
angle_of_attack_deg, ...
angle_of_sideslip_deg, ...
airspeed, ...
altitude_m, ...
frame_time, ...
sp... |
github | tudelft/paparazzi_log_parsing-master | stlWrite.m | .m | paparazzi_log_parsing-master/matlab/3d_animation/stlTools/stlWrite.m | 10,034 | utf_8 | b9751f5666a6eb354356ef413aa2355b | function stlWrite(filename, varargin)
%STLWRITE Write STL file from patch or surface data.
%
% STLWRITE(FILE, FV) writes a stereolithography (STL) file to FILE for a
% triangulated patch defined by FV (a structure with fields 'vertices'
% and 'faces').
%
% STLWRITE(FILE, FACES, VERTICES) takes faces and verti... |
github | tudelft/paparazzi_log_parsing-master | get_ic.m | .m | paparazzi_log_parsing-master/matlab/math/get_ic.m | 407 | utf_8 | bbd3fac519e6b9eab90bfd5f6efce82d | % Get the inital conditions for a discrete filter based on an intial value
function ic = get_ic(b,a,iv)
% Amount of channels to be filtered, determined based on the amount of ivs
n = size(iv,2);
% initial values for a and b coefficients
iva = ones(length(a)-1,1)*iv;
ivb = ones(length(b),1)*iv;
% pre allocate ic
ic =... |
github | wkool/tradeoffs-master | determineTask.m | .m | tradeoffs-master/simulations/determineTask.m | 1,598 | utf_8 | 37079b12fbb068a29edf8a7136f72239 | function data = determineTask
% This function is used to determine which simulation code should be used
% given the type of two-step task that the user wants to analyze.
%
% Wouter Kool, August 2016
bounds = [];
while (isempty(bounds)) || (bounds~=1&&bounds~=2)
bounds = input('Narrow ([.25 .75]; press 1) or broad... |
github | shlizee/fpnets-classification-master | getmodes_winnertakeall_optim.m | .m | fpnets-classification-master/code/getmodes_winnertakeall_optim.m | 1,900 | utf_8 | c511365bc26e09698d874cf04a283c75 | % Compute modes using OETR approach
% by Eli Shlizerman, Jun 2016
function experiment = getmodes_winnertakeall_optim(experiment)
% matrix L
experiment.modes = [];
% if it is a mixture, obtain modes
if isfield(experiment,'modesodorsnames')
for modesind = 1:length(experiment.modesodorsnames)
exp... |
github | shlizee/fpnets-classification-master | runClassification.m | .m | fpnets-classification-master/code/runClassification.m | 3,335 | utf_8 | 56508016d83ed60719fc82ecc5356ed0 | % Run classification with different methods and produce comparison
% produces Figure figure 5 B in Blaszka,Sanders,Riffell,Shlizerman, 2016
% by Eli Shlizerman, Jun 2016
function runClassification()
% run classification on dimensions 1 -> 8
indep_odors_names = {'Bea','Bol','Lin','Car','Ner','Far','Myr','Ger'};
figu... |
github | shlizee/fpnets-classification-master | GetExperiment.m | .m | fpnets-classification-master/code/GetExperiment.m | 319 | utf_8 | 173bc5ba78ea52498b0e986ef04ee0fa | % Load particular data set from the list
% by Eli Shlizerman, Jun 2016
function m = GetExperiment(experiments, name)
for i=1:length(experiments),
m = experiments{i};
% If you get an error on this line, the name you are searching for
% is not present in the list.
if strcmp(m.name, name),
break;
end
end |
github | shlizee/fpnets-classification-master | projectOnClassSpace.m | .m | fpnets-classification-master/code/projectOnClassSpace.m | 5,551 | utf_8 | c579cae33c788325bd141e642812f8f7 | % Produce projections onto classification space and
% compare with reference odor
% Input (optional): visulaization bit, method for class space
% construction, basis of classification space radius of hypersphere
% by Eli Shlizerman, Jun 2016
function proj_coeff = projectOnClassSpace(projtype,experiment,avg,varargin)... |
github | shlizee/fpnets-classification-master | produceProjections_Rec.m | .m | fpnets-classification-master/code/produceProjections_Rec.m | 2,715 | utf_8 | 18704ab9ac6b651650ffc0e3cf0f5661 | % Produce projections onto classification space and
% use them for recognition of reference odor (see also produceProjections)
% Input (optional): visulaization bit, method for class space
% construction, basis of classification space radius of hypersphere
% Output: counter of ref projection and test projections
% by ... |
github | shlizee/fpnets-classification-master | processdatacombined.m | .m | fpnets-classification-master/code/processdatacombined.m | 3,314 | utf_8 | bd7e1a3327cd604d212cce7ecdc305bf | % The function receives a struct of an odor and neural spiking times ensambles
% and processes the data
% by Eli Shlizerman, Jun 2016
function experiment=processdatacombined(experiment)
% data includes neurons -- each is a struct
data = load(experiment.datafile);
% prepare neural activity matrices per odor applicat... |
github | shlizee/fpnets-classification-master | getmodes_winnertakeall.m | .m | fpnets-classification-master/code/getmodes_winnertakeall.m | 2,098 | utf_8 | b98ff1c814d84054b06d821ed4a6340d | % Compute modes using ETR approach
% by Eli Shlizerman, Jun 2016
function experiment = getmodes_winnertakeall(experiment)
experiment.modes = [];
% if it is a mixture, obtain modes
if isfield(experiment,'modesodorsnames')
for modesind = 1:length(experiment.modesodorsnames)
experiment1 = experi... |
github | shlizee/fpnets-classification-master | normcolumnMat.m | .m | fpnets-classification-master/code/normcolumnMat.m | 276 | utf_8 | e5ae1c07a7f5ede95c5c62199fa38e8f | % Frobenius matrix norm
% by Eli Shlizerman, Jun 2016
function normA = normcolumnMat(A)
normA = sqrt(sum(A.^2)); % this is a vector
%normA = repmat(normA, [length(A) 1]); % this makes it a matrix
% of the same size as A
|
github | shlizee/fpnets-classification-master | runExperimentByName.m | .m | fpnets-classification-master/code/runExperimentByName.m | 1,946 | utf_8 | b9f6a9d736aa9cb527f21dd044f696b4 | % Per model and odor computes the bais for classification space
% by Eli Shlizerman, Jun 2016
function experiment = runExperimentByName(varargin)
%%%% %%%%
fit=0;
if (~isempty(varargin))
experimentname = varargin{1}; %name of list
end
if length(varargin) >1
indep_odors_names = varargin{2}; ... |
github | shlizee/fpnets-classification-master | produceProjections.m | .m | fpnets-classification-master/code/produceProjections.m | 3,990 | utf_8 | 71725e1c114364f8efe81b0c6659d9aa | % Produce projections onto classification space and
% compare with reference odor
% Input (optional): visulaization bit, method for class space
% construction, basis of classification space radius of hypersphere
% by Eli Shlizerman, Jun 2016
function SRatioList = produceProjections(varargin)
if length(varargin... |
github | shlizee/fpnets-classification-master | getpdfs.m | .m | fpnets-classification-master/code/getpdfs.m | 2,181 | utf_8 | 4f5c61b09edde9e58b523efefea4121f | % The function receives a struct of an odor and neural spiking vectors
% and produces peristinulus time histograms
% by Eli Shlizerman, Jun 2016
function experiment = getpdfs(experiment)
step=experiment.pdfstep;
experiment.pdfs = {};
experiment.FRs = {};
for odorapp = 1:length(experiment.odorvec)
pdf=[];
... |
github | shlizee/fpnets-classification-master | hyperellipseMetirc.m | .m | fpnets-classification-master/code/hyperellipseMetirc.m | 361 | utf_8 | 2c2fc46d41bd240dcdee7dfcc036ee32 | % function that checks whether points are inside hyperellipse (metric s_t)
% Eli Shlizerman June 2016
function s_t = hyperellipseMetirc(proj_coeff,c_coord,r_coord)
c_coordMat = repmat(c_coord, [length(proj_coeff) 1]);
r_coordMat = repmat(r_coord, [length(proj_coeff) 1]);
q_t = sum(((proj_coeff - c_coordMat)./r_coo... |
github | shlizee/fpnets-classification-master | normcolumnVec.m | .m | fpnets-classification-master/code/normcolumnVec.m | 146 | utf_8 | 5e7e7cb2c48a88c0788a841bba33924e | % Frobenius norm per column
% by Eli Shlizerman, Jun 2016
function normA = normcolumnVec(A)
normA = sqrt(sum(A.^2)); % this is a vector
|
github | shlizee/fpnets-classification-master | getmodes_libthree.m | .m | fpnets-classification-master/code/getmodes_libthree.m | 8,950 | utf_8 | c32f052eff2967a42b0224e424228f43 | function experiment = getmodes_libthree(experiment)
experiment.modes = [];
% if it is a mixture, obtain modes
if isfield(experiment,'modesodorsnames')
for modesind = 1:length(experiment.modesodorsnames)
experiment1 = experiment;
experiment1.odor = experiment1.modesodorsnames{m... |
github | shlizee/fpnets-classification-master | runClassification_recognition.m | .m | fpnets-classification-master/code/runClassification_recognition.m | 2,480 | utf_8 | 5d9a69e04ffb88b094128f06a26e8de8 | % Run classification and then recognition of all trials w.r.t an projection (B1 here)
% produces Figure 5 C,D in Blaszka,Sanders,Riffell,Shlizerman, 2016
% by Eli Shlizerman, Jun 2016
function runClassification_recognition()
% run classification on dimensions 1 -> 8
% operate with all independent stimulit space (8 di... |
github | shlizee/fpnets-classification-master | cvxminoptim.m | .m | fpnets-classification-master/code/cvxminoptim.m | 495 | utf_8 | e953bcab5ea66a9ac032dc49a99fe73b | % Use cvx package to solve optimization for OETR
% cvx has to be initialized before running it
% by Eli Shlizerman, Jun 2016
function W = cvxminoptim(O,L,experiment)
% constraint weights not to exceed diagMax (trivial solution)
% the larger diagMax the farther the basis from ETR
diagMax=0.001;
%diagMax=0.1;
cvx_begi... |
github | shlizee/fpnets-classification-master | ExperimentsList.m | .m | fpnets-classification-master/code/ExperimentsList.m | 1,227 | utf_8 | 647de8ec8eaba9ad8e1674c84555fe57 | % List of parameters and data sets
% to be loaded by GetExperiment function.
% by Eli Shlizerman, Jun 2016
function models = ExperimentsList()
models = { ...
struct(...
'name', 'DaturaESOCombMultiDimSpace',...
'totalnumneurons', 106,...
'datafile', '1... |
github | LLNL/refex-rolx-master | NMF_MDL_Quantized.m | .m | refex-rolx-master/NMF_MDL_Quantized.m | 1,772 | utf_8 | 9d87a24a7cdf9168669a8e99159ac378 | %
% Version: 1.0
% Author: Keith Henderson
% Contact: keith@llnl.gov
%
%
% This function tries a number of different model sizes using NMF_LS_new()
% and selects the model that minimizes description length. Quantization is
% performed using Max-Lloyd and values are compressed with Huffman Codes.
%
% Inputs:
% V - (n... |
github | LLNL/refex-rolx-master | NMF_LS_new.m | .m | refex-rolx-master/NMF_LS_new.m | 2,324 | utf_8 | a7b98ac017577bd877bf8f38275ddcc3 | %
% Version: 1.0
% Author: Hanghang Tong
% Contact: keith@llnl.gov
%
function [F,G,c1,loss_all] = NMF_LS_new(V,niter,r,type,F0,G0)
%--------------------------------------------------------------------------
% Using Lee and Seung's algorithm for NMF
%
% Arguments:
% V: nxd data matrix
% type: 0: square ... |
github | LLNL/refex-rolx-master | NMF_LS_FixedF.m | .m | refex-rolx-master/NMF_LS_FixedF.m | 1,926 | utf_8 | 9f3717fcb42d8beef810484a5e702c3d | %
% Version: 1.0
% Author: Keith Henderson
% Contact: keith@llnl.gov
%
function G = NMF_LS_FixedF(V, F, niter, G0)
%--------------------------------------------------------------------------
% Using Lee and Seung's algorithm for NMF
% Arguments:
% V: nxd data matrix
% F: dxr cluster center matrix
% n... |
github | LLNL/refex-rolx-master | HuffmanCost.m | .m | refex-rolx-master/HuffmanCost.m | 1,051 | utf_8 | e87548d9b836db452fe0870bf36794df | %
% Version: 1.0
% Author: Keith Henderson
% Contact: keith@llnl.gov
%
%
% This function computes the cost of storing matrix V using a Huffman Code.
% Inputs:
% V is a matrix whose elements are all values 1-m representing the possible
% symbols.
% symBits is the cost of storing a single symbol (generally ceil(log(... |
github | LLNL/refex-rolx-master | MaxLloyd.m | .m | refex-rolx-master/MaxLloyd.m | 1,495 | utf_8 | da49ef0a6154c854d80370e6032ba1a3 | %
% Version: 1.0
% Author: Keith Henderson
% Contact: keith@llnl.gov
%
%
% This function computes the Max-Lloyd quantization of a matrix.
% Arguments:
% A is the matrix of values to be quantized.
% L is the number of quanta.
% thresh is the threshold for iteration. When the difference in error terms
% between two ste... |
github | Luoyadan/Hashing-Toolbox-master | compactbit.m | .m | Hashing-Toolbox-master/ITQ/eval/compactbit.m | 475 | utf_8 | 4596002d6b4b65d77b0e4f0fd6ba58b8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cb = compactbit(b)
%
% Written by Rob Fergus
% b = bits array
% cb = compacted string of bits (using words of 'word' bits)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[nSamples nbits] = size(b);
nwords ... |
github | Luoyadan/Hashing-Toolbox-master | hammingDist.m | .m | Hashing-Toolbox-master/ITQ/eval/hammingDist.m | 1,683 | utf_8 | b3b0c5d992de3ce868c6d2f9e78424cb | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Dh=hammingDist(B1, B2)
%
% Written by Rob Fergus
% Compute hamming distance between two sets of samples (B1, B2)
%
% Dh=hammingDist(B1, B2);
%
% Input
% B1, B2: compact bit vectors. Each datapoint is one row.
% size(B1) = [nd... |
github | Luoyadan/Hashing-Toolbox-master | gen_marker.m | .m | Hashing-Toolbox-master/utils/gen_marker.m | 694 | utf_8 | 31bf91686817b908bc736fa9f0da232b |
function marker=gen_marker(curve_idx)
markers=[];
% scheme
% scheme
markers{end+1}='o';
markers{end+1}='*';
markers{end+1}='d';
markers{end+1}='p';
markers{end+1}='s';
markers{end+1}='h';
markers{end+1}='o';
markers{end+1}='*';
markers{end+1}='o';
markers{end+1}='o';
markers{end+1}='o';
markers{end+1}='o';
markers{e... |
github | Luoyadan/Hashing-Toolbox-master | compactbit.m | .m | Hashing-Toolbox-master/utils/compactbit.m | 363 | utf_8 | 147581cf2ca242e78ad47e2dff028c4e | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cb = compactbit(b)
%
% b = bits array
% cb = compacted string of bits (using words of 'word' bits)
[nSamples nbits] = size(b);
nwords = ceil(nbits/8);
cb = zeros([nSamples nwords], 'uint8');
for j = 1:nbits
w = ceil(j/8);
cb(:,w) =... |
github | Luoyadan/Hashing-Toolbox-master | EuDist2.m | .m | Hashing-Toolbox-master/utils/EuDist2.m | 1,248 | utf_8 | 8992ee5820611c32f63c31dd9cc3ab8c |
function D = EuDist2(fea_a,fea_b,bSqrt)
%EUDIST2 Efficiently Compute the Euclidean Distance Matrix by Exploring the
%Matlab matrix operations.
%
% D = EuDist(fea_a,fea_b)
% fea_a: nSample_a * nFeature
% fea_b: nSample_b * nFeature
% D: nSample_a * nSample_a
% or nSample_a * nSample_b... |
github | Luoyadan/Hashing-Toolbox-master | evaluate_HammingRanking_category.m | .m | Hashing-Toolbox-master/IMH_release/evaluate_HammingRanking_category.m | 853 | utf_8 | 41589dcbdb6ef7838111fa42ac837da1 | function [pre, rec] = evaluate_HammingRanking_category(trnlabel, tstlabel,rank)
if size(rank,1)~=length(trnlabel)
error('score and label must be equal length\n');
pause;
end
precision = zeros(length(tstlabel), length(trnlabel));
recall = zeros(length(tstlabel), length(trnlabel));
for n = 1:length... |
github | Luoyadan/Hashing-Toolbox-master | litekmeans.m | .m | Hashing-Toolbox-master/IMH_release/litekmeans.m | 16,579 | utf_8 | f9c2cf6f3879519a27fcf0e501c2a476 | function [label, center, bCon, sumD, D] = litekmeans(X, k, varargin)
%LITEKMEANS K-means clustering, accelerated by matlab matrix operations.
%
% label = LITEKMEANS(X, K) partitions the points in the N-by-P data matrix
% X into K clusters. This partition minimizes the sum, over all
% clusters, of the within... |
github | Luoyadan/Hashing-Toolbox-master | compactbit.m | .m | Hashing-Toolbox-master/IMH_release/compactbit.m | 475 | utf_8 | 4596002d6b4b65d77b0e4f0fd6ba58b8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cb = compactbit(b)
%
% Written by Rob Fergus
% b = bits array
% cb = compacted string of bits (using words of 'word' bits)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[nSamples nbits] = size(b);
nwords ... |
github | Luoyadan/Hashing-Toolbox-master | get_Z.m | .m | Hashing-Toolbox-master/IMH_release/get_Z.m | 1,420 | utf_8 | b7db5fda2b250f17247a1a8a1d19db62 | % Got by modifying Wei Liu's codes
function [Z_nmlz, Z, sigma] = get_Z(X, Anchor, s, sigma)
[n,~] = size(X);
m = size(Anchor,1);
%% get Eucilidian distance
if n <= 1e5
Dis = EuDist2(X,Anchor,0);
else
Dis = zeros(n, m);
l = floor(n / 1e5); r = mod(n, 1e5);
for i = 1 : l
Xi = X((i... |
github | Luoyadan/Hashing-Toolbox-master | hammingDist.m | .m | Hashing-Toolbox-master/IMH_release/hammingDist.m | 1,683 | utf_8 | b3b0c5d992de3ce868c6d2f9e78424cb | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Dh=hammingDist(B1, B2)
%
% Written by Rob Fergus
% Compute hamming distance between two sets of samples (B1, B2)
%
% Dh=hammingDist(B1, B2);
%
% Input
% B1, B2: compact bit vectors. Each datapoint is one row.
% size(B1) = [nd... |
github | Luoyadan/Hashing-Toolbox-master | compactbit.m | .m | Hashing-Toolbox-master/IMH_release/eval/compactbit.m | 475 | utf_8 | 4596002d6b4b65d77b0e4f0fd6ba58b8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function cb = compactbit(b)
%
% Written by Rob Fergus
% b = bits array
% cb = compacted string of bits (using words of 'word' bits)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[nSamples nbits] = size(b);
nwords ... |
github | Luoyadan/Hashing-Toolbox-master | hammingDist.m | .m | Hashing-Toolbox-master/IMH_release/eval/hammingDist.m | 1,683 | utf_8 | b3b0c5d992de3ce868c6d2f9e78424cb | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function Dh=hammingDist(B1, B2)
%
% Written by Rob Fergus
% Compute hamming distance between two sets of samples (B1, B2)
%
% Dh=hammingDist(B1, B2);
%
% Input
% B1, B2: compact bit vectors. Each datapoint is one row.
% size(B1) = [nd... |
github | Luoyadan/Hashing-Toolbox-master | d2p.m | .m | Hashing-Toolbox-master/IMH_release/tSNE/d2p.m | 3,249 | utf_8 | 8229c7e5e9673f138c059f5bd0cc99a8 | function [P, beta] = d2p(D, u, tol)
%D2P Identifies appropriate sigma's to get kk NNs up to some tolerance
%
% [P, beta] = d2p(D, kk, tol)
%
% Identifies the required precision (= 1 / variance^2) to obtain a Gaussian
% kernel with a certain uncertainty for every datapoint. The desired
% uncertainty can be sp... |
github | Luoyadan/Hashing-Toolbox-master | x2p.m | .m | Hashing-Toolbox-master/IMH_release/tSNE/x2p.m | 3,397 | utf_8 | 17c7029e27ab3344ad97d2f85727f7ff | function [P, beta] = x2p(X, u, tol)
%X2P Identifies appropriate sigma's to get kk NNs up to some tolerance
%
% [P, beta] = x2p(xx, kk, tol)
%
% Identifies the required precision (= 1 / variance^2) to obtain a Gaussian
% kernel with a certain uncertainty for every datapoint. The desired
% uncertainty can be s... |
github | Luoyadan/Hashing-Toolbox-master | fast_tsne.m | .m | Hashing-Toolbox-master/IMH_release/tSNE/fast_tsne.m | 3,476 | utf_8 | 59c11e11203be1a0f46230922ffe9af3 | function [mappedX, landmarks, costs] = fast_tsne(X, no_dims, initial_dims, landmarks, perplexity)
%FAST_TSNE Runs the fast Intel (IPP) implementation of t-SNE
%
% [mappedX, landmarks, costs] = fast_tsne(X, no_dims, initial_dims, landmarks, perplexity)
%
% Runs the fast implementation Diffusion Stochastic Neighbo... |
github | jorgepsmatos/cft-otb-master | vl_compile.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/vl_compile.m | 5,060 | utf_8 | 978f5189bb9b2a16db3368891f79aaa6 | function vl_compile(compiler)
% VL_COMPILE Compile VLFeat MEX files
% VL_COMPILE() uses MEX() to compile VLFeat MEX files. This command
% works only under Windows and is used to re-build problematic
% binaries. The preferred method of compiling VLFeat on both UNIX
% and Windows is through the provided Makefile... |
github | jorgepsmatos/cft-otb-master | vl_noprefix.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/vl_noprefix.m | 1,875 | utf_8 | 97d8755f0ba139ac1304bc423d3d86d3 | function vl_noprefix
% VL_NOPREFIX Create a prefix-less version of VLFeat commands
% VL_NOPREFIX() creats prefix-less stubs for VLFeat functions
% (e.g. SIFT for VL_SIFT). This function is seldom used as the stubs
% are included in the VLFeat binary distribution anyways. Moreover,
% on UNIX platforms, the stub... |
github | jorgepsmatos/cft-otb-master | vl_pegasos.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/misc/vl_pegasos.m | 2,837 | utf_8 | d5e0915c439ece94eb5597a07090b67d | % VL_PEGASOS [deprecated]
% VL_PEGASOS is deprecated. Please use VL_SVMTRAIN() instead.
function [w b info] = vl_pegasos(X,Y,LAMBDA, varargin)
% Verbose not supported
if (sum(strcmpi('Verbose',varargin)))
varargin(find(strcmpi('Verbose',varargin),1))=[];
fprintf('Option VERBOSE is no longer supported.\n');
en... |
github | jorgepsmatos/cft-otb-master | vl_svmpegasos.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/misc/vl_svmpegasos.m | 1,178 | utf_8 | 009c2a2b87a375d529ed1a4dbe3af59f | % VL_SVMPEGASOS [deprecated]
% VL_SVMPEGASOS is deprecated. Please use VL_SVMTRAIN() instead.
function [w b info] = vl_svmpegasos(DATA,LAMBDA, varargin)
% Verbose not supported
if (sum(strcmpi('Verbose',varargin)))
varargin(find(strcmpi('Verbose',varargin),1))=[];
fprintf('Option VERBOSE is no longer suppor... |
github | jorgepsmatos/cft-otb-master | vl_override.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/misc/vl_override.m | 4,654 | utf_8 | e233d2ecaeb68f56034a976060c594c5 | function config = vl_override(config,update,varargin)
% VL_OVERRIDE Override structure subset
% CONFIG = VL_OVERRIDE(CONFIG, UPDATE) copies recursively the fileds
% of the structure UPDATE to the corresponding fields of the
% struture CONFIG.
%
% Usually CONFIG is interpreted as a list of paramters with their
... |
github | jorgepsmatos/cft-otb-master | vl_quickvis.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/quickshift/vl_quickvis.m | 3,696 | utf_8 | 27f199dad4c5b9c192a5dd3abc59f9da | function [Iedge dists map gaps] = vl_quickvis(I, ratio, kernelsize, maxdist, maxcuts)
% VL_QUICKVIS Create an edge image from a Quickshift segmentation.
% IEDGE = VL_QUICKVIS(I, RATIO, KERNELSIZE, MAXDIST, MAXCUTS) creates an edge
% stability image from a Quickshift segmentation. RATIO controls the tradeoff
% bet... |
github | jorgepsmatos/cft-otb-master | vl_demo_aib.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/demo/vl_demo_aib.m | 2,928 | utf_8 | 590c6db09451ea608d87bfd094662cac | function vl_demo_aib
% VL_DEMO_AIB Test Agglomerative Information Bottleneck (AIB)
D = 4 ;
K = 20 ;
randn('state',0) ;
rand('state',0) ;
X1 = randn(2,300) ; X1(1,:) = X1(1,:) + 2 ;
X2 = randn(2,300) ; X2(1,:) = X2(1,:) - 2 ;
X3 = randn(2,300) ; X3(2,:) = X3(2,:) + 2 ;
figure(1) ; clf ; hold on ;
vl_plotframe(X... |
github | jorgepsmatos/cft-otb-master | vl_demo_alldist.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/demo/vl_demo_alldist.m | 5,460 | utf_8 | 6d008a64d93445b9d7199b55d58db7eb | function vl_demo_alldist
%
numRepetitions = 3 ;
numDimensions = 1000 ;
numSamplesRange = [300] ;
settingsRange = {{'alldist2', 'double', 'l2', }, ...
{'alldist', 'double', 'l2', 'nosimd'}, ...
{'alldist', 'double', 'l2' }, ...
{'alldist2', 's... |
github | jorgepsmatos/cft-otb-master | vl_demo_ikmeans.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/demo/vl_demo_ikmeans.m | 774 | utf_8 | 17ff0bb7259d390fb4f91ea937ba7de0 | function vl_demo_ikmeans()
% VL_DEMO_IKMEANS
numData = 10000 ;
dimension = 2 ;
data = uint8(255*rand(dimension,numData)) ;
numClusters = 3^3 ;
[centers, assignments] = vl_ikmeans(data, numClusters);
figure(1) ; clf ; axis off ;
plotClusters(data, centers, assignments) ;
vl_demo_print('ikmeans_2d',0.6);
[tree, assig... |
github | jorgepsmatos/cft-otb-master | vl_demo_svm.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/demo/vl_demo_svm.m | 1,235 | utf_8 | 7cf6b3504e4fc2cbd10ff3fec6e331a7 | % VL_DEMO_SVM Demo: SVM: 2D linear learning
function vl_demo_svm
y=[];X=[];
% Load training data X and their labels y
load('vl_demo_svm_data.mat')
Xp = X(:,y==1);
Xn = X(:,y==-1);
figure
plot(Xn(1,:),Xn(2,:),'*r')
hold on
plot(Xp(1,:),Xp(2,:),'*b')
axis equal ;
vl_demo_print('svm_training') ;
% Parameters
lambda =... |
github | jorgepsmatos/cft-otb-master | vl_demo_kdtree_sift.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/demo/vl_demo_kdtree_sift.m | 6,832 | utf_8 | e676f80ac330a351f0110533c6ebba89 | function vl_demo_kdtree_sift
% VL_DEMO_KDTREE_SIFT
% Demonstrates the use of a kd-tree forest to match SIFT
% features. If FLANN is present, this function runs a comparison
% against it.
% AUTORIGHS
rand('state',0) ;
randn('state',0);
do_median = 0 ;
do_mean = 1 ;
% try to setup flann
if ~exist('flann_search'... |
github | jorgepsmatos/cft-otb-master | vl_impattern.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/imop/vl_impattern.m | 6,876 | utf_8 | 1716a4d107f0186be3d11c647bc628ce | function im = vl_impattern(varargin)
% VL_IMPATTERN Generate an image from a stock pattern
% IM=VLPATTERN(NAME) returns an instance of the specified
% pattern. These stock patterns are useful for testing algoirthms.
%
% All generated patterns are returned as an image of class
% DOUBLE. Both gray-scale and colou... |
github | jorgepsmatos/cft-otb-master | vl_tpsu.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/imop/vl_tpsu.m | 1,755 | utf_8 | 09f36e1a707c069b375eb2817d0e5f13 | function [U,dU,delta]=vl_tpsu(X,Y)
% VL_TPSU Compute the U matrix of a thin-plate spline transformation
% U=VL_TPSU(X,Y) returns the matrix
%
% [ U(|X(:,1) - Y(:,1)|) ... U(|X(:,1) - Y(:,N)|) ]
% [ ]
% [ U(|X(:,M) - Y(:,1)|) ... U(|X(:,M) - Y(:,N)|) ]
%
% where X... |
github | jorgepsmatos/cft-otb-master | vl_xyz2lab.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/imop/vl_xyz2lab.m | 1,570 | utf_8 | 09f95a6f9ae19c22486ec1157357f0e3 | function J=vl_xyz2lab(I,il)
% VL_XYZ2LAB Convert XYZ color space to LAB
% J = VL_XYZ2LAB(I) converts the image from XYZ format to LAB format.
%
% VL_XYZ2LAB(I,IL) uses one of the illuminants A, B, C, E, D50, D55,
% D65, D75, D93. The default illuminatn is E.
%
% See also: VL_XYZ2LUV(), VL_HELP().
% Copyright ... |
github | jorgepsmatos/cft-otb-master | vl_test_gmm.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_gmm.m | 1,332 | utf_8 | 76782cae6c98781c6c38d4cbf5549d94 | function results = vl_test_gmm(varargin)
% VL_TEST_GMM
% Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
vl_test_init ;
end
function s = setup()
randn('st... |
github | jorgepsmatos/cft-otb-master | vl_test_twister.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_twister.m | 1,251 | utf_8 | 2bfb5a30cbd6df6ac80c66b73f8646da | function results = vl_test_twister(varargin)
% VL_TEST_TWISTER
vl_test_init ;
function test_illegal_args()
vl_assert_exception(@() vl_twister(-1), 'vl:invalidArgument') ;
vl_assert_exception(@() vl_twister(1, -1), 'vl:invalidArgument') ;
vl_assert_exception(@() vl_twister([1, -1]), 'vl:invalidArgument') ;
function te... |
github | jorgepsmatos/cft-otb-master | vl_test_kdtree.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_kdtree.m | 2,449 | utf_8 | 9d7ad2b435a88c22084b38e5eb5f9eb9 | function results = vl_test_kdtree(varargin)
% VL_TEST_KDTREE
vl_test_init ;
function s = setup()
randn('state',0) ;
s.X = single(randn(10, 1000)) ;
s.Q = single(randn(10, 10)) ;
function test_nearest(s)
for tmethod = {'median', 'mean'}
for type = {@single, @double}
conv = type{1} ;
tmethod = char(tmethod) ;... |
github | jorgepsmatos/cft-otb-master | vl_test_imwbackward.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_imwbackward.m | 514 | utf_8 | 33baa0784c8f6f785a2951d7f1b49199 | function results = vl_test_imwbackward(varargin)
% VL_TEST_IMWBACKWARD
vl_test_init ;
function s = setup()
s.I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ;
function test_identity(s)
xr = 1:size(s.I,2) ;
yr = 1:size(s.I,1) ;
[x,y] = meshgrid(xr,yr) ;
vl_assert_almost_equal(s.I, vl_imwbackward(xr,yr,s.I,... |
github | jorgepsmatos/cft-otb-master | vl_test_alphanum.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_alphanum.m | 1,624 | utf_8 | 2da2b768c2d0f86d699b8f31614aa424 | function results = vl_test_alphanum(varargin)
% VL_TEST_ALPHANUM
vl_test_init ;
function s = setup()
s.strings = ...
{'1000X Radonius Maximus','10X Radonius','200X Radonius','20X Radonius','20X Radonius Prime','30X Radonius','40X Radonius','Allegia 50 Clasteron','Allegia 500 Clasteron','Allegia 50B Clasteron','Al... |
github | jorgepsmatos/cft-otb-master | vl_test_printsize.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_printsize.m | 1,447 | utf_8 | 0f0b6437c648b7a2e1310900262bd765 | function results = vl_test_printsize(varargin)
% VL_TEST_PRINTSIZE
vl_test_init ;
function s = setup()
s.fig = figure(1) ;
s.usletter = [8.5, 11] ; % inches
s.a4 = [8.26772, 11.6929] ;
clf(s.fig) ; plot(1:10) ;
function teardown(s)
close(s.fig) ;
function test_basic(s)
for sigma = [1 0.5 0.2]
vl_printsize(s.fig, s... |
github | jorgepsmatos/cft-otb-master | vl_test_cummax.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_cummax.m | 838 | utf_8 | 5e98ee1681d4823f32ecc4feaa218611 | function results = vl_test_cummax(varargin)
% VL_TEST_CUMMAX
vl_test_init ;
function test_basic()
vl_assert_almost_equal(...
vl_cummax(1), 1) ;
vl_assert_almost_equal(...
vl_cummax([1 2 3 4], 2), [1 2 3 4]) ;
function test_multidim()
a = [1 2 3 4 3 2 1] ;
b = [1 2 3 4 4 4 4] ;
for k=1:6
dims = ones(1,6) ;
dim... |
github | jorgepsmatos/cft-otb-master | vl_test_imintegral.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_imintegral.m | 1,429 | utf_8 | 4750f04ab0ac9fc4f55df2c8583e5498 | function results = vl_test_imintegral(varargin)
% VL_TEST_IMINTEGRAL
vl_test_init ;
function state = setup()
state.I = ones(5,6) ;
state.correct = [ 1 2 3 4 5 6 ;
2 4 6 8 10 12 ;
3 6 9 12 15 18 ;
4 8 12 ... |
github | jorgepsmatos/cft-otb-master | vl_test_sift.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_sift.m | 1,318 | utf_8 | 806c61f9db9f2ebb1d649c9bfcf3dc0a | function results = vl_test_sift(varargin)
% VL_TEST_SIFT
vl_test_init ;
function s = setup()
s.I = im2single(imread(fullfile(vl_root,'data','box.pgm'))) ;
[s.ubc.f, s.ubc.d] = ...
vl_ubcread(fullfile(vl_root,'data','box.sift')) ;
function test_ubc_descriptor(s)
err = [] ;
[f, d] = vl_sift(s.I,...
... |
github | jorgepsmatos/cft-otb-master | vl_test_binsum.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_binsum.m | 1,377 | utf_8 | f07f0f29ba6afe0111c967ab0b353a9d | function results = vl_test_binsum(varargin)
% VL_TEST_BINSUM
vl_test_init ;
function test_three_args()
vl_assert_almost_equal(...
vl_binsum([0 0], 1, 2), [0 1]) ;
vl_assert_almost_equal(...
vl_binsum([1 7], -1, 1), [0 7]) ;
vl_assert_almost_equal(...
vl_binsum([1 7], -1, [1 2 2 2 2 2 2 2]), [0 0]) ;
function te... |
github | jorgepsmatos/cft-otb-master | vl_test_lbp.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_lbp.m | 892 | utf_8 | a79c0ce0c85e25c0b1657f3a0b499538 | function results = vl_test_lbp(varargin)
% VL_TEST_TWISTER
vl_test_init ;
function test_unfiorm_lbps(s)
% enumerate the 56 uniform lbps
q = 0 ;
for i=0:7
for j=1:7
I = zeros(3) ;
p = mod(s.pixels - i + 8, 8) + 1 ;
I(p <= j) = 1 ;
f = vl_lbp(single(I), 3) ;
q = q + 1 ;
vl_assert_equal(find(f... |
github | jorgepsmatos/cft-otb-master | vl_test_colsubset.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_colsubset.m | 828 | utf_8 | be0c080007445b36333b863326fb0f15 | function results = vl_test_colsubset(varargin)
% VL_TEST_COLSUBSET
vl_test_init ;
function s = setup()
s.x = [5 2 3 6 4 7 1 9 8 0] ;
function test_beginning(s)
vl_assert_equal(1:5, vl_colsubset(1:10, 5, 'beginning')) ;
vl_assert_equal(1:5, vl_colsubset(1:10, .5, 'beginning')) ;
function test_ending(s)
vl_assert_equa... |
github | jorgepsmatos/cft-otb-master | vl_test_alldist.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_alldist.m | 2,373 | utf_8 | 9ea1a36c97fe715dfa2b8693876808ff | function results = vl_test_alldist(varargin)
% VL_TEST_ALLDIST
vl_test_init ;
function s = setup()
vl_twister('state', 0) ;
s.X = 3.1 * vl_twister(10,10) ;
s.Y = 4.7 * vl_twister(10,7) ;
function test_null_args(s)
vl_assert_equal(...
vl_alldist(zeros(15,12), zeros(15,0), 'kl2'), ...
zeros(12,0)) ;
vl_assert_equa... |
github | jorgepsmatos/cft-otb-master | vl_test_ihashsum.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_ihashsum.m | 581 | utf_8 | edc283062469af62056b0782b171f5fc | function results = vl_test_ihashsum(varargin)
% VL_TEST_IHASHSUM
vl_test_init ;
function s = setup()
rand('state',0) ;
s.data = uint8(round(16*rand(2,100))) ;
sel = find(all(s.data==0)) ;
s.data(1,sel)=1 ;
function test_hash(s)
D = size(s.data,1) ;
K = 5 ;
h = zeros(1,K,'uint32') ;
id = zeros(D,K,'uint8');
next = zer... |
github | jorgepsmatos/cft-otb-master | vl_test_grad.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_grad.m | 434 | utf_8 | 4d03eb33a6a4f68659f868da95930ffb | function results = vl_test_grad(varargin)
% VL_TEST_GRAD
vl_test_init ;
function s = setup()
s.I = rand(150,253) ;
s.I_small = rand(2,2) ;
function test_equiv(s)
vl_assert_equal(gradient(s.I), vl_grad(s.I)) ;
function test_equiv_small(s)
vl_assert_equal(gradient(s.I_small), vl_grad(s.I_small)) ;
function test_equiv... |
github | jorgepsmatos/cft-otb-master | vl_test_whistc.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_whistc.m | 1,384 | utf_8 | 81c446d35c82957659840ab2a579ec2c | function results = vl_test_whistc(varargin)
% VL_TEST_WHISTC
vl_test_init ;
function test_acc()
x = ones(1, 10) ;
e = 1 ;
o = 1:10 ;
vl_assert_equal(vl_whistc(x, o, e), 55) ;
function test_basic()
x = 1:10 ;
e = 1:10 ;
o = ones(1, 10) ;
vl_assert_equal(histc(x, e), vl_whistc(x, o, e)) ;
x = linspace(-1,11,100) ;
o =... |
github | jorgepsmatos/cft-otb-master | vl_test_roc.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_roc.m | 1,019 | utf_8 | 9b2ae71c9dc3eda0fc54c65d55054d0c | function results = vl_test_roc(varargin)
% VL_TEST_ROC
vl_test_init ;
function s = setup()
s.scores0 = [5 4 3 2 1] ;
s.scores1 = [5 3 4 2 1] ;
s.labels = [1 1 -1 -1 -1] ;
function test_perfect_tptn(s)
[tpr,tnr] = vl_roc(s.labels,s.scores0) ;
vl_assert_almost_equal(tpr, [0 1 2 2 2 2] / 2) ;
vl_assert_almost_equal(tnr,... |
github | jorgepsmatos/cft-otb-master | vl_test_dsift.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_dsift.m | 2,048 | utf_8 | fbbfb16d5a21936c1862d9551f657ccc | function results = vl_test_dsift(varargin)
% VL_TEST_DSIFT
vl_test_init ;
function s = setup()
I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ;
s.I = rgb2gray(single(I)) ;
function test_fast_slow(s)
binSize = 4 ; % bin size in pixels
magnif = 3 ; % bin size / keypoint scale
scale = binSize... |
github | jorgepsmatos/cft-otb-master | vl_test_alldist2.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_alldist2.m | 2,284 | utf_8 | 89a787e3d83516653ae8d99c808b9d67 | function results = vl_test_alldist2(varargin)
% VL_TEST_ALLDIST
vl_test_init ;
% TODO: test integer classes
function s = setup()
vl_twister('state', 0) ;
s.X = 3.1 * vl_twister(10,10) ;
s.Y = 4.7 * vl_twister(10,7) ;
function test_null_args(s)
vl_assert_equal(...
vl_alldist2(zeros(15,12), zeros(15,0), 'kl2'), ...
... |
github | jorgepsmatos/cft-otb-master | vl_test_fisher.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_fisher.m | 2,097 | utf_8 | c9afd9ab635bd412cbf8be3c2d235f6b | function results = vl_test_fisher(varargin)
% VL_TEST_FISHER
vl_test_init ;
function s = setup()
randn('state',0) ;
dimension = 5 ;
numData = 21 ;
numComponents = 3 ;
s.x = randn(dimension,numData) ;
s.mu = randn(dimension,numComponents) ;
s.sigma2 = ones(dimension,numComponents) ;
s.prior = ones(1,numComponents) ;
s... |
github | jorgepsmatos/cft-otb-master | vl_test_imsmooth.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_imsmooth.m | 1,837 | utf_8 | 718235242cad61c9804ba5e881c22f59 | function results = vl_test_imsmooth(varargin)
% VL_TEST_IMSMOOTH
vl_test_init ;
function s = setup()
I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ;
I = max(min(vl_imdown(I),1),0) ;
s.I = single(I) ;
function test_pad_by_continuity(s)
% Convolving a constant signal padded with continuity does not change... |
github | jorgepsmatos/cft-otb-master | vl_test_svmtrain.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_svmtrain.m | 4,277 | utf_8 | 071b7c66191a22e8236fda16752b27aa | function results = vl_test_svmtrain(varargin)
% VL_TEST_SVMTRAIN
vl_test_init ;
end
function s = setup()
randn('state',0) ;
Np = 10 ;
Nn = 10 ;
xp = diag([1 3])*randn(2, Np) ;
xn = diag([1 3])*randn(2, Nn) ;
xp(1,:) = xp(1,:) + 2 + 1 ;
xn(1,:) = xn(1,:) - 2 + 1 ;
s.x = [xp xn] ;
s.y = [ones(1,Np) ... |
github | jorgepsmatos/cft-otb-master | vl_test_phow.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_phow.m | 549 | utf_8 | f761a3bb218af855986263c67b2da411 | function results = vl_test_phow(varargin)
% VL_TEST_PHOPW
vl_test_init ;
function s = setup()
s.I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ;
s.I = single(s.I) ;
function test_gray(s)
[f,d] = vl_phow(s.I, 'color', 'gray') ;
assert(size(d,1) == 128) ;
function test_rgb(s)
[f,d] = vl_phow(s.I, 'color',... |
github | jorgepsmatos/cft-otb-master | vl_test_kmeans.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_kmeans.m | 3,632 | utf_8 | 0e1d6f4f8101c8982a0e743e0980c65a | function results = vl_test_kmeans(varargin)
% VL_TEST_KMEANS
% Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
vl_test_init ;
function s = setup()
randn('sta... |
github | jorgepsmatos/cft-otb-master | vl_test_hikmeans.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_hikmeans.m | 463 | utf_8 | dc3b493646e66316184e86ff4e6138ab | function results = vl_test_hikmeans(varargin)
% VL_TEST_IKMEANS
vl_test_init ;
function s = setup()
rand('state',0) ;
s.data = uint8(rand(2,1000) * 255) ;
function test_basic(s)
[tree, assign] = vl_hikmeans(s.data,3,100) ;
assign_ = vl_hikmeanspush(tree, s.data) ;
vl_assert_equal(assign,assign_) ;
function test_elka... |
github | jorgepsmatos/cft-otb-master | vl_test_aib.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_aib.m | 1,277 | utf_8 | 78978ae54e7ebe991d136336ba4bf9c6 | function results = vl_test_aib(varargin)
% VL_TEST_AIB
vl_test_init ;
function s = setup()
s = [] ;
function test_basic(s)
Pcx = [.3 .3 0 0
0 0 .2 .2] ;
% This results in the AIB tree
%
% 1 - \
% 5 - \
% 2 - / \
% - 7
% 3 - \ /
% 6 - /
% 4 - /
%
% coded by the map [5 ... |
github | jorgepsmatos/cft-otb-master | vl_test_plotbox.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_plotbox.m | 414 | utf_8 | aa06ce4932a213fb933bbede6072b029 | function results = vl_test_plotbox(varargin)
% VL_TEST_PLOTBOX
vl_test_init ;
function test_basic(s)
figure(1) ; clf ;
vl_plotbox([-1 -1 1 1]') ;
xlim([-2 2]) ;
ylim([-2 2]) ;
close(1) ;
function test_multiple(s)
figure(1) ; clf ;
randn('state', 0) ;
vl_plotbox(randn(4,10)) ;
close(1) ;
function test_style(s)
figure... |
github | jorgepsmatos/cft-otb-master | vl_test_imarray.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_imarray.m | 795 | utf_8 | c5e6a5aa8c2e63e248814f5bd89832a8 | function results = vl_test_imarray(varargin)
% VL_TEST_IMARRAY
vl_test_init ;
function test_movie_rgb(s)
A = rand(23,15,3,4) ;
B = vl_imarray(A,'movie',true) ;
function test_movie_indexed(s)
cmap = get(0,'DefaultFigureColormap') ;
A = uint8(size(cmap,1)*rand(23,15,4)) ;
A = min(A,size(cmap,1)-1) ;
B = vl_imarray(A,'m... |
github | jorgepsmatos/cft-otb-master | vl_test_homkermap.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_homkermap.m | 1,903 | utf_8 | c157052bf4213793a961bde1f73fb307 | function results = vl_test_homkermap(varargin)
% VL_TEST_HOMKERMAP
vl_test_init ;
function check_ker(ker, n, window, period)
args = {n, ker, 'window', window} ;
if nargin > 3
args = {args{:}, 'period', period} ;
end
x = [-1 -.5 0 .5 1] ;
y = linspace(0,2,100) ;
for conv = {@single, @double}
x = feval(conv{1}, x) ;... |
github | jorgepsmatos/cft-otb-master | vl_test_slic.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_slic.m | 200 | utf_8 | 12a6465e3ef5b4bcfd7303cd8a9229d4 | function results = vl_test_slic(varargin)
% VL_TEST_SLIC
vl_test_init ;
function s = setup()
s.im = im2single(vl_impattern('roofs1')) ;
function test_slic(s)
segmentation = vl_slic(s.im, 10, 0.1) ;
|
github | jorgepsmatos/cft-otb-master | vl_test_ikmeans.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_ikmeans.m | 466 | utf_8 | 1ee2f647ac0035ed0d704a0cd615b040 | function results = vl_test_ikmeans(varargin)
% VL_TEST_IKMEANS
vl_test_init ;
function s = setup()
rand('state',0) ;
s.data = uint8(rand(2,1000) * 255) ;
function test_basic(s)
[centers, assign] = vl_ikmeans(s.data,100) ;
assign_ = vl_ikmeanspush(s.data, centers) ;
vl_assert_equal(assign,assign_) ;
function test_elk... |
github | jorgepsmatos/cft-otb-master | vl_test_mser.m | .m | cft-otb-master/vlfeat-0.9.20/toolbox/xtest/vl_test_mser.m | 242 | utf_8 | 1ad33563b0c86542a2978ee94e0f4a39 | function results = vl_test_mser(varargin)
% VL_TEST_MSER
vl_test_init ;
function s = setup()
s.im = im2uint8(rgb2gray(vl_impattern('roofs1'))) ;
function test_mser(s)
[regions,frames] = vl_mser(s.im) ;
mask = vl_erfill(s.im, regions(1)) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.