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 | GYZHikari/Semantic-Cosegmentation-master | getargs.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/getargs.m | 3,455 | utf_8 | de2bab917fa6b9ba3099f1c6b6d68cf0 | % Utility to process parameter name/value pairs.
%
% DEPRECATED -- ONLY USED BY KMEANS2? SHOULD BE REMOVED.
% USE GETPARAMDEFAULTS INSTEAD.
%
% Based on code fromt Matlab Statistics Toolobox's "private/statgetargs.m"
%
% [EMSG,A,B,...]=GETARGS(PNAMES,DFLTS,'NAME1',VAL1,'NAME2',VAL2,...)
% accepts a cell array PNAMES o... |
github | GYZHikari/Semantic-Cosegmentation-master | normxcorrn_fg.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/normxcorrn_fg.m | 2,699 | utf_8 | e65c38d97efb3a624e0fa94a97f75eb6 | % Normalized n-dimensional cross-correlation with a mask.
%
% Similar to normxcorrn, except takes an additional argument that specifies
% a figure ground mask for the T. That is T_fg must be of the same
% dimensions as T, with each entry being 0 or 1, where zero specifies
% regions to ignore (the ground) and 1 specifi... |
github | GYZHikari/Semantic-Cosegmentation-master | makemovie.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/makemovie.m | 1,266 | utf_8 | 9a03d9a5227c4eaa86520f206ce283e7 | % [3D] Used to convert a stack of T images into a movie.
%
% To display same data statically use montage.
%
% USAGE
% M = makemovies( IS )
%
% INPUTS
% IS - MxNxT or MxNx1xT or MxNx3xT array of movies.
%
% OUTPUTS
% M - resulting movie
%
% EXAMPLE
% load( 'images.mat' );
% M = makemovie(... |
github | GYZHikari/Semantic-Cosegmentation-master | localsum_block.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/localsum_block.m | 815 | utf_8 | 1216b03a3bd44ff1fc3256de16a2f1c6 | % Calculates the sum in non-overlapping blocks of I of size dims.
%
% Similar to localsum except gets sum in non-overlapping windows.
% Equivalent to doing localsum, and then subsampling (except more
% efficient).
%
% USAGE
% I = localsum_block( I, dims )
%
% INPUTS
% I - matrix to compute sum over
% dims -... |
github | GYZHikari/Semantic-Cosegmentation-master | imrotate2.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/imrotate2.m | 1,326 | utf_8 | bb2ff6c3138ce5f53154d58d7ebc4f31 | % Custom version of imrotate that demonstrates use of apply_homography.
%
% Works exactly the same as imrotate. For usage see imrotate.
%
% USAGE
% IR = imrotate2( I, angle, [method], [bbox] )
%
% INPUTS
% I - 2D image [converted to double]
% angle - angle to rotate in degrees
% method - ['linear'] 'neare... |
github | GYZHikari/Semantic-Cosegmentation-master | imSubsResize.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/imSubsResize.m | 1,338 | utf_8 | cd7dedf790c015adfb1f2d620e9ed82f | % Resizes subs by resizVals.
%
% Resizes subs in subs/vals image representation by resizVals.
%
% This essentially replaces each sub by sub.*resizVals. The only subtlety
% is that in images the leftmost sub value is .5, so for example when
% resizing by a factor of 2, the first pixel is replaced by 2 pixels and so
% l... |
github | GYZHikari/Semantic-Cosegmentation-master | imtranslate.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/imtranslate.m | 1,183 | utf_8 | 054727fb31c105414b655c0f938b6ced | % Translate an image to subpixel accuracy.
%
% Note that for subplixel accuracy cannot use nearest neighbor interp.
%
% USAGE
% IR = imtranslate( I, dx, dy, [method], [bbox] )
%
% INPUTS
% I - 2D image [converted to double]
% dx - x translation (right)
% dy - y translation (up)
% method - ['linear... |
github | GYZHikari/Semantic-Cosegmentation-master | randperm2.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/randperm2.m | 1,398 | utf_8 | 5007722f3d5f5ba7c0f83f32ef8a3a2c | % Returns a random permutation of integers.
%
% randperm2(n) is a random permutation of the integers from 1 to n. For
% example, randperm2(6) might be [2 4 5 6 1 3]. randperm2(n,k) is only
% returns the first k elements of the permuation, so for example
% randperm2(6) might be [2 4]. This is a faster version of randp... |
github | GYZHikari/Semantic-Cosegmentation-master | apply_homography.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/apply_homography.m | 3,582 | utf_8 | 9c3ed72d35b1145f41114e6e6135b44f | % Applies the homography defined by H on the image I.
%
% Takes the center of the image as the origin, not the top left corner.
% Also, the coordinate system is row/ column format, so H must be also.
%
% The bounding box of the image is set by the BBOX argument, a string that
% can be 'loose' (default) or 'crop'. When ... |
github | GYZHikari/Semantic-Cosegmentation-master | pca_apply.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/pca_apply.m | 2,427 | utf_8 | 0831befb6057f8502bc492227455019a | % Companion function to pca.
%
% Use pca to retrieve the principal components U and the mean mu from a
% set fo vectors X1 via [U,mu,vars] = pca(X1). Then given a new
% vector x, use y = pca_apply( x, U, mu, vars, k ) to get the first k
% coefficients of x in the space spanned by the columns of U. See pca for
% genera... |
github | GYZHikari/Semantic-Cosegmentation-master | mode2.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/deprecated/mode2.m | 731 | utf_8 | 5c9321ef4b610b4f4a2d43902a68838e | % Returns the mode of a vector.
%
% Was mode not part of Matlab before?
%
% USAGE
% y = mode2( x )
%
% INPUTS
% x - vector of integers
%
% OUTPUTS
% y - mode
%
% EXAMPLE
% x = randint2( 1, 10, [1 3] )
% mode(x), mode2( x )
%
% See also MODE
% Piotr's Image&Video Toolbox Version 1.5
% Written and maintain... |
github | GYZHikari/Semantic-Cosegmentation-master | savefig.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/external/other/savefig.m | 13,459 | utf_8 | 2b8463f9b01ceb743e440d8fb5755829 | function savefig(fname, varargin)
% Usage: savefig(filename, fighdl, options)
%
% Saves a pdf, eps, png, jpeg, and/or tiff of the contents of the fighandle's (or current) figure.
% It saves an eps of the figure and the uses Ghostscript to convert to the other formats.
% The result is a cropped, clean picture. There a... |
github | GYZHikari/Semantic-Cosegmentation-master | dirSynch.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/dirSynch.m | 4,570 | utf_8 | d288299d31d15f1804183206d0aa0227 | function dirSynch( root1, root2, showOnly, flag, ignDate )
% Synchronize two directory trees (or show differences between them).
%
% If a file or directory 'name' is found in both tree1 and tree2:
% 1) if 'name' is a file in both the pair is considered the same if they
% have identical size and identical datestamp... |
github | GYZHikari/Semantic-Cosegmentation-master | plotRoc.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/plotRoc.m | 5,212 | utf_8 | 008f9c63073c6400c4960e9e213c47e5 | function [h,miss,stds] = plotRoc( D, varargin )
% Function for display of rocs (receiver operator characteristic curves).
%
% Display roc curves. Consistent usage ensures uniform look for rocs. The
% input D should have n rows, each of which is of the form:
% D = [falsePosRate truePosRate]
% D is generated, for exampl... |
github | GYZHikari/Semantic-Cosegmentation-master | simpleCache.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/simpleCache.m | 4,098 | utf_8 | 92df86b0b7e919c9a26388e598e4d370 | function varargout = simpleCache( op, cache, varargin )
% A simple cache that can be used to store results of computations.
%
% Can save and retrieve arbitrary values using a vector (includnig char
% vectors) as a key. Especially useful if a function must perform heavy
% computation but is often called with the same in... |
github | GYZHikari/Semantic-Cosegmentation-master | tpsInterpolate.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/tpsInterpolate.m | 1,646 | utf_8 | d3bd3a26d048f32cfdc17884ccae6d8c | function [xsR,ysR] = tpsInterpolate( warp, xs, ys, show )
% Apply warp (obtained by tpsGetWarp) to a set of new points.
%
% USAGE
% [xsR,ysR] = tpsInterpolate( warp, xs, ys, [show] )
%
% INPUTS
% warp - [see tpsGetWarp] bookstein warping parameters
% xs, ys - points to apply warp to
% show - [1] will disp... |
github | GYZHikari/Semantic-Cosegmentation-master | checkNumArgs.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/checkNumArgs.m | 3,796 | utf_8 | 726c125c7dc994c4989c0e53ad4be747 | function [ x, er ] = checkNumArgs( x, siz, intFlag, signFlag )
% Helper utility for checking numeric vector arguments.
%
% Runs a number of tests on the numeric array x. Tests to see if x has all
% integer values, all positive values, and so on, depending on the values
% for intFlag and signFlag. Also tests to see if ... |
github | GYZHikari/Semantic-Cosegmentation-master | fevalDistr.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/matlab/fevalDistr.m | 11,227 | utf_8 | 7e4d5077ef3d7a891b2847cb858a2c6c | function [out,res] = fevalDistr( funNm, jobs, varargin )
% Wrapper for embarrassingly parallel function evaluation.
%
% Runs "r=feval(funNm,jobs{i}{:})" for each job in a parallel manner. jobs
% should be a cell array of length nJob and each job should be a cell array
% of parameters to pass to funNm. funNm must be a f... |
github | GYZHikari/Semantic-Cosegmentation-master | medfilt1m.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/filters/medfilt1m.m | 2,998 | utf_8 | a3733d27c60efefd57ada9d83ccbaa3d | function y = medfilt1m( x, r, z )
% One-dimensional adaptive median filtering with missing values.
%
% Applies a width s=2*r+1 one-dimensional median filter to vector x, which
% may contain missing values (elements equal to z). If x contains no
% missing values, y(j) is set to the median of x(j-r:j+r). If x contains
% ... |
github | GYZHikari/Semantic-Cosegmentation-master | FbMake.m | .m | Semantic-Cosegmentation-master/code/Util/pdollar_toolbox/filters/FbMake.m | 6,692 | utf_8 | b625c1461a61485af27e490333350b4b | function FB = FbMake( dim, flag, show )
% Various 1D/2D/3D filterbanks (hardcoded).
%
% USAGE
% FB = FbMake( dim, flag, [show] )
%
% INPUTS
% dim - dimension
% flag - controls type of filterbank to create
% - if d==1
% 1: gabor filter bank for spatiotemporal stuff
% - if d==2
% ... |
github | GYZHikari/Semantic-Cosegmentation-master | computeColor.m | .m | Semantic-Cosegmentation-master/code/Util/Optical Flow/computeColor.m | 3,142 | utf_8 | a36a650437bc93d4d8ffe079fe712901 | function img = computeColor(u,v)
% computeColor color codes flow field U, V
% According to the c++ source code of Daniel Scharstein
% Contact: schar@middlebury.edu
% Author: Deqing Sun, Department of Computer Science, Brown University
% Contact: dqsun@cs.brown.edu
% $Date: 2007-10-31 21:20:30 (Wed, 31 O... |
github | GYZHikari/Semantic-Cosegmentation-master | region_to_shape.m | .m | Semantic-Cosegmentation-master/code/Ours/region_to_shape.m | 2,301 | utf_8 | 47925c4dc400a8d41c1f05e006daeb3d | function polar_values_descrete=region_to_shape(im_region)
if nargin==0
im_region=imread('50.png');
end
[region_i region_j]=find(im_region(:,:,1));
region_i_mean=mean(region_i);
region_j_mean=mean(region_j);
region_size=length(region_i);
region_size_normalize=10000;
im_edge=edge(i... |
github | GYZHikari/Semantic-Cosegmentation-master | gene_weight.m | .m | Semantic-Cosegmentation-master/code/Ours/gene_weight.m | 826 | utf_8 | 61eb07fae858ed2653a0b66fba7fb527 | function affmat = gene_weight( feature, nodes, theta)
affmat = zeros(numel(nodes), numel(nodes));
%% attach addtional connection/edge
edges = edges_between(nodes);
%% compute affinity matrix value
row = edges(:,1); col = edges(:,2);
ind = sub2ind(size(affmat), row, col);
tmp = sum( (feature(row,:) - feature(... |
github | siprob/arhmm_mcmc-master | arhmm_est_cpu.m | .m | arhmm_mcmc-master/arhmm_est_cpu.m | 1,882 | utf_8 | 911a9f82c561722b95f1ea9e0a72b254 | %{
Parallel MCMC sampling of AR-HMMs for stochastic time series prediction.
- Calculate predictions for a given set of AR-HMMs and an initial observation sequence.
Written by I. R. Sipos (siposr@hit.bme.hu) and A. Ceffer (ceffer@hit.bme.hu)
(Department of Networked Systems and Services,
Budapest University of Techno... |
github | siprob/arhmm_mcmc-master | cond_indep_fisher_z.m | .m | arhmm_mcmc-master/HMMall/KPMstats/cond_indep_fisher_z.m | 3,647 | utf_8 | e3291330222ba7b37c56cc824decff44 | function [CI, r, p] = cond_indep_fisher_z(X, Y, S, C, N, alpha)
% COND_INDEP_FISHER_Z Test if X indep Y given Z using Fisher's Z test
% CI = cond_indep_fisher_z(X, Y, S, C, N, alpha)
%
% C is the covariance (or correlation) matrix
% N is the sample size
% alpha is the significance level (default: 0.05)
%
% See p133 of ... |
github | siprob/arhmm_mcmc-master | logistK.m | .m | arhmm_mcmc-master/HMMall/KPMstats/logistK.m | 7,253 | utf_8 | 9539c8105ebca14d632373f5f9f4b70d | function [beta,post,lli] = logistK(x,y,w,beta)
% [beta,post,lli] = logistK(x,y,beta,w)
%
% k-class logistic regression with optional sample weights
%
% k = number of classes
% n = number of samples
% d = dimensionality of samples
%
% INPUT
% x dxn matrix of n input column vectors
% y kxn vector of class assignment... |
github | siprob/arhmm_mcmc-master | multipdf.m | .m | arhmm_mcmc-master/HMMall/KPMstats/multipdf.m | 1,192 | utf_8 | 1fce56db4c9a59d35960bd25df11b1f9 | function p = multipdf(x,theta)
%MULTIPDF Multinomial probability density function.
% p = multipdf(x,theta) returns the probabilities of
% vector x, under the multinomial distribution
% with parameter vector theta.
%
% Author: David Ross
%--------------------------------------------------------
% Check the arg... |
github | siprob/arhmm_mcmc-master | metrop.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/metrop.m | 5,284 | utf_8 | df084b9ad36314e304a99b9b1f3c955e | function [samples, energies, diagn] = metrop(f, x, options, gradf, varargin)
%METROP Markov Chain Monte Carlo sampling with Metropolis algorithm.
%
% Description
% SAMPLES = METROP(F, X, OPTIONS) uses the Metropolis algorithm to
% sample from the distribution P ~ EXP(-F), where F is the first
% argument to METROP. T... |
github | siprob/arhmm_mcmc-master | hmc.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/hmc.m | 7,683 | utf_8 | 64c15e958297afe69787b8617dc1a56a | function [samples, energies, diagn] = hmc(f, x, options, gradf, varargin)
%HMC Hybrid Monte Carlo sampling.
%
% Description
% SAMPLES = HMC(F, X, OPTIONS, GRADF) uses a hybrid Monte Carlo
% algorithm to sample from the distribution P ~ EXP(-F), where F is the
% first argument to HMC. The Markov chain starts at the poi... |
github | siprob/arhmm_mcmc-master | gtminit.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/gtminit.m | 5,204 | utf_8 | ab76f6114a7e85375ade5e5889d5f6a7 | function net = gtminit(net, options, data, samp_type, varargin)
%GTMINIT Initialise the weights and latent sample in a GTM.
%
% Description
% NET = GTMINIT(NET, OPTIONS, DATA, SAMPTYPE) takes a GTM NET and
% generates a sample of latent data points and sets the centres (and
% widths if appropriate) of NET.RBFNET.
%
% I... |
github | siprob/arhmm_mcmc-master | mlphess.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/mlphess.m | 1,633 | utf_8 | b91a15ca11b4886de6c1671c33a735d3 | function [h, hdata] = mlphess(net, x, t, hdata)
%MLPHESS Evaluate the Hessian matrix for a multi-layer perceptron network.
%
% Description
% H = MLPHESS(NET, X, T) takes an MLP network data structure NET, a
% matrix X of input values, and a matrix T of target values and returns
% the full Hessian matrix H corresponding... |
github | siprob/arhmm_mcmc-master | glmhess.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/glmhess.m | 4,024 | utf_8 | 2d706b82d25cb35ff9467fe8837ef26f | function [h, hdata] = glmhess(net, x, t, hdata)
%GLMHESS Evaluate the Hessian matrix for a generalised linear model.
%
% Description
% H = GLMHESS(NET, X, T) takes a GLM network data structure NET, a
% matrix X of input values, and a matrix T of target values and returns
% the full Hessian matrix H corresponding to t... |
github | siprob/arhmm_mcmc-master | rbfhess.m | .m | arhmm_mcmc-master/HMMall/netlab3.3/rbfhess.m | 3,138 | utf_8 | 0a6ef29c8be32e9991cacfe42bdfa0b3 | function [h, hdata] = rbfhess(net, x, t, hdata)
%RBFHESS Evaluate the Hessian matrix for RBF network.
%
% Description
% H = RBFHESS(NET, X, T) takes an RBF network data structure NET, a
% matrix X of input values, and a matrix T of target values and returns
% the full Hessian matrix H corresponding to the second deriva... |
github | siprob/arhmm_mcmc-master | dhmm_em.m | .m | arhmm_mcmc-master/HMMall/HMM/dhmm_em.m | 4,081 | utf_8 | e23671f3809776edff04b1c4ec457169 | function [LL, prior, transmat, obsmat, nrIterations] = ...
dhmm_em(data, prior, transmat, obsmat, varargin)
% LEARN_DHMM Find the ML/MAP parameters of an HMM with discrete outputs using EM.
% [ll_trace, prior, transmat, obsmat, iterNr] = learn_dhmm(data, prior0, transmat0, obsmat0, ...)
%
% Notation: Q(t) = hidden s... |
github | siprob/arhmm_mcmc-master | mhmm_em.m | .m | arhmm_mcmc-master/HMMall/HMM/mhmm_em.m | 5,884 | utf_8 | f63c5cc11c6d1ae9f2a0a94d8d639218 | function [LL, prior, transmat, mu, Sigma, mixmat] = ...
mhmm_em(data, prior, transmat, mu, Sigma, mixmat, varargin);
% LEARN_MHMM Compute the ML parameters of an HMM with (mixtures of) Gaussians output using EM.
% [ll_trace, prior, transmat, mu, sigma, mixmat] = learn_mhmm(data, ...
% prior0, transmat0, mu0, sig... |
github | siprob/arhmm_mcmc-master | subv2ind.m | .m | arhmm_mcmc-master/HMMall/KPMtools/subv2ind.m | 1,574 | utf_8 | e85d0bab88fc0d35b803436fa1dc0e15 | function ndx = subv2ind(siz, subv)
% SUBV2IND Like the built-in sub2ind, but the subscripts are given as row vectors.
% ind = subv2ind(siz,subv)
%
% siz can be a row or column vector of size d.
% subv should be a collection of N row vectors of size d.
% ind will be of size N * 1.
%
% Example:
% subv = [1 1 1;
% ... |
github | siprob/arhmm_mcmc-master | zipload.m | .m | arhmm_mcmc-master/HMMall/KPMtools/zipload.m | 1,611 | utf_8 | 67412c21b14bebb640784443e9e3bbd8 | %ZIPLOAD Load compressed data file created with ZIPSAVE
%
% [data] = zipload( filename )
% filename: string variable that contains the name of the
% compressed file (do not include '.zip' extension)
% Use only with files created with 'zipsave'
% pkzip25.exe has to be in the matlab path. This file is a compression ut... |
github | siprob/arhmm_mcmc-master | plot_ellipse.m | .m | arhmm_mcmc-master/HMMall/KPMtools/plot_ellipse.m | 507 | utf_8 | 3a27bbd5c1bdfe99983171e96789da6d | % PLOT_ELLIPSE
% h=plot_ellipse(x,y,theta,a,b)
%
% This routine plots an ellipse with centre (x,y), axis lengths a,b
% with major axis at an angle of theta radians from the horizontal.
%
% Author: P. Fieguth
% Jan. 98
%
%http://ocho.uwaterloo.ca/~pfieguth/Teaching/372/plot_ellipse.m
function h=plot_ellipse(x,... |
github | siprob/arhmm_mcmc-master | bipartiteMatchingHungarian.m | .m | arhmm_mcmc-master/HMMall/KPMtools/bipartiteMatchingHungarian.m | 2,593 | utf_8 | 983df7bc538a844b42427ae58d69c75b | % MATCH - Solves the weighted bipartite matching (or assignment)
% problem.
%
% Usage: a = match(C);
%
% Arguments:
% C - an m x n cost matrix; the sets are taken to be
% 1:m and 1:n; C(i, j) gives the cost of matching
% items i (of the first set) and j (of the se... |
github | siprob/arhmm_mcmc-master | conf2mahal.m | .m | arhmm_mcmc-master/HMMall/KPMtools/conf2mahal.m | 2,424 | utf_8 | 682226ca8c1183325f4204e0c22de0a7 | % CONF2MAHAL - Translates a confidence interval to a Mahalanobis
% distance. Consider a multivariate Gaussian
% distribution of the form
%
% p(x) = 1/sqrt((2 * pi)^d * det(C)) * exp((-1/2) * MD(x, m, inv(C)))
%
% where MD(x, m, P) is the Mahalanobis distance from x
% ... |
github | siprob/arhmm_mcmc-master | plotgauss2d.m | .m | arhmm_mcmc-master/HMMall/KPMtools/plotgauss2d.m | 4,119 | utf_8 | 1bf48827c7a74f224086a54411e4ac82 | function h=plotgauss2d(mu, Sigma)
% PLOTGAUSS2D Plot a 2D Gaussian as an ellipse with optional cross hairs
% h=plotgauss2(mu, Sigma)
%
h = plotcov2(mu, Sigma);
return;
%%%%%%%%%%%%%%%%%%%%%%%%
% PLOTCOV2 - Plots a covariance ellipse with major and minor axes
% for a bivariate Gaussian distribution.
%
% Us... |
github | siprob/arhmm_mcmc-master | zipsave.m | .m | arhmm_mcmc-master/HMMall/KPMtools/zipsave.m | 1,480 | utf_8 | cc543374345b9e369d147c452008bc36 | %ZIPSAVE Save data in compressed format
%
% zipsave( filename, data )
% filename: string variable that contains the name of the resulting
% compressed file (do not include '.zip' extension)
% pkzip25.exe has to be in the matlab path. This file is a compression utility
% made by Pkware, Inc. It can be dowloaded from... |
github | siprob/arhmm_mcmc-master | matprint.m | .m | arhmm_mcmc-master/HMMall/KPMtools/matprint.m | 1,020 | utf_8 | e92a96dad0e0b9f25d2fe56280ba6393 | % MATPRINT - prints a matrix with specified format string
%
% Usage: matprint(a, fmt, fid)
%
% a - Matrix to be printed.
% fmt - C style format string to use for each value.
% fid - Optional file id.
%
% Eg. matprint(a,'%3.1f') will print each entry to 1 decimal place
... |
github | siprob/arhmm_mcmc-master | plotcov3.m | .m | arhmm_mcmc-master/HMMall/KPMtools/plotcov3.m | 4,040 | utf_8 | 1f186acd56002148a3da006a9fc8b6a2 | % PLOTCOV3 - Plots a covariance ellipsoid with axes for a trivariate
% Gaussian distribution.
%
% Usage:
% [h, s] = plotcov3(mu, Sigma[, OPTIONS]);
%
% Inputs:
% mu - a 3 x 1 vector giving the mean of the distribution.
% Sigma - a 3 x 3 symmetric positive semi-definite matrix giving
% the... |
github | siprob/arhmm_mcmc-master | exportfig.m | .m | arhmm_mcmc-master/HMMall/KPMtools/exportfig.m | 30,663 | utf_8 | 838a8ee93ca6a9b6a85a90fa68976617 | function varargout = exportfig(varargin)
%EXPORTFIG Export a figure.
% EXPORTFIG(H, FILENAME) writes the figure H to FILENAME. H is
% a figure handle and FILENAME is a string that specifies the
% name of the output file.
%
% EXPORTFIG(H, FILENAME, OPTIONS) writes the figure H to FILENAME
% with options init... |
github | siprob/arhmm_mcmc-master | montageKPM.m | .m | arhmm_mcmc-master/HMMall/KPMtools/montageKPM.m | 2,917 | utf_8 | 3863707e80820a96eac8635dfccbbf11 | function h = montageKPM(arg)
% montageKPM is like the built-in montage, but assumes input is MxNxK or filenames
%
% Converts patches (y,x,i) into patches(y,x,1,i)
% Also, adds a black border aroudn them
if iscell(arg)
h= montageFilenames(arg);
else
nr = size(arg,1); nc = size(arg,2); Npatches = size(arg,3);
patc... |
github | siprob/arhmm_mcmc-master | optimalMatching.m | .m | arhmm_mcmc-master/HMMall/KPMtools/optimalMatching.m | 2,593 | utf_8 | 983df7bc538a844b42427ae58d69c75b | % MATCH - Solves the weighted bipartite matching (or assignment)
% problem.
%
% Usage: a = match(C);
%
% Arguments:
% C - an m x n cost matrix; the sets are taken to be
% 1:m and 1:n; C(i, j) gives the cost of matching
% items i (of the first set) and j (of the se... |
github | siprob/arhmm_mcmc-master | plotcov2.m | .m | arhmm_mcmc-master/HMMall/KPMtools/plotcov2.m | 3,013 | utf_8 | 4305f11ba0280ef8ebcad4c8a4c4013c | % PLOTCOV2 - Plots a covariance ellipse with major and minor axes
% for a bivariate Gaussian distribution.
%
% Usage:
% h = plotcov2(mu, Sigma[, OPTIONS]);
%
% Inputs:
% mu - a 2 x 1 vector giving the mean of the distribution.
% Sigma - a 2 x 2 symmetric positive semi-definite matrix giving
% ... |
github | siprob/arhmm_mcmc-master | ind2subv.m | .m | arhmm_mcmc-master/HMMall/KPMtools/ind2subv.m | 1,206 | utf_8 | 5c2e8689803ece8fca091e60c913809d | function sub = ind2subv(siz, ndx)
% IND2SUBV Like the built-in ind2sub, but returns the answer as a row vector.
% sub = ind2subv(siz, ndx)
%
% siz and ndx can be row or column vectors.
% sub will be of size length(ndx) * length(siz).
%
% Example
% ind2subv([2 2 2], 1:8) returns
% [1 1 1
% 2 1 1
% ...
% 2 2 2]
% ... |
github | siprob/arhmm_mcmc-master | process_options.m | .m | arhmm_mcmc-master/HMMall/KPMtools/process_options.m | 4,394 | utf_8 | 483b50d27e3bdb68fd2903a0cab9df44 | % PROCESS_OPTIONS - Processes options passed to a Matlab function.
% This function provides a simple means of
% parsing attribute-value options. Each option is
% named by a unique string and is given a default
% value.
%
% Usage: [var1, var2, ...... |
github | siprob/arhmm_mcmc-master | nonmaxsup.m | .m | arhmm_mcmc-master/HMMall/KPMtools/nonmaxsup.m | 1,708 | utf_8 | ad451680a9d414f907da2969e0809c22 | % NONMAXSUP - Non-maximal Suppression
%
% Usage: cim = nonmaxsup(im, radius)
%
% Arguments:
% im - image to be processed.
% radius - radius of region considered in non-maximal
% suppression (optional). Typical values to use might
% be 1-3. Default i... |
github | jordiolivares/visio.artificial-master | haarFeatureDemo.m | .m | visio.artificial-master/images_P5/haarFeatureDemo.m | 6,707 | utf_8 | 8fcda30aa7babd3f4ef6e434391b9163 | function [ outClass, X, Y, selFeatures, error, predErr ] = haarFeatureDemo(numFeatures,X,Y,Yprev)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
outSize=[30,30];
close all;
% Get dataset
if ~exist('numFeatures','var'),
numFeatures=3;
end
... |
github | jordiolivares/visio.artificial-master | ej53.m | .m | visio.artificial-master/images_P5/ej53.m | 1,450 | utf_8 | 2646d810245093f1e2fa9d2902278a60 | function [ output_args ] = ej53( input_args )
%EJ53 Summary of this function goes here
% Detailed explanation goes here
addpath('ViolaJones','ViolaJones/SubFunctions');
% a)
[X, Y] = getDataBase([20 20]);
X = uint8(round(reshape(mean(X), [20 20])));
imshow(X);
rectangle('Position', [3 7 14 4],... |
github | jordiolivares/visio.artificial-master | ej24.m | .m | visio.artificial-master/images_P2/ej24.m | 1,282 | utf_8 | 58db53473919bd455693025b2964462c | function [] = ej24()
%EJ24 Summary of this function goes here
% Detailed explanation goes here
einstein = imread('einstein.jpg');
monroe = imread('monroe.jpg');
h_monroe = hybrid(monroe, einstein, 6, 10);
background = zeros(size(h_monroe), 'uint8');
figure
subplot(3,3,1)
imshow(einstein);
... |
github | jordiolivares/visio.artificial-master | gaussRandom.m | .m | visio.artificial-master/images_P3/gaussRandom.m | 6,443 | utf_8 | 8f6251f91754da2356403f31ea2ed4a7 | function [ samples ] = gaussRandom( mu, sigma, numSamples )
% GAUSSRANDOM Sample a normal distribution with parameters mu and sigma
% Generate random points using a gaussian distribution
if size(sigma,1)==1,
sigma=eye(length(mu))*sigma;
end
samples = mvnrnd(mu,sigma,numSamples);
end
function [r,T... |
github | jordiolivares/visio.artificial-master | ej35.m | .m | visio.artificial-master/images_P3/ej35.m | 1,838 | ibm852 | 3c8d035d618415bd27c410708444776a | function [ output_args ] = ej35( input_args )
%EJ35 Summary of this function goes here
% Detailed explanation goes here
% a)
showMatches('starbucks.jpg', 'starbucks6.jpg');
pause
% b)
% Take elements out if you want to do the experiment for fewer elements
imatges = {'starbucks.jpg', 'starbucks... |
github | jordiolivares/visio.artificial-master | ej31.m | .m | visio.artificial-master/images_P3/ej31.m | 2,461 | utf_8 | a73520adedd4bd5204d530bfe79b295f | function [] = ej31()
%EJ31 Summary of this function goes here
% Detailed explanation goes here
frames = extractBackground('Barcelona.mp4');
video = VideoReader('Barcelona.mp4');
sampleFrame = read(video, 1757);
background = frames(:,:,:,12);
figure
subplot(1,2,1)
imshow(background);
... |
github | jordiolivares/visio.artificial-master | ej32.m | .m | visio.artificial-master/images_P3/ej32.m | 1,115 | utf_8 | d5a23687195d4558e16b74681b460b88 | function [ ] = ej32( )
%%%%%%%%%%%%% (a) %%%%%%%%%%%%%
cloud1 = gaussRandom([1,2], 0.1, 100);
cloud2 = gaussRandom([2,2], 0.1, 100);
cloud3 = gaussRandom([2,1], 0.1, 100);
figure
subplot(2,3,2)
plot(cloud1(:,1), cloud1(:,2), '.', cloud2(:,1), cloud2(:,2), '.', cloud3(:,1), cloud3(:,2)... |
github | jordiolivares/visio.artificial-master | ej13.m | .m | visio.artificial-master/images_P1/ej13.m | 453 | utf_8 | 12b07efedfd40d3c12a88caa9ff7ad49 | function [ output ] = ej13()
car = imread('car_gray.jpg');
car_130 = auxiliar(car, 130);
figure
subplot(2,1,1)
imshow(car)
subplot(2,1,2)
imshow(car_130)
print('subplot_3_binarize.png', '-dpng');
close
end
function [ thresholded_image ] = auxiliar( image, threshold )
... |
github | jordiolivares/visio.artificial-master | ej411.m | .m | visio.artificial-master/images_P4/ej411.m | 435 | iso_8859_13 | 2e7195061f5cb72382168cefae30582b | function [ ] = testFiltros()
% Esta función pretende ilustrar el banco de filtros de la gaussiana
F=makeLMfilters();
% genera los filtros
visualizeFilters(F);
end
function [ ] = visualizeFilters(F)
% This function receives a bank of filters and visualize them by pseudocolors
figure, % visualiza t... |
github | jordiolivares/visio.artificial-master | makeLMfilters.m | .m | visio.artificial-master/images_P4/makeLMfilters.m | 1,896 | utf_8 | 91f2c95201e8f0112ddbc2abd05f854a | function F=makeLMfilters
% Returns the LML filter bank of size 49x49x48 in F. To convolve an
% image I with the filter bank you can either use the matlab function
% conv2, i.e. responses(:,:,i)=conv2(I,F(:,:,i),'valid'), or use the
% Fourier transform.
SUP=49; % Support of the largest filter (must be... |
github | jordiolivares/visio.artificial-master | getFeatures.m | .m | visio.artificial-master/images_P4/getFeatures.m | 517 | utf_8 | 08549ab0fa2be0c5af292e13842a7182 | function [ featuresVector ] = getFeatures( image )
%GETFEATURES Summary of this function goes here
% Detailed explanation goes here
F = makeLMfilters();
greyImage = rgb2gray(image);
featuresVector = zeros(1, size(F, 3));
for i = 1:size(F, 3)
featuresVector(i) = calculateFeature(F(:,:,i), greyI... |
github | vins24/bm_rng-master | degree_2_coef.m | .m | bm_rng-master/matlab/degree_2_coef.m | 1,051 | utf_8 | 76e213bb907ed966541fcc8c4897c1ea |
%
% function to extract coefficients for a degree 2 polyonmial
%
% based on inspiration found in various MATLAB forums
%
function [my_coefs] = degree_2_coef(frac_bits, n, coef)
% n.m (Q notation)
% n = number bits for integer part of your number
% m = fractional bits, for example c1 = 12, c0 = 19 (passs... |
github | vins24/bm_rng-master | dec2twos.m | .m | bm_rng-master/matlab/dec2twos.m | 1,742 | utf_8 | 6fc10b62e47f86606bbcc2e04b51bbdc |
%
% function to convert 2's compliment value to binary
%
% based on inspiration found in various MATLAB forums
%
function t = dec2twos(x, nbits)
% DEC2TWOS Convert decimal integer to binary string two's complement.
%
% Usage: T = DEC2TWOS(X, NBITS)
%
% Converts the signed decimal integer given by X (e... |
github | vins24/bm_rng-master | dec2fix.m | .m | bm_rng-master/matlab/dec2fix.m | 2,256 | utf_8 | ded95370cf4bd96cf395fd4005061167 |
%
% function to convert 2's compliment value to binary
%
% based on inspiration found in various MATLAB forums
%
function f = dec2fix(x, nfracbits, nbits)
% DEC2FIX Convert decimal integer to binary string fixed point.
%
% Usage: F = DEC2FIX(X, NFRACBITS, NBITS)
%
% Converts the signed decimal integer... |
github | vins24/bm_rng-master | lzd.m | .m | bm_rng-master/matlab/lzd.m | 340 | utf_8 | 342769b93194fbd08e5c6d943e64a1f1 | %leading zero detector%
function [num_lzd] = lzd(u0)
num_lzd = 0;
t = u0;
% 0x800000000000
m = uint64(140737488355328);
for n = drange(1:48)
%for (i=0; i<47 ; i++) {
x = bitand(t, m, 'uint64');
if (x)
break;
else
num_lzd = num_lzd + 1;
t = bitshift(t, 1, 'uin... |
github | vins24/bm_rng-master | taus.m | .m | bm_rng-master/matlab/taus.m | 1,166 | utf_8 | 6b9e19d9415b909dae4abfb22c4fe301 |
function [s0, s1, s2, a] = taus(s0, s1, s2)
%a = 0;
x = uint32(0);
%a = (((s0 << 13) ^ s0) >> 19);
x = bitshift(s0, 13, 'uint32');
x= bitxor(x,s0);
x = bitshift(x,-19, 'uint32');
%a = bitshift((bitshift(s0, 13) ^ s0), -19);
%s0 = (((s0 & 0xFFFFFFFE) << 12) ^ a);
%s0 = bitshift(s0 & hex2dec('fffffffe'), 12)... |
github | vins24/bm_rng-master | degree_1_coef.m | .m | bm_rng-master/matlab/degree_1_coef.m | 880 | utf_8 | 7ca917c42bb19b2cbe700b7a246c69b5 |
%
% function to extract coefficients for a degree 1 polyonmial
%
% based on inspiration found in various MATLAB forums
%
function [my_coefs] = degree_1_coef(frac_bits, n, coef)
% n.m (Q notation)
% n = number bits for your number
% m = fractional bits, for example c1 = 12, c0 = 19 (passsed as array in f... |
github | old-NWTC/FAST-master | PlotCertTestResults.m | .m | FAST-master/CertTest/PlotCertTestResults.m | 26,846 | utf_8 | 20415be42ae9440d9e1c9b5acccee429 | function PlotCertTestResults( newPath, oldPath, PlotFAST, PlotAdams, PlotSimulink )
% FAST-ADAMS-Simulink CertTest comparisons:
%function PlotCertTestResults( newPath, oldPath, PlotFAST, PlotAdams, PlotSimulink )
% This function plots the FAST, ADAMS, and/or FAST_SFunc CertTest results,
% comparing .out/.plt, .elm... |
github | kaltwang/2015doubly-master | tprod_testcases.m | .m | 2015doubly-master/code/toolboxes/tprod/tprod_testcases.m | 17,197 | utf_8 | 26b0e1b54b6867e5d62e8956c84e01bd | function []=tprod_testcases(testCases,debugin)
% This file contains lots of test-cases to test the performance of the tprod
% files vs. the matlab built-ins.
%
%
% Copyright 2006- by Jason D.R. Farquhar (jdrf@zepler.org)
% Permission is granted for anyone to copy, use, or modify this
% software and accompanying do... |
github | kaltwang/2015doubly-master | etprod.m | .m | 2015doubly-master/code/toolboxes/tprod/etprod.m | 3,882 | utf_8 | 2f529c6b86be54251a59ae7f9db81d98 | function [C,Atp,Btp]=etprod(Cidx,A,Aidx,B,Bidx)
% tprod wrapper to make calls more similar to Einstein Summation Convention
%
% [C,Atp,Btp]=etprod(Cidx,A,Aidx,B,Bidx);
% Wrapper function for tprod to map between Einstein summation
% convetion (ESC) and tprod's numeric calling convention e.g.
% 1) Matrix Matrix product:... |
github | bryanbeyer/Scour_3D-master | getForce.m | .m | Scour_3D-master/getForce.m | 837 | utf_8 | 90e0c595340dfef15a868406befa1162 | % written by: Stu Blair
% date: Jan 16, 2012
% purpose: get force vector for all solid nodes in an LBM domain
function F = getForce(solidNodes,streamTgtMat,LatticeSpeeds,bb_spd,fIn)
% determine number of solid nodes
numSolidNodes=length(solidNodes);
%deterimne number of dimensions
[numDim,numSpd]=size(LatticeSpeeds)... |
github | bryanbeyer/Scour_3D-master | D2Q9_lattice_parameters.m | .m | Scour_3D-master/D2Q9_lattice_parameters.m | 227 | utf_8 | bddb7b96f31f4a63bcc5296912d9fed3 | %
function [w, ex, ey,bb_spd] = D2Q9_lattice_parameters()
w = [4/9, 1/9, 1/9, 1/9, 1/9, 1/36, 1/36, 1/36, 1/36];
ex = [0, 1, 0, -1, 0, 1, -1, -1, 1];
ey = [0, 0, 1, 0, -1, 1, 1, -1, -1];
bb_spd = [1, 4, 5, 2, 3, 8, 9, 6, 7]; |
github | bryanbeyer/Scour_3D-master | RecMesh.m | .m | Scour_3D-master/RecMesh.m | 2,177 | utf_8 | 89522f9e5af20eb01c2d3e8572b58e49 | % function [GCOORD,NODES,BOUNDARIES]= RecMesh(x_left,x_right,y_bottom,y_top,Nx,Ny)
%
% Written by: Stu Blair
% Date: 2/9/2010
% Purpose: provide mesh definition data structures for a structured,
% uniform rectangular mesh to be used with ME 4612 final project
function [GCOORD,NODES,BOUNDARIES] = RecMesh(x_left,... |
github | bryanbeyer/Scour_3D-master | SetInletMacroscopicBCPoiss.m | .m | Scour_3D-master/SetInletMacroscopicBCPoiss.m | 526 | utf_8 | 5d29f4bdb2ab505f5a90c5e46ef420ea | % appropriate for D2Q9 grids only
function [ux,uy,rho]=SetInletMacroscopicBCPoiss(ux,uy,rho,fIn,u_bc,b,...
gcoord,inlet_node_list)
% set macroscopic inlet boundary conditions
ux(inlet_node_list) = (u_bc)*(1-((gcoord(inlet_node_list,2)-b).^2)./(b*b));
uy(inlet_node_list) = 0;
rho(inlet_node_list) = 1.... |
github | google/gps-measurement-tools-master | Utc2Gps.m | .m | gps-measurement-tools-master/opensource/Utc2Gps.m | 3,937 | utf_8 | 0593bea672dfa8778026636946dd5424 | function [gpsTime,fctSeconds] = Utc2Gps(utcTime)
% [gpsTime,fctSeconds] = Utc2Gps(utcTime)
% Convert the UTC date and time to GPS week & seconds
%
% Inputs:
% utcTime: [mx6] matrix
% utcTime(i,:) = [year,month,day,hours,minutes,seconds]
% year must be specified using four digits, e.g. 1994
% yea... |
github | google/gps-measurement-tools-master | WlsPvt.m | .m | gps-measurement-tools-master/opensource/WlsPvt.m | 6,430 | utf_8 | 0ccc707de9a099046e5ba3aaaf56badd | function [xHat,z,svPos,H,Wpr,Wrr] = WlsPvt(prs,gpsEph,xo)
% [xHat,z,svPos,H,Wpr,Wrr] = WlsPvt(prs,gpsEph,xo)
% calculate a weighted least squares PVT solution, xHat
% given pseudoranges, pr rates, and initial state
%
% Inputs:
% prs: matrix of raw pseudoranges, and pr rates, each row of the form:
% [trxWeek,trxSecon... |
github | google/gps-measurement-tools-master | Gps2Utc.m | .m | gps-measurement-tools-master/opensource/Gps2Utc.m | 5,737 | utf_8 | 32fa6bc33bc0de2d2058510f5773395b | function [utcTime] = Gps2Utc(gpsTime,fctSeconds)
% [utcTime] = Gps2Utc(gpsTime,[fctSeconds])
% Convert GPS time (week & seconds), or Full Cycle Time (seconds) to UTC
%
% Input: gpsTime, [mx2] matrix [gpsWeek, gpsSeconds],
% fctSeconds, [optional] Full Cycle Time (seconds)
%
% Outputs: utcTime, [mx6] m... |
github | google/gps-measurement-tools-master | ReadGnssLogger.m | .m | gps-measurement-tools-master/opensource/ReadGnssLogger.m | 16,712 | utf_8 | 20ec3397745d7b547f780418f11c351c | function [gnssRaw,gnssAnalysis] = ReadGnssLogger(dirName,fileName,dataFilter,gnssAnalysis)
%% [gnssRaw,gnssAnalysis]=ReadGnssLogger(dirName,fileName,[dataFilter],[gnssAnalysis]);
% Read the log file created by Gnss Logger App in Android
% Compatible with Android release N
%
% Input:
% dirName = string with directory ... |
github | google/gps-measurement-tools-master | ReadRinexNav.m | .m | gps-measurement-tools-master/opensource/ReadRinexNav.m | 9,684 | utf_8 | 61ac6db7bc356768f15c9f03a38f590c | function [gpsEph,iono] = ReadRinexNav(fileName)
% [gpsEph,iono] = ReadRinexNav(fileName)
%
% Read GPS ephemeris and iono data from an ASCII formatted RINEX 2.10 Nav file.
% Input:
% fileName - string containing name of RINEX formatted navigation data file
% Output:
% gpsEph: vector of ephemeris data, each ele... |
github | google/gps-measurement-tools-master | ProcessGnssMeas.m | .m | gps-measurement-tools-master/opensource/ProcessGnssMeas.m | 10,037 | utf_8 | bb97c6b42797c809f0db07298501eeda | function gnssMeas = ProcessGnssMeas(gnssRaw)
% gnssMeas = ProcessGnssMeas(gnssRaw)
% Process raw measurements read from ReadGnssLogger
% Using technique explained in "Raw GNSS Measurements from Android" tutorial
%
% Input: gnssRaw, output from ReadGnssLogger
% Output: gnssMeas structure formatted conveniently for batch... |
github | google/gps-measurement-tools-master | GetNasaHourlyEphemeris.m | .m | gps-measurement-tools-master/opensource/GetNasaHourlyEphemeris.m | 7,264 | utf_8 | 269885253c5a185948a02dab5d5de302 | function [allGpsEph,allGloEph] = GetNasaHourlyEphemeris(utcTime,dirName)
%[allGpsEph,allGloEph] = GetNasaHourlyEphemeris(utcTime,dirName)
%Get hourly ephemeris files,
% If a GPS ephemeris file is in dirName, with valid ephemeris for at
% least 24 svs, then read it; else download from NASA's archive of
% Space Geodesy... |
github | google/gps-measurement-tools-master | ReadNmeaFile.m | .m | gps-measurement-tools-master/NmeaUtils/ReadNmeaFile.m | 9,958 | utf_8 | 9a68e0e553a19e83a81a59402d4b90df | function [nmea,Msg] = ReadNmeaFile(dirName,fileName,Msg)
% [nmea,Msg] = ReadNmeaFile(dirName,fileName,[Msg]);
%
% Reads GGA and RMC data from a NMEA file.
% This function recognizes GGA data with quality of
% GPS fix (1)/RTK(4)/Float RTK(5)/Manual input(7) only.
% Output:
% nmea: structure array with one element per ... |
github | hanshuting/graph_ensemble-master | vec.m | .m | graph_ensemble-master/src/vec.m | 1,567 | utf_8 | f3fc35a93c8a5b99b592835a0b810dd5 | % Y = VEC(x) Given an m x n matrix x, this produces the vector Y of length
% m*n that contains the columns of the matrix x, stacked below each other.
%
% See also mat.
function x = vec(X)
%
% This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko
% Copyright (C) 2005 McMaster University, Hamilton, CAN... |
github | hanshuting/graph_ensemble-master | anneal.m | .m | graph_ensemble-master/src/util/anneal.m | 8,126 | utf_8 | a2fc8f6d4866e3078bce3e438d38a6ea | function [minimum,fval] = anneal(loss, parent, options)
% ANNEAL Minimizes a function with the method of simulated annealing
% (Kirkpatrick et al., 1983)
%
% ANNEAL takes three input parameters, in this order:
%
% LOSS is a function handle (anonymous function or inline) with a loss
% function, which may be of any t... |
github | hanshuting/graph_ensemble-master | graphProperties.m | .m | graph_ensemble-master/src/util/graphProperties.m | 4,236 | utf_8 | 85256a2e4937e41679ec818c7a9c2068 | function [ L, EGlob, CClosed, ELocClosed, COpen, ELocOpen ] = graphProperties( varargin )
% graphProperties: compute properties of a graph from its adjacency matrix
% usage: [L,EGlob,CClosed,ELocClosed,COpen,ELocOpen] = graphProperties(A);
%
% arguments:
% A (nxn) - adjacency matrix of a graph G
%
% L (scalar) - c... |
github | hanshuting/graph_ensemble-master | makeShuffledData.m | .m | graph_ensemble-master/src/graphs/makeShuffledData.m | 1,065 | utf_8 | 001f9896d283081f75d86871214c70ad |
function [] = makeShuffledData(param)
expt_name = param.expt_name;
ee = param.ee;
num_shuff = param.num_shuff;
data_path = param.data_path;
shuff_path_base = param.shuff_path_base;
% make shuffled data
for n = 1:length(expt_name)
expt_ee = ee{n};
load([data_path expt_name{n} '\' expt_name{n} '.mat']);
... |
github | hanshuting/graph_ensemble-master | makeCCgraph.m | .m | graph_ensemble-master/src/graphs/makeCCgraph.m | 1,833 | utf_8 | b4f28b4118e500e6b4d12c424dbcbe27 |
function [] = makeCCgraph(param)
expt_name = param.expt_name;
ee = param.ee;
num_shuff = param.num_shuff;
data_path = param.data_path;
shuff_path_base = param.shuff_path_base;
p = param.p;
% make xcorr graph
for n = 1:length(expt_name)
expt_ee = ee{n};
load([data_path expt_name{n} '\' expt_name{n} '.mat... |
github | hanshuting/graph_ensemble-master | getEdgeId.m | .m | graph_ensemble-master/src/paramter_estimation/getEdgeId.m | 488 | utf_8 | 1796dddb717073f46cbb8ed01d2680eb | % Given the edge indices, return its id in Vt
% The edges in Vt are ordered in increasing order of
% for edges (i,j) such that i < j
% e.g. for graph with 6 nodes (1,2),(1,3), .... ,(3,6),(4,5),(4,6),(5,6)
function id = getEdgeId(N,edge)
E = size(edge,1);
id = zeros(E,1);
for e=1:E
i = edge(e,1... |
github | hanshuting/graph_ensemble-master | lasso_node_by_node.m | .m | graph_ensemble-master/src/loopy_model/structure_learning/lasso_node_by_node.m | 2,865 | utf_8 | 41ca9c74c1fc182736cd2a9f895fee26 | % LASSO_NODE_BY_NODE Tries to predict one variable as a function of another
% and return lasso coefficients in a matrix, where each row refers to a
% lasso logistic regression and each column a coefficient.
%
% Input
% samples: logical matrix where each row is a sample and each column a node
% relative_lambda: rela... |
github | hanshuting/graph_ensemble-master | lasso_node_by_node_parallel.m | .m | graph_ensemble-master/src/loopy_model/structure_learning/lasso_node_by_node_parallel.m | 3,218 | utf_8 | e0267c6e0324844b22866ba9591c73e1 | % WORKS ONLY IF PARALLEL COMPUTING TOLLBOX IS INSTALLED
%
% LASSO_NODE_BY_NODE Tries to predict one variable as a function of another
% and return lasso coefficients in a matrix, where each row refers to a
% lasso logistic regression and each column a coefficient.
%
% Input
% samples: logical matrix where each row is... |
github | hanshuting/graph_ensemble-master | learn_structures_by_density.m | .m | graph_ensemble-master/src/loopy_model/structure_learning/learn_structures_by_density.m | 5,481 | utf_8 | aaef90286007e048e8a9fe7cba04ae25 | % LEARN_STRUCTURES_BY_DENSITY
%
% Input
% samples: logical matrix where each row is a sample and each column a node
% relative_lambda: relative regularization factor (relative to the lambda
% that drives all coefficients to zero.
% densities: vector of densities to be tried.
% option variable_groups: arra... |
github | hanshuting/graph_ensemble-master | run.m | .m | graph_ensemble-master/src/expt_framework/run.m | 9,683 | utf_8 | 5e21d0fbfd12a7c34828364e728cb642 | %% Experiment: Parameter Estimation for Real data
% Description:
% - Learn multiple structures with various regularizers (lambda) and
% tolerance values
% - Train the parameters with respect to each of the structure learned
% in the previous step with various values of parameter estimation
% regula... |
github | hanshuting/graph_ensemble-master | infer_structure.m | .m | graph_ensemble-master/src/structure_learning/infer_structure/infer_structure.m | 6,225 | utf_8 | f7f75dfecc3e22ffb7e95247341bd512 | % INFER_STRUCTURE Infers the structure of MRF of binary variables based on samples
%
% Input
% samples: logical matrix where each row is a sample and each column a node
% lambda: regularization factor
% options:
% 'graph_build_method': ['and', 'or', 'average', 'raw']. How to conciliate
% the fact... |
github | hanshuting/graph_ensemble-master | simple_infer_structure.m | .m | graph_ensemble-master/src/structure_learning/simple_infer_structure/simple_infer_structure.m | 2,383 | utf_8 | b80d3b54863048cad93e5bd158ee3730 | % SIMPLE_INFER_STRUCTURE Infers the structure of MRF of binary variables based on samples
% This is a cleaned up version of the INFER_STRUCTURE function, holding
% only options that matter most.
%
% Besides that, this model return graph for multiple thresholds without
% repeating the lasso regression.
%
% Input
% ... |
github | hanshuting/graph_ensemble-master | infer_structures_with_given_densities.m | .m | graph_ensemble-master/src/structure_learning/simple_infer_structure/infer_structures_with_given_densities.m | 3,368 | utf_8 | 2d5f3acec6c44a1c2da18589aa93b321 | % SIMPLE_INFER_STRUCTURE Infers the structure of MRF of binary variables based on samples
% This is a cleaned up version of the INFER_STRUCTURE function, holding
% only options that matter most.
%
% Besides that, this model return graph for multiple thresholds without
% repeating the lasso regression.
%
% Input
% ... |
github | hanshuting/graph_ensemble-master | lasso_node_by_node_old.m | .m | graph_ensemble-master/src/structure_learning/simple_infer_structure/lasso_node_by_node_old.m | 2,786 | utf_8 | dd66948eed4f923240712e0ca1e02d9c | % LASSO_NODE_BY_NODE Tries to predict one variable as a function of another
% and return lasso coefficients in a matrix, where each row refers to a
% lasso logistic regression and each column a coefficient.
%
% Input
% samples: logical matrix where each row is a sample and each column a node
% relative_lambda: rela... |
github | xijunlee/Undergraduate-Thesis-Project-master | cheegerpartition.m | .m | Undergraduate-Thesis-Project-master/new_algorithm(lxl)/CodeLSA/helper_functions/cheegerpartition.m | 548 | utf_8 | 8e15bda04a98bfb56b6f04e376ed64c4 | %evaluates the cheeger constant for a given partition
function h=cheegerpartition(group,simMat);
d=sum(simMat,2); %grade of each node (sum of distances on the row)
[IcutA,IcutB]=meshgrid(group-1,2-group); %bool that indicates if a group is connected to A and/or B
IcutAB=and(IcutA,IcutB); ... |
github | xijunlee/Undergraduate-Thesis-Project-master | evaluatenormalcut.m | .m | Undergraduate-Thesis-Project-master/new_algorithm(lxl)/CodeLSA/helper_functions/evaluatenormalcut.m | 889 | utf_8 | ca9fd58a1d309f136b115628b7ca3ca5 | %evaluates the normal cut function
% group is a vector of zeros and ones that indicates the two partitions
% simMat is the similarity matrix
function cost=evaluatenormalcut(group,simMat);
d=sum(simMat,2); %grade of each node (sum of distances on the row)
assocA=sum(d(find(grou... |
github | xijunlee/Undergraduate-Thesis-Project-master | spectralcluster.m | .m | Undergraduate-Thesis-Project-master/new_algorithm(lxl)/CodeLSA/helper_functions/spectralcluster.m | 765 | utf_8 | bb76077d06ddfb666bba7353094f70c1 | % affmat is the affinity matrix A
% k is the number of largest eigenvectors in matrix L
% num_class is the number of classes
%diagmat is the diagonal matrix D^(-0.5)
% Lmat is the matrix L
%X and Y ar matrices formed from eigenvectors of L
% IDX is the clustering results
% errorsum is the distance from kmeans
functio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.