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 | yjq8812/efficientSegmentation-master | sfo_polyhedrongreedy.m | .m | efficientSegmentation-master/sfo/sfo_polyhedrongreedy.m | 527 | utf_8 | 10df4bb2bf0e52ead702d7165b6adec5 | % The polyhedron greedy algorithm [Edmonds '71]
% Implementation by Andreas Krause
%
% function x = sfo_polyhedrongreedy(F,V,w)
% F: Submodular function
% V: index set
% w: weight vector, w(i) is weight of V(i)
%
% Example:
% x = sfo_polyhedrongreedy(@sfo_fn_example,1:2,sfo_charvector(1:2,1))
function x = sfo_polyhe... |
github | yjq8812/efficientSegmentation-master | sfo_cover.m | .m | efficientSegmentation-master/sfo/sfo_cover.m | 1,149 | utf_8 | 8e57519c8f3f94a7b6219c823b9688ca | % Andreas Krause (krausea@gmail.com)
% solve the submodular coverage problem using greedy algorithm,
% i.e., for additive cost function, finds (approximately) cheapest set that
% achieves F(A)>=Q for some quota Q.
%
% function [A, stat] = sfo_cover(F,V,Q,opt)
% F: submodular function
% V: index set
% Q: quota minimum ... |
github | yjq8812/efficientSegmentation-master | sfo_lovaszext.m | .m | efficientSegmentation-master/sfo/sfo_lovaszext.m | 349 | utf_8 | 186418033ee97724fcc91a2a45917936 | % The Lovasz extension [Lovasz '83]
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function x = sfo_lovaszext(F,V,w)
% F: Submodular function
% V: index set
% w: weight vector to evaluate Lovasz extension at
%
% Example: x = sfo_lovaszext(@sfo_fn_example,1:2,[0,1])
function x = sfo_lovaszext(F,V,w)
x = w*s... |
github | yjq8812/efficientSegmentation-master | sfo_chol_downdate.m | .m | efficientSegmentation-master/sfo/sfo_chol_downdate.m | 704 | utf_8 | 79c62158087658f4887b90b69a266654 | % Andreas Krause (krausea@gmail.com)
% Deletes a variable from the X'X matrix in a Cholesky factorisation R'R =
% X'X. Returns the downdated R. This function is just a stripped version of
% Matlab's qrdelete.
% Based on implementation by Ram Rajagopal, originally from Kevin Murphy
%
% function R = sfo_chol_downdate(R,... |
github | yjq8812/efficientSegmentation-master | sfo_min_norm_point.m | .m | efficientSegmentation-master/sfo/sfo_min_norm_point.m | 3,744 | utf_8 | 6cf6f7f1f9647076a5418542de7ef320 | % Finding the minimum of a submodular function using Wolfe's min norm point
% algorithm [Fujishige '91]
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function A = sfo_min_norm_point(F,V, opt)
% F: Submodular function
% V: index set
% opt (optional): option struct of parameters, referencing:
%
% minnorm_ini... |
github | yjq8812/efficientSegmentation-master | sfo_ssp.m | .m | efficientSegmentation-master/sfo/sfo_ssp.m | 1,187 | utf_8 | e10de98babfbbe2fd7ae6685b38096e5 | % The submodular-supermodular procedure of Narasimhan & Bilmes
% Implemented by Andreas Krause (krausea@gmail.com)
% This algorithm is guaranteed to converge to a local optimum
%
% function A = sfo_sssp(F,G,V,opt)
% F: submodular function
% G: submodular function
% V: index set
% Returns a locally optimal solution to ... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_get_cost.m | .m | efficientSegmentation-master/sfo/sfo_pspiel_get_cost.m | 1,675 | utf_8 | fdbcaef7482c87802f23e00301c8419e | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Compute cost and edges of a placement by (approximately)
% solving steiner tree problem using the MST heuristic
%
% function [cost,edges,steinernodes] = sfo_pspiel_get_cost(A,D,dists)
% A: set of nodes (indices in D)
% D: adjacency matrix
% dists: all pai... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_wrapper/init.m | 285 | utf_8 | 05962ea68b701d7c92cf7dced6fe535e | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,A)
A = sfo_unique_fast(A);
%if ~isequal(A,get(F,'current_set'))
v = F.fn(A);
F = set(F,'current_val',v,'current_set',A);
%end
|
github | yjq8812/efficientSegmentation-master | sfo_fn_wrapper.m | .m | efficientSegmentation-master/sfo/@sfo_fn_wrapper/sfo_fn_wrapper.m | 340 | utf_8 | e999ae8d3dfd0383ab213ea1670b5bb0 | % Implementation by Andreas Krause (krausea@gmail.com)
% Takes a function handle fn (a set function, mapping an array to a real
% number), and wraps it as a sfo_fn object
% Example: fn = @(A) length(sfo_unique_fast(A)); F = sfo_fn_wrapper(fn); F([1 2 2 4 3])
function F = sfo_fn_wrapper(fn)
F.fn = fn;
F = class(F,'sfo_f... |
github | yjq8812/efficientSegmentation-master | sfo_fn_iwata.m | .m | efficientSegmentation-master/sfo/@sfo_fn_iwata/sfo_fn_iwata.m | 347 | utf_8 | 95ca626077322f186f3dd68178b21741 | % Evaluate Iwata's test function (taken from Fujishige et al '06)
% Author: Andreas Krause (krausea@gmail.com)
%
% function F = sfo_fn_iwata(n,A)
% sigma: Covariance matrix
% set: subset of variables
%
% Example: F = sfo_fn_iwata(5); F([1,2,5])
function F = sfo_fn_iwata(n)
fn = @(A) length(A)*(n-length(A))-sum(5*A-2*n... |
github | yjq8812/efficientSegmentation-master | sfo_fn.m | .m | efficientSegmentation-master/sfo/@sfo_fn/sfo_fn.m | 1,607 | utf_8 | 1aa4069a98b17165be053000e01912bc | % Base class for set function objects
% Implementation by Andreas Krause (krausea@gmail.com)
%
% Functions are defined as objects representing set functions.
% For example, F = sfo_fn_entropy(sigma,1:size(sigma,1))
% will create a subclass of sfo_fn, such that F([1 4 6])
% will evaluate to the entropy of the Gaussian ... |
github | yjq8812/efficientSegmentation-master | get.m | .m | efficientSegmentation-master/sfo/@sfo_fn/get.m | 330 | utf_8 | 2d396451f93097b8cb38f4ac2d656da7 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function val = get(F, propName)
switch propName
case 'current_set'
val = F.current_set;
case 'current_val'
val = F.current_val;
otherwise
error([propName,' Is not a valid asset proper... |
github | yjq8812/efficientSegmentation-master | dec.m | .m | efficientSegmentation-master/sfo/@sfo_fn/dec.m | 228 | utf_8 | 2d19e5b2d0ef444a7febc77e268e2512 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = dec(F,A,el)
F = init(F,sfo_setdiff_fast(A, el));
new_val = get(F,'current_val');
|
github | yjq8812/efficientSegmentation-master | subsref.m | .m | efficientSegmentation-master/sfo/@sfo_fn/subsref.m | 335 | utf_8 | 9fe5e18d67413611820d35f57b9b6596 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function val = subsref(F,s)
% Implement a special subscripted assignment
switch s.type
case '()'
A = s.subs{:};
[tmp,val] = init(F,A);
otherwise
error('Invalid acces... |
github | yjq8812/efficientSegmentation-master | trunc.m | .m | efficientSegmentation-master/sfo/@sfo_fn/trunc.m | 175 | utf_8 | f3fa90553af7ed65459884cc77f51551 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function F = trunc(F,c)
F = sfo_fn_trunc(F,c);
|
github | yjq8812/efficientSegmentation-master | set.m | .m | efficientSegmentation-master/sfo/@sfo_fn/set.m | 508 | utf_8 | d29591dcd9981451637f53467a817940 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function a = set(a,varargin)
propertyArgIn = varargin;
while length(propertyArgIn) >= 2,
prop = propertyArgIn{1};
val = propertyArgIn{2};
propertyArgIn = propertyArgIn(3:end);
swit... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn/inc.m | 212 | utf_8 | 3e9b1d333a349f1f4351f01bb61a3872 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = inc(F,A,el)
F = init(F,[A, el]);
new_val = get(F,'current_val');
|
github | yjq8812/efficientSegmentation-master | dec.m | .m | efficientSegmentation-master/sfo/@sfo_fn_invert/dec.m | 319 | utf_8 | 5b391880a92dcc5f38ca3d7bf34161fa | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [new_val,F] = dec(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)==0
new_val = get(F,'current_val');
return
end
new_val = inc(F.F, sfo_setdiff_fast(F.V, A), el);
|
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_invert/init.m | 297 | utf_8 | ac4e1018aeea583d567130156dbf4f0f | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,A)
A = sfo_unique_fast(A);
F.F = init(F.F,sfo_setdiff_fast(F.V,A));
v = get(F.F,'current_val')-F.FV;
F = set(F,'current_set',A,'current_val',v);
|
github | yjq8812/efficientSegmentation-master | sfo_fn_invert.m | .m | efficientSegmentation-master/sfo/@sfo_fn_invert/sfo_fn_invert.m | 347 | utf_8 | 4dcdfb1972f80a97634ba9db719aeabb | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Given a submodular function G, this function represents the "inverse"
% F(A) = G(V\A)
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_invert(oldF,V)
F.F = init(oldF,V);
F.V = V;
F.FV = get(F.F,'current_val');
F = class(... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_invert/inc.m | 338 | utf_8 | bbacb53e36b862eadf9083030a3d0c6a | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)>0
new_val = get(F,'current_val');
return
end
new_val = dec(F.F, sfo_setdiff_fast(F.V, A), el);
new_va... |
github | yjq8812/efficientSegmentation-master | sfo_fn_cutfun.m | .m | efficientSegmentation-master/sfo/@sfo_fn_cutfun/sfo_fn_cutfun.m | 477 | utf_8 | 148ab700b00cf3157d9a73e2abf26f9b | % Implementation of a (directed) cut function
% Author: Andreas Krause (krausea@gmail.com)
%
% function C = sfo_fn_cutfun(G,A)
% G: Adjacency matrix of the graph
% A: subset of vertices to measure cut *from*
%
% Example: G = [1 1 0; 1 0 1; 0 1 1]; F = sfo_fn_cutfun(G); F([1 3])
function F = sfo_fn_cutfun(G)
fn = @(A) ... |
github | yjq8812/efficientSegmentation-master | sfo_fn_ising.m | .m | efficientSegmentation-master/sfo/@sfo_fn_ising/sfo_fn_ising.m | 1,285 | utf_8 | 5c407527d3ca91282d58052f0dc3d3bc | % Energy function for ising model for image denoising
% Implementation by Andreas Krause (krausea@gmail.com)
%
% function F = sfo_fn_ising(img,coeffPix,coeffH,coeffV,coeffD)
% img: n x m binary array (image)
% A: subset of the pixels set to 1 (ranging in 1: (n*m))
% coeffPix/H/V/Diag: negative log potentials for differ... |
github | yjq8812/efficientSegmentation-master | dec.m | .m | efficientSegmentation-master/sfo/@sfo_fn_lincomb/dec.m | 356 | utf_8 | b7f4bbb7a9559b35fd7d72d0732bd7b8 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = dec(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)==0
new_val = get(F,'current_val');
return
end
new_val = 0;
for i = 1:length(F.Fs)
v = dec(F.Fs{i},A ,el);
ne... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_lincomb/init.m | 339 | utf_8 | 3533882ba4aac13540027bae23bfe259 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,A)
A = sfo_unique_fast(A);
v = 0;
for i = 1:length(F.Fs)
F.Fs{i} = init(F.Fs{i},A);
v = v+F.weights(i)*get(F.Fs{i},'current_val');
end
F = set(F,'current_set',A... |
github | yjq8812/efficientSegmentation-master | trunc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_lincomb/trunc.m | 177 | utf_8 | d4667f2815373bed725c55f5cb4de25b | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Truncates each member functions
function F = trunc(F,c)
for i = 1:length(F.Fs)
F.Fs{i}=sfo_fn_trunc(F.Fs{i},c);
end
|
github | yjq8812/efficientSegmentation-master | sfo_fn_lincomb.m | .m | efficientSegmentation-master/sfo/@sfo_fn_lincomb/sfo_fn_lincomb.m | 304 | utf_8 | 3147895ce5e84f1135fcc521f37fc4b3 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Creates a (positive) linear combination of submodular functions
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_lincomb(Fs,weights)
F.Fs = Fs;
F.weights = weights;
F = class(F,'sfo_fn_lincomb',sfo_fn);
|
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_lincomb/inc.m | 357 | utf_8 | 6ad5e84afa877218d2d68e3c1b567b54 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = inc(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)>0
new_val = get(F,'current_val');
return
end
new_val = 0;
for i = 1:length(F.Fs)
v = inc(F.Fs{i},A ,el);
n... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_dijkstra.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_dijkstra.m | 1,971 | utf_8 | 876c47b56c6b0653abee8accdf3352ed | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Compute shortest paths using dijkstra
% based on implementation by Xiaodong Wang
%
% function [distance, path, totalCost] = sfo_pspiel_dijkstra(adj, s, d)
% path: the list of nodes in the path from source to destination
% distances: all distances
% totalCos... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_sp.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_sp.m | 456 | utf_8 | 55aeb4cbd6155851bd1f1af3f29b89ee | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Computes the all-pairs shortest path solution
% from distance matrix D, by repeatedly calling Dijkstra's algorithm n times
%
% function result = sfo_pspiel_sp(D)
% D: adjacency matrix
% result: shortest path closure matrix
%
% Example: See tutorial script.... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_fixed_r.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_fixed_r.m | 8,142 | utf_8 | 9dbb07da18678aa5751b0513fd229280 | % Helper function for sfo_pspiel, by Andreas Krause (krausea@gmail.com)
% Example: See sfo_tutorial.m
% solve pSPIEL for fixed value of R
% last parameter pdallok controls whether it's ok to use the trivial PD or not
function [A, E, result] = sfo_pspiel_fixed_r(F,V,Q,D,R,dists,pdallok,Vroot)
result.failed = 0;
% sele... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_kmst.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_kmst.m | 7,601 | utf_8 | 7cd71647e5260d377d846c7bca0b9319 | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Approximately solve Quota-MST problem on MAG
% This algorithm computes a log^3 n approximation to the quota-MST for a
% graph defined by the adjacency matrix adj, and the rewards per node
% defined by reward
% This is the Multiple-Kruskal like algorithm fro... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_pd.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_pd.m | 3,126 | utf_8 | 4ad439e78fd2fcbb38011da3b2252e64 | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Compute a padded decomposition.
% This implementation of an algorithm by A. Gupta et al. (STOC '03) will return a
% padded decomposition such that all clusters C in cl guarantee:
% 1) diam(cl)<a*R
% 2) every node in C is R padded with prob. at least succe... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_get_r_range.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_get_r_range.m | 454 | utf_8 | 18a1dd612558ccd9db4403247f41eba3 | % Helper function for sfo_pspiel, by Andreas Krause (krausea@gmail.com)
% Example: See sfo_tutorial.m
%% get a reasonable range of Rs from shortest path matrix
function Rs = sfo_pspiel_get_r_range(spdist,k)
k = k-1;
rng = sort(spdist(:));
N = length(rng);
Rs = zeros(1,k);
for i=1:k
ind = floor((N-floor(sqrt((k-i)/k... |
github | yjq8812/efficientSegmentation-master | sfo_pspiel_mst.m | .m | efficientSegmentation-master/sfo/private/sfo_pspiel_mst.m | 910 | utf_8 | ca555cf6f9c61855dc58b7e2eb35bcc7 | % Andreas Krause (krausea@gmail.com)
% pSPIEL helper function: Compute a minimum spanning tree (MST)
% based on the implementation of F. van den Berg
%
% function [weight,Xmst] = sfo_pspiel_mst(D)
% D: adjacency matrix
% weight: cost of MST connecting all nodes in D
% Xmst: edges of the MST
%
% Example: See tutorial sc... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_entropy/init.m | 541 | utf_8 | 6d5260ea19d6309ba1426e6075002dd8 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,H] = init(F,sset)
sset = sfo_unique_fast(sset);
if ~isequal(sset,get(F,'current_set'))
F.cholA = chol(F.sigma(sset,sset)+(1e-10)*eye(length(sset)));
F.indsA = sset;
... |
github | yjq8812/efficientSegmentation-master | sfo_fn_entropy.m | .m | efficientSegmentation-master/sfo/@sfo_fn_entropy/sfo_fn_entropy.m | 396 | utf_8 | 39eb712ed29cb70a268e28363c410cbe | % Computes the Gaussian entropy
% Author: Andreas Krause (krausea@gmail.com)
%
% function H = sfo_fn_entropy(sigma,set)
% sigma: Covariance Matrix
% set: the subset of rows
%
% Example: F = sfo_fn_entropy(0.5*eye(3)+0.5*ones(3),1:3);
function F = sfo_fn_entropy(sigma,V)
F.sigma = sigma;
F.V = V;
F.indsA = [];
F.chol... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_entropy/inc.m | 504 | utf_8 | ac3908767ae655e31563e157268dd3a7 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function newScore = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)>0
newScore = get(F,'current_val');
return;
end
if (isempty(A))
sigmaXgA = F.sigma(el,... |
github | yjq8812/efficientSegmentation-master | sfo_fn_example.m | .m | efficientSegmentation-master/sfo/@sfo_fn_example/sfo_fn_example.m | 501 | utf_8 | 91e97dd2856f5fdd56a4dc52a6e3fad7 | % The example from the tutorial slides at www.submodularity.org
% Implemented by Andreas Krause (krausea@gmail.com)
% F([]) = 0, F([1])= -1, F([2]) = 2, F([1,2]) = 0
%
% function R = sfo_fn_example(A)
% A: Input set to evaluate, [],[1],[2],[1,2]
% Example: F = sfo_fn_example; F([1,2])
function F = sfo_fn_example
F = s... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_infogain/init.m | 601 | utf_8 | 439879c9c61d82dbe6ef5260b5bc0fea | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,H] = init(F,sset)
sset = sfo_unique_fast(sset);
if ~isequal(sset,get(F,'current_set'))
F.cholA = chol(F.sigma(sset,sset)+(1e-10)*eye(length(sset)));
F.indsA = sset;
... |
github | yjq8812/efficientSegmentation-master | sfo_fn_infogain.m | .m | efficientSegmentation-master/sfo/@sfo_fn_infogain/sfo_fn_infogain.m | 433 | utf_8 | 3da8390b03ef1423c20724b46906da50 | % Computes the Gaussian entropy
% Author: Andreas Krause (krausea@gmail.com)
%
% function H = sfo_fn_entropy(sigma,set)
% sigma: Covariance Matrix
% set: the subset of rows
%
% Example: F = sfo_fn_mi(0.5*eye(3)+0.5*ones(3));
function F = sfo_fn_infogain(sigma,V,noise)
F.sigma = sigma+eye(length(V))*noise;
F.V = V;
F.... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_infogain/inc.m | 559 | utf_8 | 73573914d06fc34cd5c35a29333844b8 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function newScore = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)>0
newScore = get(F,'current_val');
return;
end
if (isempty(A))
sigmaXgA = F.sigma(el,... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_welfare/init.m | 533 | utf_8 | 61fdda5876a964bcb1c4829c432d8274 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
%% sums utility functions across buckets
function [F,val] = init(F,As)
As = sfo_unique_fast(As);
if ~isequal(As,get(F,'current_set'))
m = length(F.Fs);
val = 0;
A_part = partition(F... |
github | yjq8812/efficientSegmentation-master | partition.m | .m | efficientSegmentation-master/sfo/@sfo_fn_welfare/partition.m | 329 | utf_8 | b5ceb3aca00d1bee4325871c06840481 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
% groups elements of the same color in a bucket
function A_part = partition(F,As)
m = length(F.Fs);
groups = mod(As,m)+1;
els = floor(As/m);
A_part = {};
for i = 1:m
A_part{i} = els(groups=... |
github | yjq8812/efficientSegmentation-master | sfo_fn_welfare.m | .m | efficientSegmentation-master/sfo/@sfo_fn_welfare/sfo_fn_welfare.m | 241 | utf_8 | e881deabc1682f069d53241620aad0ba | % Implementation by Andreas Krause (krausea@gmail.com)
% To be used by sfo_greedy_welfare
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_welfare(Fs)
F.Fs = Fs;
F = class(F,'sfo_fn_welfare',sfo_fn);
|
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_welfare/inc.m | 716 | utf_8 | ca85b88ae4f69815140f6cd843c1df5c | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
%% sums utility functions across buckets
function val = inc(F,As,el)
As = sfo_unique_fast(As);
F = init(F,As);
m = length(F.Fs);
val = 0;
oldScore = get(F,'current_val');
if sum(As == el)>0
... |
github | yjq8812/efficientSegmentation-master | sfo_fn_varred_trunc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred_trunc/sfo_fn_varred_trunc.m | 497 | utf_8 | 9b0494a63c780106434c10e9a64624b8 | % Implementation by Andreas Krause (krausea@gmail.com)
% Computes the average truncated variance reduction. To be used with
% sfo_saturate.m
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_varred_trunc(sigma,V,threshold)
F.sigma = sigma;
F.trunc_thresh = threshold;
F.varPrior = ... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred_trunc/init.m | 740 | utf_8 | a58f02f5a13229ec955c60b5c107e180 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,val] = init(F,sset)
sset = sfo_unique_fast(sset);
if ~isequal(sset,get(F,'current_set'))
if (isempty(sset))
val = 0;
else
comp = sfo_setdiff_fast(F.V,sset)... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred_trunc/inc.m | 625 | utf_8 | 440075ca578805592ff33876bc24ca55 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function scoreNew = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
oldScore = get(F,'current_val');
if sum(A == el)>0
scoreNew = oldScore;
return
end
comp = sfo_setdiff_fast(F.V,[... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred/init.m | 567 | utf_8 | b53a06bb2c89c23136b297223f8aae7a | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,val] = init(F,sset)
sset = sfo_unique_fast(sset);
if ~isequal(sset,get(F,'current_set'))
Ac = sfo_setdiff_fast(F.V,sset);
F.Ainv = inv(F.sigma(sset,sset));
F.AAc = F.sig... |
github | yjq8812/efficientSegmentation-master | trunc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred/trunc.m | 253 | utf_8 | 21fabda9f7fa9961ce6fed83d012ee90 | % Implementation by Andreas Krause (krausea@gmail.com)
% Truncates the marginal variance reduction at variance level c
% Example: See sfo_fn.m and the tutorial script for more information
function F = trunc(F,c)
F = sfo_fn_varred_trunc(F.sigma,F.V,c);
|
github | yjq8812/efficientSegmentation-master | sfo_fn_varred.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred/sfo_fn_varred.m | 675 | utf_8 | 7915c250cacad7331838400fad677dcb | % Implementation by Andreas Krause (krausea@gmail.com)
% Variance reduction in Gaussian linear models
% sigma is the covariance matrix
% V is the ground set
% computes the expected mean squared prediction error (trace of posterior
% covariance)
% Supports the method trunc to be used in conjunction with sfo_saturate
% E... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_varred/inc.m | 743 | utf_8 | e1772efcb557282481a13a60bd38f3f3 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function scoreNew = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
n=length(F.V);
oldScore = get(F,'current_val');
if sum(A == el)>0
scoreNew = oldScore;
return
end
Ac = sfo_setd... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_detect/init.m | 577 | utf_8 | 6633f318282e3af33eb64a4d25a374f8 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,sset)
sset = sfo_unique_fast(sset);
if length(sset)==1
F = set(F,'current_val',F.marginals(sset));
F.curmax = F.detmat(:,sset);
elseif ~isequal(sset,get... |
github | yjq8812/efficientSegmentation-master | sfo_fn_detect.m | .m | efficientSegmentation-master/sfo/@sfo_fn_detect/sfo_fn_detect.m | 607 | utf_8 | 947fef7a4ad3334402e822bf5c78a1ea | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
%
% function F = sfo_fn_detect(detmat,V)
%
% detmat is a N x D (sparse) matrix where N is #sensors, D is #scenarios;
% detmat(i,j) is benefit if sensor i detects scenario j
function F = sfo_fn_... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_detect/inc.m | 403 | utf_8 | 93a4e5960f9f537ac4f804cee5edd6be | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function newScore = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)>0
newScore = get(F,'current_val');
return;
end
if isempty(A)
newScore = F.marginals(el);
else... |
github | yjq8812/efficientSegmentation-master | dec.m | .m | efficientSegmentation-master/sfo/@sfo_fn_trunc/dec.m | 336 | utf_8 | 7961273bd967943d99d1067aaeb91fff | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = dec(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)==0
new_val = get(F,'current_val');
return
end
new_val = dec(F.oldF,A,el);
if F.thresh>=0
new_val = min(F.thres... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_trunc/init.m | 322 | utf_8 | 454ffe4f9349f6a2be41fb7ee048ab8b | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,A)
A = sfo_unique_fast(A);
F.oldF = init(F.oldF,A);
v = get(F.oldF,'current_val');
if F.thresh>=0
v = min(F.thresh,v);
end
F = set(F,'current_set',A,'current_val',v)... |
github | yjq8812/efficientSegmentation-master | sfo_fn_trunc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_trunc/sfo_fn_trunc.m | 378 | utf_8 | 9aca375cf1f676f4e61b2d44ffcf4f7c | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Generates a trunctated version of a monotonic submodular function
% If Ftrunc = sfo_fn_trunc(F,thresh), then
% Ftrunc(A) = min(F(A),thresh)
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_trunc(oldF,thresh)
F.oldF = old... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_trunc/inc.m | 335 | utf_8 | 4f3de838f7cbb95728716c8bf57ba9ae | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = inc(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)>0
new_val = get(F,'current_val');
return
end
new_val = inc(F.oldF,A,el);
if F.thresh>=0
new_val = min(F.thresh... |
github | yjq8812/efficientSegmentation-master | sfo_fn_residual.m | .m | efficientSegmentation-master/sfo/@sfo_fn_residual/sfo_fn_residual.m | 423 | utf_8 | 3b2393d0249b8e0c460779d8ef3d6e56 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Creates a residual submodular function, with the property that if
% Fresid = sfo_fn_residual(F,A), then Fresid(B) = F([A B])-F(A)
% Example: See sfo_fn.m and the tutorial script for more information
function F = sfo_fn_residual(oldF,sset)
sset = sfo_unique_fas... |
github | yjq8812/efficientSegmentation-master | dec.m | .m | efficientSegmentation-master/sfo/@sfo_fn_residual/dec.m | 331 | utf_8 | bf1382519282f9056259cf79e5d2ce2b | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = dec(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)==0
new_val=get(F,'current_val');
return
end
new_val = dec(F.oldF,sfo_unique_fast([A F.sset]),el);
new_val = new_val+... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_residual/init.m | 314 | utf_8 | cf34b2ed0c863de15faaf93d27b08f24 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,v] = init(F,A)
A = sfo_unique_fast(A);
F.oldF = init(F.oldF,sfo_unique_fast([A F.sset]));
v = get(F.oldF,'current_val')-F.ssetVal;
F = set(F,'current_set',A,'current_val',v);
|
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_residual/inc.m | 333 | utf_8 | d748b586bd30a45ee9728478727cba00 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function new_val = inc(F,A,el)
A = sfo_unique_fast(A);
if sum(A==el)>0
new_val = get(F,'current_val');
return
end
new_val = inc(F.oldF,sfo_unique_fast([A F.sset]),el);
new_val = new_va... |
github | yjq8812/efficientSegmentation-master | sfo_fn_mi.m | .m | efficientSegmentation-master/sfo/@sfo_fn_mi/sfo_fn_mi.m | 449 | utf_8 | 31da70567b3536695ab84fb61204f601 | % Computes the Gaussian mutual information between a set and its complement
% Author: Andreas Krause (krausea@gmail.com)
%
% function mi = sfo_fn_mi(sigma,V)
% sigma: Covariance Matrix
% set: the ground set
%
% Example: F = sfo_fn_mi(0.5*eye(3)+0.5*ones(3),1:3); F(2)
function F = sfo_fn_mi(sigma,V)
F.sigma = sigma;
F... |
github | yjq8812/efficientSegmentation-master | init.m | .m | efficientSegmentation-master/sfo/@sfo_fn_mi/init.m | 967 | utf_8 | 6aacdea60ff4b5da1e8b4b4fa9c23352 | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function [F,mi] = init(F,sset)
sset = sfo_unique_fast(sset);
if ~isequal(sset,get(F,'current_set'))
Ac = sfo_setdiff_fast(F.V,sset);
F.invAc = inv(F.sigma(Ac,Ac));
F.cholA = chol(F... |
github | yjq8812/efficientSegmentation-master | inc.m | .m | efficientSegmentation-master/sfo/@sfo_fn_mi/inc.m | 750 | utf_8 | 1385c183b61be10ccf8ed8f4f122cc6a | % Implementation by Andreas Krause (krausea@gmail.com)
%
% Example: See sfo_fn.m and the tutorial script for more information
function newScore = inc(F,A,el)
A = sfo_unique_fast(A);
F = init(F,A);
if sum(A==el)>0
newScore = get(F,'current_val');
return;
end
Ac = sfo_setdiff_fast(F.V,[A el]);
pos = ... |
github | yjq8812/efficientSegmentation-master | generateData.m | .m | efficientSegmentation-master/generateUnary/generateData.m | 1,879 | utf_8 | 425a78d86bbc8fd44d0a6e9d3eb08799 | function [X,Y] = generateData(num)
% UnaryFeature:
file = dir('./Dataset/images_people');
gtpath = './Dataset/images_gt';
labelpath = './Dataset/images_labels';
imageList = cell(length(file)-2,1);
for i = 3:length(file)
imageList{i-2} = file(i).name(1:end-4); % set up the names of images
... |
github | yjq8812/efficientSegmentation-master | colorspace.m | .m | efficientSegmentation-master/generateUnary/colorspace.m | 16,178 | utf_8 | 2ca0aee9ae4d0f5c12a7028c45ef2b8d | function varargout = colorspace(Conversion,varargin)
%COLORSPACE Transform a color image between color representations.
% B = COLORSPACE(S,A) transforms the color representation of image A
% where S is a string specifying the conversion. The input array A
% should be a real full double array of size Mx3 or MxN... |
github | yjq8812/efficientSegmentation-master | extendedSeed.m | .m | efficientSegmentation-master/generateUnary/extendedSeed.m | 2,257 | utf_8 | 6c661b73fca45ad0fdcbd661d009dac0 | function [Yextended] = extendedSeed(GT,A)
% 1) For each image we have GT object segment, FRG seeds, and BKG seeds.
FRG =zeros(size(A));
FRG(find(A==1))=1;
BKG =zeros(size(A));
BKG(find(A==2))=2;
% 2) For each pixel of FRG and BKG we compute the minimum distance to the object boundary.
[minDistFG,FGindex] = minDist(FRG... |
github | yjq8812/efficientSegmentation-master | nema_vector_quantize.m | .m | efficientSegmentation-master/generateUnary/gmm/nema_vector_quantize.m | 4,991 | utf_8 | 525b28d758fe641421bb02a2bca63e66 | function [ MODEL, MAP ] = nema_vector_quantize( C, M, W )
% NEMA_VECTOR_QUANTIZE A vector quantization function that uses the
% binary split algorithm of Orchard and Bouman:
%
% Color Quantization of Images, M. Orchard and C. Bouman, IEEE
% Trans. on Signal Processing, Vol. 39, No. 12, pp, 2677--2690,
% Dec. 1991.
... |
github | yjq8812/efficientSegmentation-master | colorspace_demo.m | .m | efficientSegmentation-master/generateUnary/colorspace/colorspace/colorspace_demo.m | 6,856 | utf_8 | f7d66bc3e0e1bf1611fbd525c617323c | function colorspace_demo(Cmd)
% Demo for colorspace.m - 3D visualizations of various color spaces
% Pascal Getreuer 2006
if nargin == 0
% Create a figure with a drop-down menu
figure('Color',[1,1,1]);
h = uicontrol('Style','popup','Position',[15,10,90,21],...
'BackgroundColor',[1,1,1],'Value',2,...
... |
github | yjq8812/efficientSegmentation-master | colorspace.m | .m | efficientSegmentation-master/generateUnary/colorspace/colorspace/colorspace.m | 16,178 | utf_8 | 2ca0aee9ae4d0f5c12a7028c45ef2b8d | function varargout = colorspace(Conversion,varargin)
%COLORSPACE Transform a color image between color representations.
% B = COLORSPACE(S,A) transforms the color representation of image A
% where S is a string specifying the conversion. The input array A
% should be a real full double array of size Mx3 or MxN... |
github | JeslieHCI/UTKinect_3-master | kernel_svm_one_vs_all_modified.m | .m | UTKinect_3-master/code/classifiers/kernel_svm_one_vs_all_modified.m | 2,757 | utf_8 | 062b60d9887c0c012a5d429220e4b35e | % One-Vs-all SVM
% Final decision is based on max(w*x+b)
function [total_accuracy, class_wise_accuracy, confusion_matrix,...
train_prediction_prob, test_prediction_prob] =...
kernel_svm_one_vs_all_modified(K_train_train, K_test_train,...
training_labels, test_labels, C_val)
unique_classes = un... |
github | JeslieHCI/UTKinect_3-master | drawskt.m | .m | UTKinect_3-master/data/MSRAction3D/real_world_coordinates/drawskt.m | 1,142 | utf_8 | 39ba4c3f206fe79351b2d3ba8f183a80 | %USAGE: drawskt(1,3,1,4,1,2) --- show actions 1,2,3 performed by subjects 1,2,3,4 with instances 1 and 2.
function drawskt(a1,a2,s1,s2,e1,e2)
J=[20 1 2 1 8 10 2 9 11 3 4 7 7 5 6 14 15 16 17;
3 3 3 8 10 12 9 11 13 4 ... |
github | cs1471/Modelling-master | invToeplitzFast.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/code/gpfa/util/invToeplitz/invToeplitzFast.m | 2,769 | utf_8 | 03c2aab366f0548601368c4befe92096 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% invToeplitzFast()
%
% This function is simply a wrapper for the C-MEX
% function invToeplitzFastZohar.mexa64 (or .mexglx, etc),
% which is just a compiled version of invToeplitzFastZohar.c,
% which should also be in this folder. Pleas... |
github | cs1471/Modelling-master | invToeplitz.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/code/gpfa/util/invToeplitz/invToeplitz.m | 9,888 | utf_8 | 8c82a5ae1cbe3baba9657e174fdc1877 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% invToeplitz()
%
% Invert a symmetric, real, positive definite Toeplitz matrix
% using either inv() or the Trench algorithm, which
% uses Zohar 1969. This is slightly different than
% Algorithm 4.7.3 of Golub a... |
github | cs1471/Modelling-master | makePrecomp.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/code/gpfa/util/precomp/makePrecomp.m | 4,695 | utf_8 | 5ff299c3fa413c3689771447ea6f1a5a |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% makePrecomp()
%
% Make the precomputation matrices specified by the GPFA algorithm.
%
% Usage: [precomp] = makePautoSum( seq , xDim )
%
% Inputs:
% seq - The sequence struct of inferred latents, etc.
%... |
github | cs1471/Modelling-master | invToeplitzFast.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/gpfa/util/invToeplitz/invToeplitzFast.m | 2,769 | utf_8 | 03c2aab366f0548601368c4befe92096 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% invToeplitzFast()
%
% This function is simply a wrapper for the C-MEX
% function invToeplitzFastZohar.mexa64 (or .mexglx, etc),
% which is just a compiled version of invToeplitzFastZohar.c,
% which should also be in this folder. Pleas... |
github | cs1471/Modelling-master | invToeplitz.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/gpfa/util/invToeplitz/invToeplitz.m | 9,888 | utf_8 | 8c82a5ae1cbe3baba9657e174fdc1877 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% invToeplitz()
%
% Invert a symmetric, real, positive definite Toeplitz matrix
% using either inv() or the Trench algorithm, which
% uses Zohar 1969. This is slightly different than
% Algorithm 4.7.3 of Golub a... |
github | cs1471/Modelling-master | makePrecomp.m | .m | Modelling-master/month_Maneesh_Sahani/codingPractice/gpfa/util/precomp/makePrecomp.m | 4,695 | utf_8 | 5ff299c3fa413c3689771447ea6f1a5a |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% John P Cunningham
% 2009
%
% makePrecomp()
%
% Make the precomputation matrices specified by the GPFA algorithm.
%
% Usage: [precomp] = makePautoSum( seq , xDim )
%
% Inputs:
% seq - The sequence struct of inferred latents, etc.
%... |
github | cs1471/Modelling-master | preprocess_sound.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/preprocess_sound.m | 6,342 | utf_8 | e91d29d5b29f792a623454d0d567b9fe | %% Preprocess .wav files and spike times into time-frequency representations and PSTHs
%
% Input:
% rawStimFiles: a cell array of .wav file names
%
% rawRespFiles: a cell array of spike-time file names. Each file
% contains a space-separated list of file times, one line for each
% trial. ... |
github | cs1471/Modelling-master | split_psth.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/split_psth.m | 1,098 | utf_8 | ced7f94ed52f33644b35bbb26e10afbc | %% Takes a cell array of spike time vectors (one cell for each trial), and
% converts it to a PSTH. It also splits the trials in half, and creates a
% PSTH for each half.
% stimLengthMs: The length of the stimlulus in milliseconds
%
% Returns a struct psthdata, where:
% psthdata.psth: PSTH from all trials
% ... |
github | cs1471/Modelling-master | rv.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/rv.m | 156 | utf_8 | 2f21009ec2efedb59c7ef77232cb7673 | %row vector
function b = rv(a)
b = a;
sz = size(a);
isvect = (sz(1) == 1) || (sz(2) == 1);
if (isvect)
if (sz(1) == 1)
b = a';
end
end
|
github | cs1471/Modelling-master | timefreq.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/timefreq.m | 4,328 | utf_8 | 9082007afd83813b174a853cc71a5abe | %% General purpose time-frequency representation function
%
% Input:
% wavFileName: path to .wav file
%
% typeName: 'ft' for short-time fourier transforms
% 'wavelet' for wavelet transforms
% 'lyons' for lyons-model
%
% params: depends on typeName, default values used... |
github | cs1471/Modelling-master | make_tfrep.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/make_tfrep.m | 1,774 | utf_8 | a44e2f132640a5c289cdf4d5cc2af4a8 | %% Create a time-frequency representation structure
% Input:
% typeName: 'ft', 'wavelet', 'lyons'
%
% params: parameters to assign tfrep (optional, if not given then
% default values will be specified for type)
%
% Output:
% tfrep: the time-frequency structure, for use with display_tfrep... |
github | cs1471/Modelling-master | check_fields.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/preprocessing/check_fields.m | 1,505 | utf_8 | dbd1d425a24ecc49caa9c2b6760b3ea6 | %% Checks a structure to make sure it contains the proper fields
%
% Input:
%
% structInstance: a structure to check
%
% requiredFields: a cell array of field names to verify
%
% messageTemplate: a string error message with a %s to specify param
% name
%
% defaultValues: a cell ar... |
github | cs1471/Modelling-master | getSmoothnessPrior.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/getSmoothnessPrior.m | 2,580 | utf_8 | 45a2210c36f4f8eda447c5dc67c87fe2 | function A = getSmoothnessPrior(hsize, sdimension);
%function A = getSmoothnessPrior(hsize, sdimension)
%
% A function to make a smoothnessprior matrix for N-D matrix of size: hsize
% The matrix can be either 1D ~ 3D or 4D
%
% INPUT:
% [hsize] = vector of sizes for each dimension of matrix
% [sdimension] = determi... |
github | cs1471/Modelling-master | preprocWavelets_2007-07-25.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/preprocWavelets_2007-07-25.m | 11,761 | utf_8 | 1f1e200b20a024b7214830ecfd01b681 | function [PS, params] = preprocWavelets(S, params);
% function [PS, params] = preprocWavelets(S, params);
%
% A script for preprocessing of stimuli using a Gabor wavelet bais set
%
% PARAMS = preprocWavelets;
% returns the default set of parameters.
%
% [PS, PARAMS] = preprocWavelets(S, PARAMS)
% returns prepro... |
github | cs1471/Modelling-master | ndimages.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/ndimages.m | 4,733 | utf_8 | fa310b35265e783c1b2df62977387af2 | function out = ndimages(im, Params)
%function out = ndimages(im, Params)
%
% Allows for the display of n-dimensional (up to 6-d) images by tiling
% along higher dimensions
%
% INPUT:
% [im] = a matrix to be displayed (up to 6 dimensions)
% [Params] = structure that contains parameters
% .clim = The minimum a... |
github | cs1471/Modelling-master | preprocWavelets3d.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/preprocWavelets3d.m | 13,460 | utf_8 | aa654f7554386e10e8bd5589b475f585 | function [stim, params] = preprocWavelets3d(rawStim, params);
% function [stim, params] = preprocWavelets(rawStim, params);
%
% A script for preprocessing of stimuli using a Gabor wavelet bais set
%
% INPUT:
% [rawStim] = A X-by-Y-by-T matrix containing stimuli (movie)
% [params] = structure that c... |
github | cs1471/Modelling-master | preprocSpectraVis.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/preprocSpectraVis.m | 715 | utf_8 | 2d681ef925efced874883daa70a5be13 | function preprocSpectraVis(net);
%function preprocSpectraVis(net);
%
% A visualizer of glm net preprocessed by preprocSpectra
%
% INPUT:
% [net] = strf structure to be visualized
%
params = net.params;
fsize = params.fSize;
w = net.w1;
delays = net.delays;
k = reshape(w, [fsize length(delays)]);
maxk = max(abs(k(:... |
github | cs1471/Modelling-master | fdct_wrapping_dispcoef.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/curvelet/fdct_wrapping_dispcoef.m | 1,993 | utf_8 | e67846c8e34ac43ee9cc8b47a70a7976 | function img = fdct_wrapping_dispcoef(C)
% fdct_wrapping_dispcoef - returns an image containing all the curvelet coefficients
%
% Inputs
% C Curvelet coefficients
%
% Outputs
% img Image containing all the curvelet coefficients. The coefficents are rescaled so that
% the largest c... |
github | cs1471/Modelling-master | icwtband.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/icwtband.m | 3,340 | utf_8 | f16dde8670ec29d13224d272f1c1c525 | function [cm,V] = icwtband(ym,L,level,passband,real_or_cplx);
% Function to determine where to insert a modified subband ym in C
% and to convert from complex to real format if ym is complex.
% It is necessary to use 'C(V) = cm;' to then do the insertion.
% (For large arrays C, this is much more efficient than co... |
github | cs1471/Modelling-master | icdwt2.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/icdwt2.m | 969 | utf_8 | e66b61d78f490f361d00b82a5fc3ddfc | % icdwt2.m
%
% Wrapper function for NGK's 2D dual-tree complex wavelet code
% Inverse 2D transform (synthesis)
% The wavelet set (near_sym_a, qshift_a) is hardwired in right now.
% Usage : x = icdwt2(w1, w2, L)
%
% Written by : Justin Romberg
% Created : 1/30/2001
function x = icdwt2(w1, w2, L)
N = size(w... |
github | cs1471/Modelling-master | cwtband2.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/cwtband2.m | 4,589 | utf_8 | 327a4f44ce0ca7a9231e4a1fc4e761f0 | function Z = cwtband2(C,S,level,orientation,real_or_cplx)
% 2-D Dual-tree Complex Wavelet Transform:
% Function to retrieve the subimage required from the 2-D DT CWT vector C.
%
% output = cwtband2(C,S,level,orientation,real_or_cplx)
%
% C -> The column vector containing the Subbands
% S -> The "Bookk... |
github | cs1471/Modelling-master | cdwt2.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/cdwt2.m | 1,503 | utf_8 | bdf964b0a98da471e135259b23c41d1c | % cdwt2.m
%
% Wrapper function for NGK's 2D dual-tree complex wavelet code
% Forward 2D transform (analysis)
% The wavelet set (near_sym_a, qshift_a) is hardwired in right now.
% Usage : [w1, w2] = cdwt2(x, L)
% w1 - subbands with directions
% -----------------
% | | |
% | X |... |
github | cs1471/Modelling-master | icwtband6.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/icwtband6.m | 2,871 | utf_8 | afe7d5b2e1c1041fc00289e23d399c9e | function [cm,V] = icwtband6(ym,S,level);
% 2-D Dual-tree Complex Wavelet Transform:
% Function to determine where to insert a modified set of 6 subimages ym
% into C and to convert from complex to real format.
% It is necessary to use 'C(V) = cm;' to then do the insertion.
% (For large arrays C, this is much mo... |
github | cs1471/Modelling-master | cdwt.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/cdwt.m | 743 | utf_8 | 09074428fddca9c42995a2dfa15938a4 | % cdwt.m
%
% Wrapper function for NGK's 1D dual-tree complex wavelet code.
% The wavelet set (near_sym_a, qshift_a) is hardwired in right now.
% Usage : w = cdwt(x, L)
%
% Written by : Justin Romberg
% Created : 12/5/2000
function w = cdwt(x, L)
% make x a column vector
rw = 0;
if (size(x,1) == 1)
x =... |
github | cs1471/Modelling-master | icdwt.m | .m | Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/icdwt.m | 711 | utf_8 | dee542ce3519fb5296ec228cb2d062a0 | % icdwt.m
%
% Wrapper function for NGK's 1D dual-tree complex wavelet code.
% The wavelet set (near_sym_a, qshift_a) is hardwired.
% Usage : x = icdwt(w, L)
%
% Written by : Justin Romberg
% Created : 12/5/2000
function x = icdwt(w, L)
rw = 0;
if (size(w,1) == 1)
rw = 1;
w = w.';
end
Lx = log2(l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.