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 | bsxfan/meta-embeddings-master | read_hdf5.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Key/read_hdf5.m | 1,196 | utf_8 | 4057278a996259de22fed6ee29c5d3b2 | function key = read_hdf5(infilename)
% Reads a Key object from an hdf5 file.
% Inputs:
% infilename: The name for the hdf5 file to read.
% Outputs:
% key: A Key object created from the information in the hdf5
% file.
assert(nargin==1)
assert(isa(infilename,'char'))
key = Key();
key.modelset = h5strings_to_ce... |
github | bsxfan/meta-embeddings-master | filter.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Ndx/filter.m | 2,788 | utf_8 | 6d39760ecafc786f43259d1adb98a810 | function outndx = filter(inndx,modlist,seglist,keep)
% Removes some of the information in an Ndx. Useful for creating a
% gender specific Ndx from a pooled gender Ndx. Depending on the
% value of 'keep', the two input lists indicate the strings to
% retain or the strings to discard.
% Inputs:
% inndx: An Ndx object... |
github | bsxfan/meta-embeddings-master | read_hdf5.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Ndx/read_hdf5.m | 838 | utf_8 | 424ae971c22eb22cf8c27af6130b9698 | function ndx = read_hdf5(infilename)
% Creates an Ndx object from the information in an hdf5 file.
% Inputs:
% infilename: The name of the hdf5 file contain the information
% necessary to construct an Ndx object.
% Outputs:
% ndx: An Ndx object containing the information in the input
% file.
assert(nargin=... |
github | bsxfan/meta-embeddings-master | filter_on_right.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Id_Map/filter_on_right.m | 1,885 | utf_8 | deb124220c828ae065475bc93957d53f | function out_idmap = filter_on_right(in_idmap,idlist,keep)
% Removes some of the information in an idmap. Depending on the
% value of 'keep', the idlist indicates the strings to retain or
% the strings to discard.
% Inputs:
% in_idmap: An Id_Map object to be pruned.
% idlist: A cell array of strings which will be ... |
github | bsxfan/meta-embeddings-master | read_hdf5.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Id_Map/read_hdf5.m | 777 | utf_8 | 47581f23817e49ffc325aed95a088106 | function idmap = read_hdf5(infilename)
% Creates an Id_Map object from the information in an hdf5 file.
% Inputs:
% infilename: The name of the hdf5 file containing the information
% necessary to construct an Id_Map object.
% Outputs:
% idmap: An Id_Map object containing the information in the input
% file.... |
github | bsxfan/meta-embeddings-master | filter_on_left.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/bosaris_toolkit/classes/@Id_Map/filter_on_left.m | 1,871 | utf_8 | 27abe0c92b6ff488892e389fee1fb5e9 | function out_idmap = filter_on_left(in_idmap,idlist,keep)
% Removes some of the information in an idmap. Depending on the
% value of 'keep', the idlist indicates the strings to retain or
% the strings to discard.
% Inputs:
% in_idmap: An Id_Map object to be pruned.
% idlist: A cell array of strings which will be c... |
github | bsxfan/meta-embeddings-master | L_BFGS.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/optimization/L_BFGS.m | 5,021 | utf_8 | ccfcc8e580c4dfa191a42bfcbaf055cb | function [w,y,mem,logs] = L_BFGS(obj,w,maxiters,timeout,mem,stpsz0,callback)
% L-BFGS Quasi-Newton unconstrained optimizer.
% -- This has a small interface change from LBFGS.m --
%
% Inputs:
% obj: optimization objective, with interface: [y,grad] = obj(w),
% where w is the parameter vector, y is the scalar o... |
github | bsxfan/meta-embeddings-master | create_PYCRP.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/CRP/create_PYCRP.m | 10,787 | utf_8 | 482772d72ab94176d598b555bd28ec19 | function PYCRP = create_PYCRP(alpha,beta,e,n)
% alpha: alpha>=0, concentration
% beta: 0<= beta <=1, discount
if nargin==0
%test_this2();
test_Gibbsmatrix()
return;
end
if nargin==4
PYCRP = create_PYCRP(1,0);
PYCRP.set_expected_number_tables(e,n,alpha,be... |
github | bsxfan/meta-embeddings-master | rand_fake_Dirichlet.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/language_recognition/synth_data/rand_fake_Dirichlet.m | 810 | utf_8 | 3070cfe2d8487d8ae48c7740fdc24c2d | function R = rand_fake_Dirichlet(alpha,m,n)
% This is no longer Dirichlet. I replaced it with a faster ad-hoc
% distribution.
%
% Generates m-by-n matrix of n samples from m-category Dirichlet, with
% concentration parameter: alpha > 0.
if nargin==0
test_this();
return;
end
%R = reshape(ra... |
github | bsxfan/meta-embeddings-master | create_T_backend.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/language_recognition/T_backend/create_T_backend.m | 6,482 | utf_8 | ee013ab7facb848049ba586dfb7b6f33 | function TBE = create_T_backend(nu,dim,K)
% Create a (multivariate) T-distribution generative backend for multiclass classification.
% The classes have different means, but the scatter matrix and degrees of
% freedom are common to all clases.
%
% This object provides a method for supervised ML training (EM algorithm),
... |
github | bsxfan/meta-embeddings-master | train_TLDIvector.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/language_recognition/TLDIvector/train_TLDIvector.m | 4,374 | utf_8 | 6029b83917586ea3e2977c8fad616093 | function [W,Mu,TT] = train_TLDIvector(stats_or_ivectors,N,T,TT,nu,labels,niters,W,Mu)
% Inputs:
% stats_or_ivectors: can be either F, or ivectors
% F: dm-by-n first-order stats (m: UBM size; d: feature dim; n: no segments)
% ivectors: k-by-n, classical i-vector point-estimates
% N: m-by-n zero order st... |
github | bsxfan/meta-embeddings-master | create_diagonalized_C.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/language_recognition/TLDIvector/create_diagonalized_C.m | 4,986 | utf_8 | c1a642f817fa817097bf89b070af4c04 | function C = create_diagonalized_C(B,R,RM,Ra,W,M,a)
% Creates object to represent: C = inv(lambda W + B),
%
% Inputs:
% B: positive definite matrix (i-vector dimension)
% R: chol(W), so that R'R=W (i-vector dimension)
% RM: R*M, where M has language means in columns
% Ra: (R')\a, vector (i-vector dime... |
github | bsxfan/meta-embeddings-master | create_augmenting_backend.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/language_recognition/augmentation/create_augmenting_backend.m | 3,599 | utf_8 | 852abc76e3f7dfa8796f7015880bc788 | function ABE = create_augmenting_backend(nu,dim,T,K,L)
% Inputs:
% nu: scalar nu>0, t-distribution degrees of freedom
% dim: ivector dimension
% T: i-vector extr\zctor T-matrix
% K: UBM size
% L: number of languages
if nargin==0
test_this();
return;
end
assert(dim==size(T,2));
... |
github | bsxfan/meta-embeddings-master | testBackprop_rs.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/test/testBackprop_rs.m | 2,198 | utf_8 | 9d88acaf06002d97bf8eb2fdc07bf7b8 | function total = testBackprop_rs(block,X,delta,mask)
%same as testFBblock, but with real step
if ~iscell(X)
X = {X};
end
dX = cellrndn(X);
if exist('mask','var')
assert(length(mask)==length(X));
dX = cellmask(dX,mask);
end
cX1 = cellstep(X,dX,delta);
cX2 = cell... |
github | bsxfan/meta-embeddings-master | testBackprop_multi.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/test/testBackprop_multi.m | 2,361 | utf_8 | ced4a5b7e925d5c00a2d991fb34d012c | function total = testBackprop_multi(block,nout,X,mask)
% same as testBackprop, but handles multiple outputs
if ~iscell(X)
X = {X};
end
dX = cellrndn(X);
if exist('mask','var')
assert(length(mask)==length(X));
dX = cellmask(dX,mask);
end
cX = cellcomplex(X,dX);
D... |
github | bsxfan/meta-embeddings-master | testBackprop.m | .m | meta-embeddings-master/code/snapshot_for_anya/matlab/test/testBackprop.m | 2,015 | utf_8 | fc73fa404f5441c097eb63f249106078 | function total = testBackprop(block,X,mask)
if ~iscell(X)
X = {X};
end
dX = cellrndn(X);
if exist('mask','var')
assert(length(mask)==length(X));
dX = cellmask(dX,mask);
end
cX = cellcomplex(X,dX);
DX = cell(size(X));
[Y,back] = block(X{:});
... |
github | bsxfan/meta-embeddings-master | create_truncGMM.m | .m | meta-embeddings-master/code/Niko/matlab/stochastic_clustering/create_truncGMM.m | 11,422 | utf_8 | 9bf418136c7994e16d5fb77486fd9bac | function model = create_truncGMM(W,F,alpha,m)
% This is a truncated version of DP micture model, with a specified maximum number of
% components. The observations are realted to the hidden cluster variables
% like in an SPLDA model. The hidden variable for cluster i is z_i in R^d.
% The observations, x_j are in R^D, wh... |
github | bsxfan/meta-embeddings-master | randg.m | .m | meta-embeddings-master/code/Niko/matlab/stochastic_clustering/randg.m | 2,448 | utf_8 | bf1edfa92d41e108e3e1e2ef55461799 | function G = randg(alpha,m,n)
% Generates an m-by-n matrix of random gamma variates, having scale = 1
% and shape alpha.
% Inputs:
% alpha: scalar, vector or matrix
% m,n: [optional] size of output matrix. If not given, the size is the
% same as that of alpha. If given, then alpha should be m-by-n, or an
% m... |
github | bsxfan/meta-embeddings-master | asEig_svd.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/asEig_svd.m | 2,468 | utf_8 | 9b7e0b63ebc89c1d50847ba58f54e7d1 | function CA = asEig_svd(A)
if nargin==0
test_this();
return;
end
if isreal(A)
[V,D] = eig(A); %V*D*V' = A
D = diag(D);
r = true;
else
[U,S,V] = svd(A); % U*S*V' = A
S = diag(S);
r = false;
end
dim = size(A,1);
CA.l... |
github | bsxfan/meta-embeddings-master | SGME_MXE.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_MXE.m | 2,114 | utf_8 | 829ff4b78c816bad28ac1dd5db3afbb8 | function [y,back] = SGME_MXE(A,B,D,As,Bs,labels,logPrior)
if nargin==0
test_this();
return;
end
dA = zeros(size(A));
dB = zeros(size(B));
dD = zeros(size(D));
dAs = zeros(size(As));
dBs = zeros(size(Bs));
[LEc,back1] = SGME_logexpectation(A,B,D);
[LEs,ba... |
github | bsxfan/meta-embeddings-master | SGME_train.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_train.m | 2,349 | utf_8 | 875c864d98e47717be58a0d88a2550ab | function model = SGME_train(R,labels,nu,zdim,niters,test)
if nargin==0
test_this();
return;
end
[rdim,n] = size(R);
m = max(labels);
blocks = sparse(labels,1:n,true,m+1,n);
num = find(blocks(:));
%Can we choose maximum likelihood prior parameters, given labels... |
github | bsxfan/meta-embeddings-master | scaled_GME_precision.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/scaled_GME_precision.m | 2,566 | utf_8 | 59c037444c1e57e933d5346bc36263b6 | function [SGMEP,meand] = scaled_GME_precision(B)
if nargin==0
test_this();
return;
end
dim = size(B,1);
[V,D] = eig(B); % B = VDV'
d = diag(D);
meand = mean(d);
%D = sparse(D);
%I = speye(dim);
SGMEP.logdet = @logdet;
SGMEP.solve = @solve;
functi... |
github | bsxfan/meta-embeddings-master | dsolve.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/dsolve.m | 980 | utf_8 | 8734dea4d3f28af88579fef7b106d892 | function [Y,back] = dsolve(RHS,A)
% SOLVE: Y= A\RHS, with backpropagation into both arguments
%
% This is mostly for debugging purposes. It can be done more efficiently
% by caching a matrix factorization to re-use for derivative (and also for
% the determinant if needed).
if nargin==0
test_this();
... |
github | bsxfan/meta-embeddings-master | tme.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/tme.m | 421 | utf_8 | 337d862122de581dbec9c54a23086f6d | function y = tme(z,mu,W,nu)
if nargin==0
test_this();
return;
end
Delta = bsxfun(@minus,z,mu);
q = sum(Delta.*(W*Delta),1);
dim = length(mu);
y = -(nu+dim)/2 * log1p(q/nu);
end
function test_this()
dim = 1;
W = 1;
z = -10:0.01:10;
mu1 = -5;
mu2 = 5;
nu = 1;
... |
github | bsxfan/meta-embeddings-master | SGME_logexpectation_full.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_logexpectation_full.m | 2,084 | utf_8 | 77d3c0866095ed94d4c7340697b2a714 | function [y,back] = SGME_logexpectation_full(A,b,B)
% log expected values (w.r.t. standard normal) of diagonalized SGMEs
% Inputs:
% A: dim-by-n, natural parameters (precision *mean) for n SGMEs
% b: 1-by-n, precision scale factors for these SGMEs
% B: dim-by-dim, common precision (full) matrix factor
%
%... |
github | bsxfan/meta-embeddings-master | labels2blocks.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/labels2blocks.m | 1,061 | utf_8 | fea6d1fe91a39552e2a103155fe96e8f | function [subsets,counts] = labels2blocks(labels)
% Inputs:
% labels: n-vector with elements in 1..m, maps each of n customers to a
% table number. There are m tables. Empty tables not allowed.
%
% Ouputs:
% subsets: n-by-m logical, with one-hot rows
% counts: m-vector, maps table number to customer co... |
github | bsxfan/meta-embeddings-master | create_BXE_calculator.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/create_BXE_calculator.m | 2,055 | utf_8 | 494fcd9ff939f75d131309b403080ae5 | function calc = create_BXE_calculator(log_expectations,prior,poi)
calc.BXE = @BXE;
calc.get_tar_non = @get_tar_non;
n = length(poi);
spoi = sparse(poi);
tar = bsxfun(@eq,spoi,spoi.');
ntar = 0;
nnon = 0;
for k=1:n-1
jj = k+1:n;
tari = full(tar(k,jj));
ntari = s... |
github | bsxfan/meta-embeddings-master | PLDA_mixture_responsibilities.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/PLDA_mixture_responsibilities.m | 1,346 | utf_8 | 78dfbb4de92f575f08845cbc7e0010fb | function P = PLDA_mixture_responsibilities(w,F,W,R)
if nargin==0
P = test_this();
return
end
K = length(w);
if iscell(F)
[D,d] = size(F{1});
else
[D,d] = size(F);
end
N = size(R,2);
P = zeros(K,N);
Id = eye(d);
for k=1:K
if is... |
github | bsxfan/meta-embeddings-master | create_partition_posterior_calculator.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/create_partition_posterior_calculator.m | 4,076 | utf_8 | 32fda68f00bdccc246e56e3db2e0babe | function calc = create_partition_posterior_calculator(log_expectations,prior,poi)
% Inputs:
% log_expectations: function handle, maps matrices of additive natural
% parameters to log-expectations
% prior: Exchangeable prior over partitions, for example CRP. It needs to
% implement prio... |
github | bsxfan/meta-embeddings-master | SGME_logexpectation_slow.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_logexpectation_slow.m | 1,686 | utf_8 | 798c0acef9f8a32f4f544ceed9ce0373 | function [y,back] = SGME_logexpectation_slow(A,b,B)
% log expected values (w.r.t. standard normal) of diagonalized SGMEs
% Inputs:
% A: dim-by-n, natural parameters (precision *mean) for n SGMEs
% b: 1-by-n, precision scale factors for these SGMEs
% B: dim-by-dim, common precision (full) matrix factor
%
%... |
github | bsxfan/meta-embeddings-master | sampleARG.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/sampleARG.m | 1,140 | utf_8 | 4246b530bc1f2bc4fd550c3aa048a900 | function Z = sampleARG(a,B,n,X)
if nargin==0
test_this();
return;
end
dim = length(a);
if ~exist('X','var') || isempty(X)
X = randn(dim,n);
end
diagB = diag(B);
mu = a./diagB;
Z = bsxfun(@plus,mu,bsxfun(@rdivide,X,sqrt(diagB)));
B0 = bsx... |
github | bsxfan/meta-embeddings-master | SGME_train_BXE.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_train_BXE.m | 2,434 | utf_8 | 4fb4ed77b580dc09d69346bc07a2cd16 | function model = SGME_train_BXE(R,labels,nu,zdim,niters,timeout,test)
if nargin==0
test_this();
return;
end
[rdim,n] = size(R);
spoi = sparse(labels);
tar = bsxfun(@eq,spoi,spoi.');
ntar = 0;
nnon = 0;
for k=1:n-1
jj = k+1:n;
tari = full(tar(k,jj));
... |
github | bsxfan/meta-embeddings-master | SGME_F2G.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_F2G.m | 969 | utf_8 | e77bb8ead4c56cabb8bda3a5a1e59081 | function [G,reg,back] = SGME_F2G(F)
if nargin==0
test_this();
return;
end
B0 = F.'*F;
D = diag(B0);
end
function [y,back] = regGG(G)
dim = size(G,1);
Delta = G*G-G;
[y,back1] = regL2(Delta);
back = @back_this;
function [dG] = back_this(dy)... |
github | bsxfan/meta-embeddings-master | SGME_extr.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_extr.m | 3,822 | utf_8 | b9fd252ce11aa8487b51f175440693a3 | function [A,b,d,reg,back] = SGME_extr(T,F,H,nu,R)
if nargin==0
test_this();
return;
end
[rdim,zdim] = size(F);
nuprime = nu + rdim - zdim;
TR = T*R;
A0 = F.'*TR;
B0 = F.'*F;
d = diag(B0);
%G = speye(rdim) - F*bsxfun(@ldivide,d,F.');
%HH... |
github | bsxfan/meta-embeddings-master | SGME_extract.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_extract.m | 1,065 | utf_8 | b9106e80e9a78235222680c566b510fd | function [A,b,back] = SGME_extract(P,H,nu,R)
if nargin==0
test_this();
return;
end
[zdim,rdim] = size(P);
nuprime = nu + rdim - zdim;
HR = H*R;
q = sum(HR.^2,1);
den = nu + q;
b = nuprime./den;
M = P*R;
A = bsxfun(@times,b,M);
back = @back_this;
... |
github | bsxfan/meta-embeddings-master | SGME_extr_full.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_extr_full.m | 1,736 | utf_8 | a9fbe07b13ba1fd948fdfdfc334f7d48 | function [A,b,B0,back] = SGME_extr_full(T,F,nu,R)
if nargin==0
test_this();
return;
end
[rdim,zdim] = size(F);
nuprime = nu + rdim - zdim;
TR = T*R;
A0 = F.'*TR;
B0 = F.'*F;
if isreal(F)
cholB0 = chol(B0);
solveB = @(A) cho... |
github | bsxfan/meta-embeddings-master | sumlogsumexp.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/sumlogsumexp.m | 455 | utf_8 | cccd5f3ae0b7894b95682910eba4a060 | function [y,back] = sumlogsumexp(X)
if nargin==0
test_this();
return;
end
mx = max(real(X),[],1);
yy = mx + log(sum(exp(bsxfun(@minus,X,mx)),1));
y = sum(yy,2);
back = @back_this;
function dX = back_this(dy)
dX = dy*exp(bsxfun(@minus,X,yy));
... |
github | bsxfan/meta-embeddings-master | SGME_logexpectation.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_logexpectation.m | 1,902 | utf_8 | 81c7aa33f6446ddaf811422fbffe00d6 | function [y,back] = SGME_logexpectation(A,b,d)
% log expected values (w.r.t. standard normal) of diagonalized SGMEs
% Inputs:
% A: dim-by-n, natural parameters (precision *mean) for n SGMEs
% b: 1-by-n, precision scale factors for these SGMEs
% d: dim-by-1, common diagonal precision
%
% Note:
% bsxfun(... |
github | bsxfan/meta-embeddings-master | SGME_train_MXE.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_train_MXE.m | 2,514 | utf_8 | 939eef34cb61a4493dfe9c98a11d633c | function model = SGME_train_MXE(R,labels,nu,zdim,niters,timeout,test)
if nargin==0
test_this();
return;
end
[rdim,n] = size(R);
m = max(labels);
blocks = sparse(labels,1:n,true,m,n);
counts = sum(blocks,2);
logPrior = [log(counts);-inf];
delta = rdim... |
github | bsxfan/meta-embeddings-master | SGME_BXE.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_BXE.m | 1,927 | utf_8 | 43f8a07c46e1df00ef02abdfbbc38dde | function [y,back] = SGME_BXE(A,B,D,plo,wt,wn,tar)
if nargin==0
test_this();
return;
end
n = size(A,2);
[LEc,back1] = SGME_logexpectation(A,B,D);
y = 0;
dA = zeros(size(A));
dB = zeros(size(B));
dLEc = zeros(size(LEc));
dD = zeros(size(D));
for i=1:n-1
... |
github | bsxfan/meta-embeddings-master | plotGaussian.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/plotGaussian.m | 1,323 | utf_8 | 16ea9cd804af31a79f3ccd3cf5687a49 | function tikz = plotGaussian(mu,C,colr,c)
if nargin==0
test_this();
return;
end
if isempty(C) %assume mu is a GME
[mu,C] = mu.get_mu_cov();
end
[V,D] = eig(C);
v1 = V(:,1);
v2 = V(:,2);
if all(v1>=0)
r1 = sqrt(D(1,1));
r2 = sqrt(D(... |
github | bsxfan/meta-embeddings-master | create_HTPLDA_extractor.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/create_HTPLDA_extractor.m | 5,994 | utf_8 | 90dafde6ab2c52c45680a2fece86f0f9 | function HTPLDA = create_HTPLDA_extractor(F,nu,W)
if nargin==0
test_PsL();
%test_this();
return;
end
[rdim,zdim] = size(F);
assert(rdim>zdim);
nu_prime = nu + rdim - zdim;
if ~exist('W','var') || isempty(W)
W = speye(rdim);
end
E = F.'*W*F;
... |
github | bsxfan/meta-embeddings-master | SGME_MXE2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_MXE2.m | 1,787 | utf_8 | 353320c477be13a9cd785ec811fdd210 | function [y,back] = SGME_MXE2(A,B,D,As,Bs,labels,logPrior)
if nargin==0
test_this();
return;
end
dA = zeros(size(A));
dB = zeros(size(B));
dD = zeros(size(D));
dAs = zeros(size(As));
dBs = zeros(size(Bs));
[LEs,back2] = SGME_logexpectation(As,Bs,D);
dLE... |
github | bsxfan/meta-embeddings-master | asEig.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/asEig.m | 2,397 | utf_8 | c32c0c7a9a0290a98e03a32ad9077c80 | function CA = asEig(A)
if nargin==0
test_this();
return;
end
if isreal(A)
[V,D] = eig(A); %V*D*V' = A
D = diag(D);
r = true;
else
[L,U] = lu(A); % LU = A
r = false;
end
dim = size(A,1);
CA.logdet = @logdet;
CA.solve = ... |
github | bsxfan/meta-embeddings-master | SGME_train2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_train2.m | 2,448 | utf_8 | e9d4f6112d2c067b5d1fb88a8d941e38 | function model = SGME_train2(R,labels,nu,zdim,reg_weight,niters,test)
if nargin==0
test_this();
return;
end
[rdim,n] = size(R);
m = max(labels);
blocks = sparse(labels,1:n,true,m+1,n);
num = find(blocks(:));
%Can we choose maximum likelihood prior parameters, ... |
github | bsxfan/meta-embeddings-master | SGME_extr_full_slightly_slower.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_extr_full_slightly_slower.m | 1,645 | utf_8 | 6e09f32760de243166ccff8266563fe0 | function [A,b,B0,back] = SGME_extr_full_slightly_slower(T,F,nu,R)
if nargin==0
test_this();
return;
end
[rdim,zdim] = size(F);
nuprime = nu + rdim - zdim;
TR = T*R;
A0 = F.'*TR;
B0 = F.'*F;
S = B0\A0;
den = nu + sum(TR.^2,1) - sum(A0.*S,1);... |
github | bsxfan/meta-embeddings-master | SGME_train_MXE2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_train_MXE2.m | 2,510 | utf_8 | b71a75273c325f1e45edf8af7e971f30 | function model = SGME_train_MXE2(R,labels,nu,zdim,niters,timeout,test)
if nargin==0
test_this();
return;
end
[rdim,n] = size(R);
m = max(labels);
blocks = sparse(labels,1:n,true,m,n);
counts = sum(blocks,2);
logPrior = log(counts);
delta = rdim - zdi... |
github | bsxfan/meta-embeddings-master | asChol.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/asChol.m | 2,365 | utf_8 | ea86b12ae1d2edfe698ac2881861b35f | function CA = asChol(A)
if nargin==0
test_this();
return;
end
if isreal(A)
C = chol(A); %C'C = A
r = true;
else
[L,U] = lu(A); % LU = A
r = false;
end
dim = size(A,1);
CA.logdet = @logdet;
CA.solve = @solve;
func... |
github | bsxfan/meta-embeddings-master | SGME_logPsL.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SGME_logPsL.m | 4,123 | utf_8 | ab3281c77517b744131e5f2929860d04 | function [y,back] = SGME_logPsL(A,B,d,blocks,poi,num,logPrior)
assert(isreal(A));
assert(isreal(B));
assert(isreal(d));
assert(isreal(logPrior));
if nargin==0
test_this();
return;
end
if isempty(blocks)
m = max(poi);
n = length(poi);
b... |
github | bsxfan/meta-embeddings-master | sumlogsoftmax.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/sumlogsoftmax.m | 517 | utf_8 | 5591b4f9a440f97900ac26aefd1faf62 | function [y,back] = sumlogsoftmax(X,num)
if nargin==0
test_this();
return;
end
[den,back1] = sumlogsumexp(X);
y = sum(X(num)) - den;
back = @back_this;
function dX = back_this(dy)
dX = back1(-dy);
dX(num) = dX(num) + dy;
... |
github | bsxfan/meta-embeddings-master | create_SGME_calculator.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/create_SGME_calculator.m | 3,098 | utf_8 | 22c43d447699e600cb1e2c8a1f4c4a2d | function [SGME,LEfun] = create_SGME_calculator(E)
if nargin==0
test_this();
return;
end
[V,D] = eig(E); % E = VDV'
d = diag(D); % eigenvalues
dd = zeros(size(d)); %gradient w.r.t. d backpropagated from log_expectations
zdim = length(d);
ii = reshape(logical(eye(zd... |
github | bsxfan/meta-embeddings-master | logsumexp.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/logsumexp.m | 456 | utf_8 | ba0f6dd080d4fa7a7cd270a5055c5980 | function [y,back] = logsumexp(X)
if nargin==0
test_this();
return;
end
mx = max(X,[],1);
y = bsxfun(@plus,log(sum(exp(bsxfun(@minus,X,mx)),1)),mx);
back = @back_this;
function dX = back_this(dy)
dX = bsxfun(@times,dy,exp(bsxfun(@minus,X,y)));
... |
github | bsxfan/meta-embeddings-master | create_GPLDA_extractor.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/create_GPLDA_extractor.m | 710 | utf_8 | 2bd9a131a04f720c722e16dd00900f44 | function PLDA = create_GPLDA_extractor(F,W)
if nargin==0
test_this();
return;
end
[rdim,zdim] = size(F);
assert(rdim>zdim);
if ~exist('W','var') || isempty(W)
W = speye(rdim);
end
E = F.'*W*F;
SGME = create_SGME_calculator(E);
V = SGME.V; % ... |
github | bsxfan/meta-embeddings-master | VB_vs_PsL_demo.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/VB_vs_PsL_demo.m | 7,289 | utf_8 | 0d789457d9783ea1df326fff1db09cb6 | function VB_vs_PsL_demo
% Demo and test code for VB training and SGME scoring of HT-PLDA model.
%
% Training and evaluation data are (independently) sampled from a model with
% randomly generated data. A VB algorithm is used to estimate the parameters
% of this model from the training data. The accuracy of the traine... |
github | bsxfan/meta-embeddings-master | LinvSR.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/LinvSR.m | 562 | utf_8 | cc684a75c7911f7d518550620e6b8fc7 | function [Y,back] = LinvSR(L,S,R)
if nargin==0
test_this();
return;
end
Z = S\R;
Y = L*Z;
back = @back_this;
function [dL,dS,dR] = back_this(dY)
% Y = L*Z
dL = dY*Z.';
dZ = L.'*dY;
% Z = S\R;
dR = S.'\dZ;
... |
github | bsxfan/meta-embeddings-master | test_MLNDA4.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/test_MLNDA4.m | 2,622 | utf_8 | 506e855474d332d8f87a49df75807345 | function test_MLNDA4()
% Assemble model to generate data
big = true;
nu = inf; %required: nu >= 1, integer, degrees of freedom for heavy-tailed channel noise
if ~big
zdim = 2; %speaker identity variable size
rdim = 20; %i-vector size. required: rdim > zdim
... |
github | bsxfan/meta-embeddings-master | test_MLNDA2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/test_MLNDA2.m | 2,499 | utf_8 | e3f3b9a0246c9e728b4717bef4a9f5cf | function test_MLNDA2()
% Assemble model to generate data
big = true;
nu = inf; %required: nu >= 1, integer, degrees of freedom for heavy-tailed channel noise
if ~big
zdim = 2; %speaker identity variable size
rdim = 20; %i-vector size. required: rdim > zdim
... |
github | bsxfan/meta-embeddings-master | logdetNice.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/logdetNice.m | 864 | utf_8 | 3dbf0e9b2c0ef0c688e5d05ea7956379 | function [logdet,back] = logdetNice(sigma,R,d)
if nargin==0
test_this();
return;
end
RR = R.'*R;
S = RR/sigma + diag(1./d);
[L,U] = lu(S);
dim = size(R,1);
logdet = ( sum(log(diag(U).^2)) + sum(log(d.^2)) + dim*log(sigma^2) ) /2;
back = @back_this;
functio... |
github | bsxfan/meta-embeddings-master | mvn_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/mvn_obj.m | 1,588 | utf_8 | d63d45665a8d9f7c779a316af8d9ceb1 | function [y,back] = mvn_obj(T,fi,params)
if nargin==0
test_this2();
return;
end
[R,logdetJ,back2] = fi(params,T);
[llh,back1] = smvn_llh(R);
y = logdetJ - llh;
back = @back_this;
function dparams = back_this(dy)
dlogdetJ = dy;
dR = back1(-dy);
... |
github | bsxfan/meta-embeddings-master | diag2full.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/diag2full.m | 351 | utf_8 | 292558cc287da6cff2303e230a2032c5 | function [M,back] = diag2full(d)
if nargin==0
test_this();
return;
end
dim = length(d);
M = sparse(1:dim,1:dim,d,dim,dim);
back = @back_this;
function [dd] = back_this(dM)
dd = diag(dM);
end
end
function test_this()
d = randn(5,1);
testBackprop... |
github | bsxfan/meta-embeddings-master | smvn_llh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/smvn_llh.m | 235 | utf_8 | 77365e553286261a9c21061b658bc8a9 | function [y,back] = smvn_llh(R)
if nargin==0
test_this();
return;
end
y = (-0.5)*R(:).'*R(:);
back = @(dy) (-dy)*R;
end
function test_this()
R = randn(3,5);
testBackprop(@smvn_llh,{R});
end |
github | bsxfan/meta-embeddings-master | create_shiftTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_shiftTrans.m | 723 | utf_8 | bdf9737fc803c43ac9954fd9a59e4dd8 | function [f,fi,paramsz] = create_shiftTrans(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim;
function T = f_this(P,R)
T = bsxfun(@plus,P,R);
end
function [R,logdetJ,back] = fi_this(P,T)
... |
github | bsxfan/meta-embeddings-master | splda_adaptation_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/splda_adaptation_obj.m | 2,197 | utf_8 | 68929c4f01703cb12cd542b7b824ee2f | function [y,back] = splda_adaptation_obj(newData,labels,oldF,oldW,params,num_new_Fcols,W_adj_rank,slow)
if nargin==0
test_this();
return;
end
if ~exist('slow','var')
slow = false;
end
[dim,Frank] = size(oldF);
[Fcols,Fscal,Cfac] = unpack(params,dim,Frank,num_new_Fcols... |
github | bsxfan/meta-embeddings-master | create_iso_lowrank_trans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_iso_lowrank_trans.m | 1,971 | utf_8 | 38ba025f97172778544cfbd48dd497e7 | function [f,fi,paramsz,fe] = create_iso_lowrank_trans(dim,rank)
if nargin==0
test_this();
return;
end
paramsz = 1 + 2*dim*rank + dim;
[f0,fi0] = create_affineTrans(dim);
f = @f_this;
fi = @fi_this;
fe = @expand;
function T = f_this(P,R)
Q = expand(P);
... |
github | bsxfan/meta-embeddings-master | logdetLU.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/logdetLU.m | 393 | utf_8 | f89f69d0255592e7c1933492e7894c79 | function [y,back] = logdetLU(M)
if nargin==0
test_this();
return;
end
[L,U] = lu(M);
y = sum(log(diag(U).^2))/2;
back = @back_this;
function dM = back_this(dy)
%dM = dy*(inv(U)/L).';
dM = dy*(L.'\inv(U.'));
end
end
function test_this()
... |
github | bsxfan/meta-embeddings-master | splda_map_adaptation_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/splda_map_adaptation_obj.m | 2,841 | utf_8 | 7240f1d5e773584fcf41dd21677665cb | function [y,back] = splda_map_adaptation_obj(newData,newLabels,...
oldData,oldLabels,...
old_weighting,...
params,Frank,Wfac_numcols,slow)
if nargin==0
test_this();
... |
github | bsxfan/meta-embeddings-master | simulateSPLDA.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/simulateSPLDA.m | 1,980 | utf_8 | ca9fb57a7960abc9195c92f2efad43a1 | function [X,hlabels,F,W] = simulateSPLDA(big)
% Inputs:
% big: flag to make low or high-dimensional data, each with realistic,
% single-digit EERs
%
% Outputs:
% X: i-vectors, dim-by-N
% hlabels: sparse label matrix, with one hot columns
% F,W: SPLDA parameters
% Assemble model to generate data
nu =... |
github | bsxfan/meta-embeddings-master | create_scalTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_scalTrans.m | 669 | utf_8 | f35ab355133b6c35d64e89119ca70ae6 | function [f,fi] = create_scalTrans()
if nargout==0
test_this();
return;
end
f = @(scal,R) scal*R;
fi = @fi_this;
function [R,logdetJ,back] = fi_this(scal,T)
[dim,N] = size(T);
R = T/scal;
logdetJ = (N*dim/2)*log(scal^2);
back = @back_this;... |
github | bsxfan/meta-embeddings-master | test_MLNDA.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/test_MLNDA.m | 2,084 | utf_8 | 2b1078bd2cf9d5c3e78fc9481c8065a8 | function test_MLNDA()
% Assemble model to generate data
big = false;
nu = inf; %required: nu >= 1, integer, degrees of freedom for heavy-tailed channel noise
if ~big
zdim = 2; %speaker identity variable size
rdim = 20; %i-vector size. required: rdim > zdim
... |
github | bsxfan/meta-embeddings-master | create_nice_Trans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_nice_Trans.m | 2,960 | utf_8 | 20a716c7c9c49f1d36b52dd0e286b40e | function [f,fi,paramsz,fe] = create_nice_Trans(dim,rank)
if nargin==0
test_this();
return;
end
paramsz = 1 + dim*rank + rank + dim;
f = @f_this;
fi = @fi_this;
fe = @expand;
function T = f_this(P,R)
[sigma,L,d,offset] = expand(P);
M = sigma*eye(dim) ... |
github | bsxfan/meta-embeddings-master | adaptSPLDA.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/adaptSPLDA.m | 1,791 | utf_8 | fce312e9e18adccb87760f2788ced832 | function [Ft,Wt,back] = adaptSPLDA(Fcols,Fscal,Cfac,F,W)
if nargin==0
test_this();
return;
end
Frank = length(Fscal);
Ft = [bsxfun(@times,F,Fscal), Fcols];
% Wt = inv(Ct), Ct = inv(W) + Cfac*Cfac'
% Wt = W - W*Cfac*inv(I + Cfac'*W*Cfac)*Cfac'*W
WCfac = W*C... |
github | bsxfan/meta-embeddings-master | compose_trans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/compose_trans.m | 1,502 | utf_8 | a3a3ae4f9ea19c4b508b6c9b089842db | function [f,fi,paramsz] = compose_trans(outer_paramsz,outer_f,outer_fi,inner_paramsz,inner_f,inner_fi)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = outer_paramsz + inner_paramsz;
function T = f_this(P,R)
[outerP,innerP] = unpack(P)... |
github | bsxfan/meta-embeddings-master | splda_llh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/splda_llh.m | 1,203 | utf_8 | 08dc90a03b9be8bcf3987c73de370d43 | function [llh,back] = splda_llh(R,labels,F,W)
% Inputs:
% R: D-by-N, i-vectors
% labels: sparse, logical K-by-N, one hot columns, K speakers, N recordings
if nargin==0
test_this();
return;
end
FW = F.'*W;
FWR = FW*R;
S = FWR*labels.'; %first order natural parameter for sp... |
github | bsxfan/meta-embeddings-master | create_linTrans2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_linTrans2.m | 1,061 | utf_8 | 1c1bf3b7b215f991486454a53aee7d69 | function [f,fi,paramsz] = create_linTrans2(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim^2;
function T = f_this(P,R)
M = unpack(P);
T = M\R;
end
function [R,logdetJ,back] = fi_this(P,T)
... |
github | bsxfan/meta-embeddings-master | create_affineTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_affineTrans.m | 1,306 | utf_8 | 919b49f4e691b0f162612b8e658b8d07 | function [f,fi,paramsz] = create_affineTrans(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim*(dim+1);
function T = f_this(P,R)
[offset,M] = unpack(P);
T = bsxfun(@plus,offset,M*R);
end
func... |
github | bsxfan/meta-embeddings-master | splda_llh_full.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/splda_llh_full.m | 3,374 | utf_8 | 9f2a6f749c0dfeb7e8f3ae83f26c362e | function [llh,back] = splda_llh_full(labels,F,W,R,slow)
% Like splda_llh(), but backpropagates into all of F,W and R
%
% Inputs:
% R: D-by-N, i-vectors
% labels: sparse, logical K-by-N, one hot columns, K speakers, N recordings
% F,W: SPLA parameters
% slow: [optional, default = false] logical, use slow = true ... |
github | bsxfan/meta-embeddings-master | create_affineTrans2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_affineTrans2.m | 1,233 | utf_8 | 36c35821bc884e51c0de2591659dafda | function [f,fi,paramsz] = create_affineTrans2(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim*(dim+1);
function T = f_this(P,R)
[offset,M] = unpack(P);
T = bsxfun(@plus,offset,M\R);
end
function... |
github | bsxfan/meta-embeddings-master | test_MLNDA3.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/test_MLNDA3.m | 2,423 | utf_8 | 50050aa7eff426a79b6f954e2e549b3e | function test_MLNDA3()
% Assemble model to generate data
big = true;
nu = inf; %required: nu >= 1, integer, degrees of freedom for heavy-tailed channel noise
if ~big
zdim = 2; %speaker identity variable size
rdim = 20; %i-vector size. required: rdim > zdim
... |
github | bsxfan/meta-embeddings-master | create_linTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_linTrans.m | 1,038 | utf_8 | 3f9b4ff66b15309e91a3ab3ecd434e55 | function [f,fi,paramsz] = create_linTrans(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim^2;
function T = f_this(P,R)
M = unpack(P);
T = M*R;
end
function [R,logdetJ,back] = fi_this(P,T)
... |
github | bsxfan/meta-embeddings-master | create_diaglinTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_diaglinTrans.m | 925 | utf_8 | fdb319cbd9815c4182da56c378c191bd | function [f,fi,paramsz] = create_diaglinTrans(dim)
if nargout==0
test_this();
return;
end
f = @f_this;
fi = @fi_this;
paramsz = dim;
function T = f_this(P,R)
T = bsxfun(@times,P,R);
end
function [R,logdetJ,back] = fi_this(P,T)
... |
github | bsxfan/meta-embeddings-master | testTransform_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/testTransform_obj.m | 727 | utf_8 | c525ecb0f1fd8749b67f7140bc4e9ee1 | function [y,back] = testTransform_obj(T,fi,params)
if nargin==0
test_this();
return;
end
[R,logdetJ,back2] = fi(params,T);
[llh,back1] = smvn_llh(R);
y = logdetJ - llh;
back = @back_this;
function dparams = back_this(dy)
dlogdetJ = dy;
dR = back1(-... |
github | bsxfan/meta-embeddings-master | create_sandwich_trans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_sandwich_trans.m | 2,506 | utf_8 | f40de59ee0d3622632aadb88d82f5db2 | function [f,fi,paramsz,fe] = create_sandwich_trans(dim,rank)
if nargin==0
test_this();
return;
end
[f1,fi1] = create_affineTrans(dim);
[f2,fi2] = create_diaglinTrans(dim);
[f3,fi3] = create_linTrans2(dim);
paramsz = 1 + 2*dim*rank + 2*dim;
f = @f_this;
fi = @fi_this;
... |
github | bsxfan/meta-embeddings-master | posteriorNorm_slow.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/posteriorNorm_slow.m | 1,815 | utf_8 | a9b32fbd06cb0f91327d57dac2f41bbd | function [y,back] = posteriorNorm_slow(A,B,b)
% Computes, for every i: log N( 0 | Pi\A(:,i), inv(Pi) ), where
%
% precisions are Pi = I + b(i)*B
%
% This is the slow version, used only to verify correctness of the function
% value and derivatives of the fast version, posteriorNorm_fast().
%
% Inputs:
% A: dim-by-... |
github | bsxfan/meta-embeddings-master | create_nice_Trans2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/create_nice_Trans2.m | 3,145 | utf_8 | 0c8c4c15e2c5338c0237235ede630f48 | function [f,fi,paramsz,fe] = create_nice_Trans2(dim,rank)
% Creates affine transform, having a matrix: M = sigma I + L*D*L.', where
% L is of low rank (tall) and D is small and square, but otherwise
% unconstrained. The forward transform is:
% f(X) = M \ X + offset
if nargin==0
test_this();
ret... |
github | bsxfan/meta-embeddings-master | matmul.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/matmul.m | 373 | utf_8 | d1aa5614f293a88c05d079f2d4426c1e | function [M,back] = matmul(A,B)
if nargin==0
test_this();
return;
end
M = A*B;
back = @back_this;
function [dA,dB] = back_this(dM)
dA = dM*B.';
dB = A.'*dM;
end
end
function test_this()
m = 2;
n = 3;
k = 4;
A = randn(m,k);
B = randn(... |
github | bsxfan/meta-embeddings-master | posteriorNorm_fast.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/posteriorNorm_fast.m | 2,131 | utf_8 | f950d84510798e37996a0f242fd5f9be | function [y,back] = posteriorNorm_fast(A,B,b)
% Computes, for every i: log N( 0 | Pi\A(:,i), inv(Pi) ), where
%
% precisions are Pi = I + b(i)*B
%
% This is the fast version, which simultaneously diagonalizes all the Pi,
% using eigenanalysis of B.
%
% Inputs:
% A: dim-by-n, natural parameters (precision *mean) f... |
github | bsxfan/meta-embeddings-master | logdetNice2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/MLNDA/logdetNice2.m | 929 | utf_8 | 469e8c40a8fb711c201f8fbeaf1c8b32 | function [logdet,back] = logdetNice2(sigma,R,D)
if nargin==0
test_this();
return;
end
RR = R.'*R;
[Ld,Ud] = lu(D);
invD = inv(Ud)/Ld;
S = RR/sigma + invD;
[L,U] = lu(S);
dim = size(R,1);
logdet = ( sum(log(diag(U).^2)) + sum(log(diag(Ud).^2)) + dim*log(sigma^2) ) /2... |
github | bsxfan/meta-embeddings-master | create_semi_discrete_plda2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SDPLDA/create_semi_discrete_plda2.m | 2,834 | utf_8 | 9de983873f97d8473844c898559ed911 | function model = create_semi_discrete_plda2(N,dim,scal)
if nargin==0
test_this();
return;
end
prior = -2*log(N); %flat prior on speaker identity variable
Means = randn(dim,N);
W = randn(dim,dim+2);
W = W*W.'*(scal/(dim+2));
cholW = chol(W);
WMeans = W*Means;
... |
github | bsxfan/meta-embeddings-master | create_semi_discrete_plda.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SDPLDA/create_semi_discrete_plda.m | 2,051 | utf_8 | 9b3b1423eb400e63b6083807faed3bfa | function model = create_semi_discrete_plda(N,dim,scal)
if nargin==0
test_this();
return;
end
prior = -log(N); %flat prior on speaker identity variable
Means = randn(dim,N);
W = randn(dim,dim+2);
W = W*W.'*(scal/(dim+2));
cholW = chol(W);
WMeans = W*Means;
off... |
github | bsxfan/meta-embeddings-master | create_semi_discrete_plda3.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/SDPLDA/create_semi_discrete_plda3.m | 2,232 | utf_8 | f61c1837d29ad7680b5804570951eaa9 | function model = create_semi_discrete_plda3(N,dim,scal)
if nargin==0
test_this();
return;
end
prior = -log(N); %flat prior on speaker identity variable
Means = randn(dim,N);
W = randn(dim,dim+2);
W = W*W.'*(scal/(dim+2));
cholW = chol(W);
WMeans = W*Means;
of... |
github | bsxfan/meta-embeddings-master | create_diagonalized_precision.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/ParPLDA/create_diagonalized_precision.m | 823 | utf_8 | ad8a12141df6c2eeb6adb87fbe93b6da | function dP = create_diagonalized_precision(P)
if nargin==0
test_this();
return;
end
[V,E] = eig(P);
E = diag(E);
dP.logdet_I_plus_nP = @logdet_I_plus_nP;
dP.solve_I_plus_nP = @solve_I_plus_nP;
function y = logdet_I_plus_nP(n)
nE = bsxfun(@times,n,E)... |
github | bsxfan/meta-embeddings-master | equip_with_diagble_GME_scoring.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/ParPLDA/equip_with_diagble_GME_scoring.m | 4,780 | utf_8 | 2ddf2f48c430475c24f987f18d07b8f4 | function model = equip_with_diagble_GME_scoring(model)
% Equip any model with function handles for runtime scoring
% functionality for Gaussian meta-embeddings (GMEs).
%
% Inputs:
% model: any struct. The struct members are not referenced in this code.
% A number of method handles (described below) are... |
github | bsxfan/meta-embeddings-master | create_partition_posterior.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/stochastic_clustering/create_partition_posterior.m | 13,237 | utf_8 | 3d17173981da73f237fb493d8df5d67f | function pp = create_partition_posterior(alpha,beta,llhfun,Emb)
if nargin==0
test_this();
return;
end
if isinf(alpha) || (beta==1) || (alpha==0 && beta==0)
error('degenerate cases not handled');
end
if beta>0
Kfactor = log(beta) - gammaln(1-beta);
else
... |
github | bsxfan/meta-embeddings-master | sample_speaker.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/synthdata/sample_speaker.m | 1,520 | utf_8 | f0f62cb9af06dc368f90cf9c9d6c92d3 | function [X,precisions] = sample_speaker(z,F,k,n,chi_sq)
% Sample n heavy-tailed observations of speaker with identity variable z.
% Inputs:
% z: d-by-1 speaker identity variable
% F: D-by-d factor loading matrix
% k: integer, k>=1, where nu=2k is degrees of freedom of resulting
% t-distribution
% n: numbe... |
github | bsxfan/meta-embeddings-master | sample_HTnoise.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/synthdata/sample_HTnoise.m | 925 | utf_8 | f33058cc3a73b7eacb30c87af34db71e | function [X,precisions] = sample_HTnoise(nu,dim,n,W)
% Sample n heavy-tailed observations of speaker with identity variable z.
% Inputs:
% nu: integer nu >=1, degrees of freedom of resulting t-distribution
% n: number of samples
%
% Output:
% X: dim-by-n samples
% precisions: 1-by-n, the hidden precisions
... |
github | bsxfan/meta-embeddings-master | qfuser_linear.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/fusion/funcs/qfuser_linear.m | 2,337 | utf_8 | 0fe31df563db3c6f4f08ea791e83c340 | function [fusion,w0] = qfuser_linear(w,scores,scrQ,ndx,w_init)
% This function does the actual quality fusion (and is passed to
% the training function when training the quality fusion weights).
% The scores from the linear fusion are added to the combined
% quality measure for each trial to produce the final score.
% ... |
github | bsxfan/meta-embeddings-master | AWB_sparse.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/fusion/funcs/AWB_sparse.m | 2,062 | utf_8 | dcb6e85fdcca1dfb1b5cdee3eb6ab112 | function fh = AWB_sparse(qual,ndx,w)
% Produces trial quality measures from segment quality measures
% using the weighting matrix 'w'.
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% Algorithm: Y = A*reshape(w,..)*B
% Inputs:
% qual: A Quality object containing quality measure... |
github | bsxfan/meta-embeddings-master | dcfplot.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/plotting/dcfplot.m | 1,889 | utf_8 | 9fbbba6b08ba70f285386536481e29d5 | function dcfplot(devkeyname,evalkeyname,devscrfilename,evalscrfilename,outfilename,plot_title,xmin,xmax,ymin,ymax,prior)
% Makes a Norm_DCF plot of the dev and eval scores for a system.
% Inputs:
% devkeyname: The name of the file containing the Key for
% the dev scores.
% evalkeyname: The name of the file co... |
github | bsxfan/meta-embeddings-master | fast_actDCF.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/stats/fast_actDCF.m | 3,032 | utf_8 | 5e62c5e1058f0ba3f5a59149249da2a9 | function [dcf,Pmiss,Pfa] = fast_actDCF(tar,non,plo,normalize)
% Computes the actual average cost of making Bayes decisions with scores
% calibrated to act as log-likelihood-ratios. The average cost (DCF) is
% computed for a given range of target priors and for unity cost of error.
% If un-normalized, DCF is just the B... |
github | bsxfan/meta-embeddings-master | fast_minDCF.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/stats/fast_minDCF.m | 2,585 | utf_8 | 6a709a2b121037d7919f57c87d835531 | function [minDCF,Pmiss,Pfa,prbep,eer] = fast_minDCF(tar,non,plo,normalize)
% Inputs:
%
% tar: vector of target scores
% non: vector of non-target scores
% plo: vector of prior-log-odds: plo = logit(Ptar)
% = log(Ptar) - log(1-Ptar)
%
% normalize: if true, return normalized ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.