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 | rocch.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/det/rocch.m | 2,725 | utf_8 | 68aaac9f8a1f40d0d5eac901abc533d5 | function [pmiss,pfa] = rocch(tar_scores,nontar_scores)
% ROCCH: ROC Convex Hull.
% Usage: [pmiss,pfa] = rocch(tar_scores,nontar_scores)
% (This function has the same interface as compute_roc.)
%
% Note: pmiss and pfa contain the coordinates of the vertices of the
% ROC Convex Hull.
%
% For a demonstration that pl... |
github | bsxfan/meta-embeddings-master | compute_roc.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/det/compute_roc.m | 1,956 | utf_8 | 16907ef9816ee330ac64b4eeb708366b | function [Pmiss, Pfa] = compute_roc(true_scores, false_scores)
% compute_roc computes the (observed) miss/false_alarm probabilities
% for a set of detection output scores.
%
% true_scores (false_scores) are detection output scores for a set of
% detection trials, given that the target hypothesis is true (false).
% ... |
github | bsxfan/meta-embeddings-master | rocchdet.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/det/rocchdet.m | 5,471 | utf_8 | 2452dd1f98aad313c79879d410214cb2 | function [x,y,eer,mindcf] = rocchdet(tar,non,dcfweights,pfa_min,pfa_max,pmiss_min,pmiss_max,dps)
% ROCCHDET: Computes ROC Convex Hull and then maps that to the DET axes.
%
% (For demo, type 'rocchdet' on command line.)
%
% Inputs:
%
% tar: vector of target scores
% non: vector of non-target scores
%
% dcfw... |
github | bsxfan/meta-embeddings-master | map_mod_names.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/manip/map_mod_names.m | 3,127 | utf_8 | 6aa97cdf9b5df6095e803bd14f612e52 | function ndx = map_mod_names(ndx,src_map,dst_map)
% Changes the model names in an index using two maps. The one map
% lists the training segment for each model name and the other map
% lists the new model name for each training segment. Existing
% model names are replaced by new model names that are mapped to
% the s... |
github | bsxfan/meta-embeddings-master | maplookup.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/manip/maplookup.m | 3,084 | utf_8 | 9e8a55e6a2201b6a0e975469dfe9c299 | function [values,is_present] = maplookup(map,keys)
% Does a map lookup, to map mutliple keys to multiple values in one call.
% The parameter 'map' represents a function, where each key maps to a
% unique value. Each value may be mapped to by one or more keys.
%
% Inputs:
% map.keySet: a one-dimensional cell array;
%... |
github | bsxfan/meta-embeddings-master | test_binary_classifier.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/test_binary_classifier.m | 1,332 | utf_8 | 9683ce2757d7eb67c8a8ec37954cbab4 | function obj_val = test_binary_classifier(objective_function,classf, ...
prior,system,input_data)
% Returns the result of the objective function evaluated on the
% scores.
%
% Inputs:
% objective_function: a function handle to the objective function
% to feed the scores into
% classf: le... |
github | bsxfan/meta-embeddings-master | evaluate_objective.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/evaluate_objective.m | 1,417 | utf_8 | 70262971965caac5629612bd125dd0a2 | function obj_val = evaluate_objective(objective_function,scores,classf, ...
prior)
% Returns the result of the objective function evaluated on the
% scores.
%
% Inputs:
% objective_function: a function handle to the objective function
% to feed the scores into
% scores: length T vector o... |
github | bsxfan/meta-embeddings-master | train_binary_classifier.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/train_binary_classifier.m | 3,938 | utf_8 | de96b98d88aa8e3d0c36785a2f9a3a94 | function [w,cxe,w_pen,optimizerState,converged] = ...
train_binary_classifier(classifier,classf,w0,objective_function,prior,...
penalizer,lambda,maxiters,maxCG,optimizerState,...
quiet,cstepHessian)
%
% Supervised training of a regularized fusion.
%
%
% Inp... |
github | bsxfan/meta-embeddings-master | qfuser_v5.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v5.m | 921 | utf_8 | f82cbe0c178dae2a667496466b612770 | function [fusion,w0] = qfuser_v5(w,scores,wfuse)
if nargin==0
test_this();
return;
end
% block 1
f1 = linear_fuser([],scores.scores);
w1 = wfuse;
[whead,wtail] = splitvec_fh(length(w1));
f1 = f1(whead);
% block 2
modelQ = scores.modelQ;
[q,n1] = size(modelQ);
modelQ = [modelQ;ones(1,n1)];
segQ = scores.segQ... |
github | bsxfan/meta-embeddings-master | qfuser_v2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v2.m | 1,166 | utf_8 | e10bf159cbd2dacaf85be8d4a90554f6 | function [fusion,params] = qfuser_v2(w,scores)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% quality_input: K-by-T matrix of quality measures
%
% Output:
% fusion: is numeric if w is numeric, or a handle to an MV2DF, represe... |
github | bsxfan/meta-embeddings-master | linear_fuser.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/linear_fuser.m | 2,654 | utf_8 | 627fab3e121d1d87d9fad2a3234d26f8 | function [fusion,params] = linear_fuser(w,scores)
%
% Does affine fusion of scores: It does a weighted sum of scores and adds
% an offset.
%
% Inputs:
% scores: M-by-N matrix of N scores for each of M input systems.
% w: Optional:
% - when supplied, the output 'fusion' i... |
github | bsxfan/meta-embeddings-master | qfuser_v3.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v3.m | 1,290 | utf_8 | a2245f6284afa9f203096fc932e8cf07 | function [fusion,params] = qfuser_v3(w,scores)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% quality_input: K-by-T matrix of quality measures
%
% Output:
% fusion: is numeric if w is numeric, or a handle to an MV2DF, represe... |
github | bsxfan/meta-embeddings-master | qfuser_v6.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v6.m | 1,013 | utf_8 | 0bcb6e5fbd79494afd1c1c36eff1e95c | function [fusion,w0] = qfuser_v6(w,scores,wfuse)
if nargin==0
test_this();
return;
end
% block 1
f1 = linear_fuser([],scores.scores);
w1 = wfuse;
[whead,wtail] = splitvec_fh(length(w1));
f1 = f1(whead);
% block 2
modelQ = scores.modelQ;
[q,n1] = size(modelQ);
modelQ = [modelQ;ones(1,n1)];
segQ = scores.segQ... |
github | bsxfan/meta-embeddings-master | qfuser_v1.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v1.m | 1,137 | utf_8 | 8dcda09e63d0f7e6a3f1fc2298b84d7e | function [fusion,params] = qfuser_v1(w,scores)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% quality_input: K-by-T matrix of quality measures
%
% Output:
% fusion: is numeric if w is numeric, or a handle to an MV2DF, represe... |
github | bsxfan/meta-embeddings-master | qfuser_v7.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v7.m | 1,107 | utf_8 | 8d156ad2d97a7aa1b90d702cb2f0a195 | function [fusion,w0] = qfuser_v7(w,scores,wfuse)
if nargin==0
test_this();
return;
end
% block 1
f1 = linear_fuser([],scores.scores);
w1 = wfuse;
[whead,wtail] = splitvec_fh(length(w1));
f1 = f1(whead);
% block 2
modelQ = scores.modelQ;
[q,n1] = size(modelQ);
modelQ = [modelQ;ones(1,n1)];
segQ = scores.segQ... |
github | bsxfan/meta-embeddings-master | qfuser_v4.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/qfuser_v4.m | 1,388 | utf_8 | cd65aea99057c92c142fc7e024dc1d53 | function [fusion,w0] = qfuser_v4(w,scores,wfuse)
% qindx: index set for rows of scores.scores which are per-trial quality
% measures.
%
% sindx: index set for rows of scores.scores which are normal discriminative
% scores.
if nargin==0
test_this();
return;
end
sindx = scores.sindx;
qindx = sco... |
github | bsxfan/meta-embeddings-master | scal_fuser.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/scal_fuser.m | 2,918 | utf_8 | 7e49185b74a064be721d9c243a08c07f | function [fusion,params] = scal_fuser(w,scores)
%
% Does scal calibration
%
% Inputs:
% scores: M-by-N matrix of N scores for each of M input systems.
% w: Optional:
% - when supplied, the output 'fusion' is the vector of fused scores.
% - when w=[], the output 'fusion' is a function handle, t... |
github | bsxfan/meta-embeddings-master | scal_fuser_slow.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/scal_fuser_slow.m | 2,972 | utf_8 | abc2a78dc2b6cf08cfdd508f4dabdb71 | function [fusion,params] = scal_fuser_slow(w,scores)
%
% Does scal calibration
%
% Inputs:
% scores: M-by-N matrix of N scores for each of M input systems.
% w: Optional:
% - when supplied, the output 'fusion' is the vector of fused scores.
% - when w=[], the output 'fusion' is a function hand... |
github | bsxfan/meta-embeddings-master | logsumexp_special.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/logsumexp_special.m | 1,102 | utf_8 | a15ffa60b181fdc8b0a1e3fb4bcfd403 | function [y,deriv] = logsumexp_special(w)
% This is a MV2DF. See MV2DF_API_DEFINITION.readme.
%
% If w = [x;r], where r is scalar and x vector, then
% y = log(exp(x)+exp(r))
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)logsumexp_special(w);
return;
end
if isa(w,'function_handle')
... |
github | bsxfan/meta-embeddings-master | scalibration_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/scalibration_fh.m | 1,735 | utf_8 | b9918a8e2a9fa07dfcef33933013931b | function f = scalibration_fh(w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the s-calibration function. The whole mapping works like
% this, in MATLAB-style pseudocode:
%
% If y = f([x;r;s]), where x,r,s are column vectors of size m, then y
% is a column vector of ... |
github | bsxfan/meta-embeddings-master | scalibration_fragile_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/scalibration_fragile_fh.m | 2,389 | utf_8 | 8eec3ccf6bcd5f130a3d399194acd676 | function f = scalibration_fragile_fh(direction,w)
%
% Don't use this function, it is just for reference. It will break for
% large argument values.
%
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the logsumexp function. The whole mapping works like
% this, in MATLAB-styl... |
github | bsxfan/meta-embeddings-master | scal_simple_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/scalibration/scal_simple_fh.m | 1,903 | utf_8 | b6e3992c13b4424d2129302a3c51424c | function f = scal_simple_fh(w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the s-calibration function. The whole mapping works like
% this, in MATLAB-style pseudocode:
%
% If y = f([x;r;s]), where r,s are scalar, x is column vector of size m,
% then y is a column ... |
github | bsxfan/meta-embeddings-master | quality_fuser_v3.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/aside/quality_fuser_v3.m | 1,843 | utf_8 | 1be42594eb854e9b0b4d89daa27c0759 | function [fusion,params] = quality_fuser_v3(w,scores,train_vecs,test_vecs,train_ndx,test_ndx,ddim)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% train_vecs: K1-by-M matrix, one column-vector for each of M training
% ... |
github | bsxfan/meta-embeddings-master | quality_fuser_v1.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/aside/quality_fuser_v1.m | 2,225 | utf_8 | 64802a2f8ee68bcd9f60a31166e64fdb | function [fusion,params] = quality_fuser_v1(w,scores,train_vecs,test_vecs,train_ndx,test_ndx,ddim)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% train_vecs: K1-by-M matrix, one column-vector for each of M training
% ... |
github | bsxfan/meta-embeddings-master | quality_fuser_v2.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/aside/quality_fuser_v2.m | 1,827 | utf_8 | 702d7721d2e75e4164bd1fc9b7ba4c57 | function [fusion,params] = quality_fuser_v2(w,scores,train_vecs,test_vecs,train_ndx,test_ndx,ddim)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% train_vecs: K1-by-M matrix, one column-vector for each of M training
% ... |
github | bsxfan/meta-embeddings-master | quality_fuser_v4.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/systems/aside/quality_fuser_v4.m | 1,217 | utf_8 | d5315c3a78ba4e1277f9493c119d0cc8 | function [fusion,params] = quality_fuser_v4(w,scores,quality_inputs)
%
% Inputs:
%
% scores: the primary detection scores, for training
% D-by-T matrix of T scores for D input systems
%
% quality_input: K-by-T matrix of quality measures
%
% Output:
% fusion: is numeric if w is numeric, or a handl... |
github | bsxfan/meta-embeddings-master | sigmoid_logdistance.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/sigmoid_logdistance.m | 1,561 | utf_8 | b124d29ef74e835d894f8dd7de72c760 | function [sld,params] = sigmoid_logdistance(w,input_data,ddim)
%
% Algorithm: sld = sigmoid(
% log(
% sum(bsxfun(@minus,M*input_data,c).^2,1)
% ))
%
%
% Inputs:
% w: is vec([M,c]), where M is ddim-by-D and c is ddim-by-1
% Use w=[] to let output sld be a... |
github | bsxfan/meta-embeddings-master | QtoLLH.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/QtoLLH.m | 612 | utf_8 | e0bc4e7d0bfd4082fc37fb474bc44c8c | function [LLH,w0] = QtoLLH(w,Q,n)
%
if nargin==0
test_this();
return;
end
if ~exist('Q','var') || isempty(Q)
LLH = sprintf(['QtoLLH:',repmat(' %g',1,length(w))],w);
return;
end
[m,k] = size(Q);
wsz = m*n;
if nargout>1, w0 = zeros(wsz,1); end
LLH = linTrans(w,@(w)map_this(w),@(w)transmap_this(w)... |
github | bsxfan/meta-embeddings-master | fused_sigmoid.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/fused_sigmoid.m | 1,293 | utf_8 | 1f35e45a3c945008307dd1222a281bb8 | function [ps,params] = fused_sigmoid(w,input_data)
%
% Algorithm: ps = sigmoid( alpha'*input_data +beta)
%
%
% Inputs:
% w: is [alpha; beta], where alpha is D-by-1 and beta is scalar.
% Use w=[] to let output ps be an MV2DF function handle.
% If w is a function handle to an MV2DF then ps is the function hand... |
github | bsxfan/meta-embeddings-master | sigmoid_log_sumsqdist.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/sigmoid_log_sumsqdist.m | 1,638 | utf_8 | 0b9f81df4bc93fe52ac7dbaa98594160 | function [sig,params] = sigmoid_log_sumsqdist(w,data1,data2,ndx1,ndx2,ddim)
%
% Similar to prod_sigmoid_logdist, but adds square distances from two sides
% before doing sigmoid(log()).
%
if nargin==0
test_this();
return;
end
datadim = size(data1,1);
assert(datadim==size(data2,1),'data1 and data2 must have s... |
github | bsxfan/meta-embeddings-master | prmtrzd_sig_log_dist.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/prmtrzd_sig_log_dist.m | 1,767 | utf_8 | edf7387841000e5933bda732bca5b79b | function [ps,params] = prmtrzd_sig_log_dist(w,input_data,ddim)
%
% Algorithm: ps = sigmoid(
% offs+scal*log(
% sum(bsxfun(@minus,M*input_data,c).^2,1)
% ))
%
%
% Inputs:
% w: is [ vec(M); c; scal; offs], where M is ddim-by-D; c is ddim-by-1;
% and scal and o... |
github | bsxfan/meta-embeddings-master | QQtoLLH.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/QQtoLLH.m | 623 | utf_8 | 73d37a5922aafaa7dd4dd6e5a2cfbe51 | function [LLH,w0] = QQtoLLH(w,qleft,qright,n)
%
if nargin==0
test_this();
return;
end
qleft = [qleft;ones(1,size(qleft,2))];
qright = [qright;ones(1,size(qright,2))];
qdim = size(qleft,1);
qdim2 = size(qright,1);
assert(qdim==qdim2);
q2 = qdim*(qdim+1)/2;
wsz = n*q2;
if nargout>1, w0 = zeros(wsz,1); end... |
github | bsxfan/meta-embeddings-master | QQtoP.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/QQtoP.m | 771 | utf_8 | 0a940f8a8a56510a32ad6a45accddc02 | function [P,params] = QQtoP(w,qleft,qright,n)
%
if nargin==0
test_this();
return;
end
qleft = [qleft;ones(1,size(qleft,2))];
qright = [qright;ones(1,size(qright,2))];
[qdim,nleft] = size(qleft);
[qdim2,nright] = size(qright);
assert(qdim==qdim2);
q2 = qdim*(qdim+1)/2;
wsz = n*q2;
[whead,wtail] = splitvec_... |
github | bsxfan/meta-embeddings-master | prod_sigmoid_logdist.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/prod_sigmoid_logdist.m | 2,506 | utf_8 | f31a256c5434fca4b6c0641d23a2ebc1 | function [sig,params] = prod_sigmoid_logdist(w,data1,data2,ndx1,ndx2,ddim)
%
% Algorithm: sig = distribute(ndx1,sigmoid(
% log(
% sum(bsxfun(@minus,M*data_1,c).^2,1)
% )))
% *
% distribute(ndx2,sigmoid(
% log( ... |
github | bsxfan/meta-embeddings-master | outerprod_of_sigmoids.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/outerprod_of_sigmoids.m | 1,033 | utf_8 | 2577209cada6747a9615d0ce3b375b7f | function [Q,params] = outerprod_of_sigmoids(w,qleft,qright)
%
if nargin==0
test_this();
return;
end
[qdim,nleft] = size(qleft);
[qdim2,nright] = size(qright);
assert(qdim==qdim2);
wsz = qdim+1;
[whead,wtail] = splitvec_fh(wsz,w);
params.get_w0 = @(ssat) init_w0(ssat);
params.tail = wtail;
% fleft = sigmoid... |
github | bsxfan/meta-embeddings-master | parallel_cal.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/parallel_cal.m | 983 | utf_8 | 252822b934d5469fc96448f80d2f3e90 | function [calscores,w0] = parallel_cal(w,scores,wfuse)
%
if nargin==0
test_this();
return;
end
if ~exist('scores','var') || isempty(scores)
calscores = sprintf(['parallel calibration:',repmat(' %g',1,length(w))],w);
return;
end
[m,n] = size(scores);
if nargout>1, w0 = init_w0(wfuse); end
cals... |
github | bsxfan/meta-embeddings-master | parallel_cal_augm.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/parallel_cal_augm.m | 1,115 | utf_8 | f5a8bba6d164ab5577c8429ce5835305 | function [calscores,params] = parallel_cal_augm(w,scores)
%
if nargin==0
test_this();
return;
end
if ~exist('scores','var') || isempty(scores)
calscores = sprintf(['parallel calibration:',repmat(' %g',1,length(w))],w);
return;
end
[m,n] = size(scores);
scores = [scores;zeros(1,n)];
wsz = 2*m;
[... |
github | bsxfan/meta-embeddings-master | prod_of_prmtrzd_sigmoids.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/prod_of_prmtrzd_sigmoids.m | 1,537 | utf_8 | 6c18de0879f128ada38d483ace60b57f | function [ps,params] = prod_of_prmtrzd_sigmoids(w,input_data)
%
% Algorithm: ps = prod_i sigmoid( alpha_i*input_data(i,:) + beta_i)
%
%
% Inputs:
% w: is vec([alpha; beta]), where alpha and beta are 1-by-D.
% Use w=[] to let output ps be an MV2DF function handle.
% If w is a function handle to an MV2DF then ... |
github | bsxfan/meta-embeddings-master | prmtrzd_sigmoid.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/quality_modules/prmtrzd_sigmoid.m | 1,312 | utf_8 | 616d28e7f84f188fcd7759c98a9c3c66 | function [ps,params] = prmtrzd_sigmoid(w,input_data)
%
% Algorithm: ps = sigmoid( w0+w1'*input_data ), where
% w = [w1;w0]; w0 is scalar; and w1 is vector
%
%
% Inputs:
% w = [w1;w0]; w0 is scalar; and w1 is vector.
% Use w=[] to let output ps be an MV2DF function handle.
% If w is a function handle to a... |
github | bsxfan/meta-embeddings-master | augmentmatrix_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/augmentmatrix_fh.m | 826 | utf_8 | d2182cb06b78c3d43519f09b297ddad2 | function fh = augmentmatrix_fh(m,value,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% Algorithm: y = [reshape(w,m,n);ones(1,n)](:)
if nargin==0
test_this();
return;
end
function y = map_this(w)
n = length(w)/m;
y = [reshape(w,m,n);value*ones... |
github | bsxfan/meta-embeddings-master | bsx_col_plus_row.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/bsx_col_plus_row.m | 912 | utf_8 | 59d5f6f7ea9d75509fbc6bf64b63b465 | function fh = bsx_col_plus_row(m,n,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% Algorithm: col = w(1:m)
% row = w(m+1:end)
% y = bsxfun(@plus,col(:),row(:)'),
%
if nargin==0
test_this();
return;
end
function y = map_this(w)
... |
github | bsxfan/meta-embeddings-master | duplicator_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/duplicator_fh.m | 805 | utf_8 | 890c37f077bde2305a0f1c545b71c36a | function f = duplicator_fh(duplication_indices,xdim,w)
%
% This factory creates a function handle to an MV2DF, which represents the
% function:
%
% y = x(duplication_indices)
%
if nargin==0
test_this();
return;
end
map = @(x) x(duplication_indices);
%xdim = max(duplication_indices);
ydim = length(duplica... |
github | bsxfan/meta-embeddings-master | splitvec_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/splitvec_fh.m | 1,343 | utf_8 | aff993bc1037dc1d6673762983fd5497 | function [head,tail] = splitvec_fh(head_size,w)
%
%
% If head_size <0 then tail_size = - head_size
if nargin==0
test_this();
return;
end
tail_size = - head_size;
function w = transmap_head(y,sz)
w=zeros(sz,1);
w(1:head_size)=y;
end
function w = transmap_tail(y,sz)
w=zeros(sz,1); ... |
github | bsxfan/meta-embeddings-master | log_distance_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/log_distance_mv2df.m | 1,968 | utf_8 | ab190182251a8ee9a8cce755c6615e99 | function [y,deriv] = log_distance_mv2df(w,input_data,new_dim)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% The function projects each column of input_data to a subspace and then
% computes log distance from a centroid. The input_data is fixed, but
% the projection and centroid parameters are variable.
%
%... |
github | bsxfan/meta-embeddings-master | AWB_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/AWB_fh.m | 675 | utf_8 | 3ab5ec4ad82fe2f901f95abf30fb3193 | function fh = AWB_fh(A,B,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% Algorithm: Y = A*reshape(w,..)*B
if nargin==0
test_this();
return;
end
[m,n] = size(A);
[r,s] = size(B);
function y = map_this(w)
w = reshape(w,n,r);
y = A*w*B;
end
... |
github | bsxfan/meta-embeddings-master | xoverxplusalpha.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/xoverxplusalpha.m | 792 | utf_8 | 9fbd612d42a50cee70f2b05dce2bf16c | function [y,deriv] = xoverxplusalpha(w,x)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% alpha --> x./(x+alpha)
%
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)xoverxplusalpha(w,x);
return;
end
if isa(w,'function_handle')
f = xoverxplusalpha([],x);
y = compose_mv(... |
github | bsxfan/meta-embeddings-master | tril_to_symm_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/tril_to_symm_fh.m | 786 | utf_8 | 9ea53a1f6c15720e67c1c446d7dfad43 | function fh = tril_to_symm_fh(m,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% Algorithm: w is vector of sizem*(m+1)/2
% w -> m-by-m lower triangular matrix Y
% Y -> Y + Y'
if nargin==0
test_this();
return;
end
indx = tril(true(m));
fun... |
github | bsxfan/meta-embeddings-master | square_distance_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/square_distance_mv2df.m | 1,835 | utf_8 | a5d544c6956f70a3c3afdec634a2c891 | function [y,deriv] = square_distance_mv2df(w,input_data,new_dim)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% The function computes the square distance of the vectors for each trial.
% y.' = sum((W(:,1:end-1).'*input_data + W(:,end)).^2,1)
%
% W is the augmented matrix [M c] where M maps a score vect... |
github | bsxfan/meta-embeddings-master | addtotranspose_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/addtotranspose_fh.m | 493 | utf_8 | c009e482a302e2825fb3f59940bcc79e | function fh = addtotranspose_fh(m,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
if nargin==0
test_this();
return;
end
function y = map_this(w)
w = reshape(w,m,m);
y = w+w.';
end
map = @(y) map_this(y);
transmap = @(y) map_this(y);
fh = l... |
github | bsxfan/meta-embeddings-master | subvec_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/subvec_fh.m | 544 | utf_8 | a8942d310965ca178a123eb3f4a78f21 | function fh = subvec_fh(first,len,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
if nargin==0
test_this();
return;
end
map = @(w) w(first:first+len-1);
function w = transmap_this(y,sz)
w=zeros(sz,1);
w(first:first+len-1)=y;
end
transmap = @(y,sz) ... |
github | bsxfan/meta-embeddings-master | linTrans_adaptive.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/applications/fusion2class/mv2df_function_library/templates/linTrans_adaptive.m | 1,173 | utf_8 | 66276c8cd337da71a4e14efc67112765 | function [y,deriv] = linTrans_adaptive(w,map,transmap)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Applies linear transform y = map(w). It needs the transpose of map,
% transmap for computing the gradient. map and transmap are function
% handles.
if nargin==0
test_this();
return;
end
if isempty(... |
github | bsxfan/meta-embeddings-master | logsumexp_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/logsumexp_fh.m | 1,287 | utf_8 | 764511ba624a62ac12e572a26a5e7aa2 | function f = logsumexp_fh(m,direction,w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the logsumexp function. The whole mapping works like
% this, in MATLAB-style psuedocode:
%
% F: R^(m*n) --> R^n, where y = F(x) is computed thus:
%
% n = length(x)/m
% If directi... |
github | bsxfan/meta-embeddings-master | one_over_one_plus_w_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/one_over_one_plus_w_mv2df.m | 717 | utf_8 | d735233c52193c323d03cdb85d0948f5 | function [y,deriv] = one_over_one_plus_w_mv2df(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = 1 ./ (1 + w)
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)one_over_one_plus_w_mv2df(w);
return;
end
if isa(w,'function_handle')
outer = one_over_one_plus_w_mv2df([]);
y... |
github | bsxfan/meta-embeddings-master | sigmoid_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/sigmoid_mv2df.m | 758 | utf_8 | e0591c88d68032fcf2a300fe7f2e8df0 | function [y,deriv] = sigmoid_mv2df(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = sigmoid(w) = 1./(1+exp(-w)), vectorized as MATLAB usually does.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)sigmoid_mv2df(w);
return;
end
if isa(w,'function_handle')
outer = sigmoid_m... |
github | bsxfan/meta-embeddings-master | neglogsigmoid_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/neglogsigmoid_fh.m | 1,075 | utf_8 | dc180d133fc039197aa99a5e4186c6a7 | function f = neglogsigmoid_fh(w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the logsigmoid function. The mapping is, in
% MATLAB-style code:
%
% y = log(sigmoid(w)) = log(1./1+exp(-w)) = -log(1+exp(-w))
%
% Inputs:
% m: the number of inputs to each individual lo... |
github | bsxfan/meta-embeddings-master | logsumsquares_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/logsumsquares_fh.m | 1,275 | utf_8 | c1e543f6680e7257b1f55ff61d967598 | function f = logsumsquares_fh(m,direction,w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the logsumsquares function. The whole mapping works like
% this, in MATLAB-style psuedocode:
%
% F: R^(m*n) --> R^n, where y = F(x) is computed thus:
%
% n = length(x)/m
% If... |
github | bsxfan/meta-embeddings-master | expneg_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/expneg_mv2df.m | 675 | utf_8 | f12485f16e7f66d9deb530df461bdcdc | function [y,deriv] = expneg_mv2df(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = exp(-w), vectorized as MATLAB usually does.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)expneg_mv2df(w);
return;
end
if isa(w,'function_handle')
outer = expneg_mv2df([]);
y = compo... |
github | bsxfan/meta-embeddings-master | square_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/square_mv2df.m | 634 | utf_8 | f7604570a85ea6be67d98ae414127642 | function [y,deriv] = square_mv2df(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = w.^2
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)square_mv2df(w);
return;
end
if isa(w,'function_handle')
outer = square_mv2df([]);
y = compose_mv(outer,w,[]);
return;
end
w... |
github | bsxfan/meta-embeddings-master | logsigmoid_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/logsigmoid_fh.m | 1,068 | utf_8 | 65bf6e2f03af50449d9492d02f7e3c98 | function f = logsigmoid_fh(w)
% This is a factory for a function handle to an MV2DF, which represents
% the vectorization of the logsigmoid function. The mapping is, in
% MATLAB-style code:
%
% y = log(sigmoid(w)) = log(1./1+exp(-w)) = -log(1+exp(-w))
%
% Inputs:
% m: the number of inputs to each individual logsu... |
github | bsxfan/meta-embeddings-master | exp_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/exp_mv2df.m | 659 | utf_8 | 410b48565ed23cbda996866e44dfb2fa | function [y,deriv] = exp_mv2df(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = exp(w), vectorized as MATLAB usually does.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)exp_mv2df(w);
return;
end
if isa(w,'function_handle')
outer = exp_mv2df([]);
y = compose_mv(oute... |
github | bsxfan/meta-embeddings-master | vectorized_function.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/vector/templates/vectorized_function.m | 4,600 | utf_8 | 9c5431b821aa6587c3849945d31dd1fd | function [y,deriv] = vectorized_function(w,f,m,direction)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% This template vectorizes the given function F: R^m -> R as follows:
% k = length(w)/m;
% If direction=1, X = reshape(w,m,k), y(j) = F(X(:,j)), or
% if direction=2, X = reshape(w,k,m), y(i) = F(X(i,:)... |
github | bsxfan/meta-embeddings-master | logdet_chol.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/logdet_chol.m | 1,185 | utf_8 | 706e5c1e5b5b660da50408bd221522a0 | function [y,deriv] = logdet_chol(w)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% y = log(det(W)), where W is positive definite and W = reshape(w,...)
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)logdet_chol(w);
return;
end
if isa(w,'function_handle')
outer = logdet_chol(... |
github | bsxfan/meta-embeddings-master | sumsquares_penalty.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/sumsquares_penalty.m | 916 | utf_8 | 8f40fb9f94c7424808c89e165ec9960c | function [y,deriv] = sumsquares_penalty(w,lambda)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% See code for details.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)sumsquares_penalty(w,lambda);
return;
end
if isa(w,'function_handle')
outer = sumsquares_penalty([],lambda);
... |
github | bsxfan/meta-embeddings-master | wmlr_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/wmlr_obj.m | 2,299 | utf_8 | f450d5fdd89f4854a123b7d7947d32c3 | function [y,deriv] = wmlr_obj(w,X,T,weights,logprior);
% This is a SCAL2DF. See SCAL2DF_API_DEFINITION.readme.
% Weighted multiclass linear logistic regression objective function.
% w is vectorized D-by-K parameter matrix W (to be optimized)
% X is D-by-N data matrix, for N trials
% T is K-by-N, 0/1 class label m... |
github | bsxfan/meta-embeddings-master | boost_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/boost_obj.m | 1,556 | utf_8 | eaa722fa0cd7b1b492401c4e6adf807b | function [y,deriv] = boost_obj(w,T,weights,logit_prior)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Weighted binary classifier cross-entropy objective, based on 'boosting'
% proper scoring rule. This rule places more emphasis on extreme scores,
% than the logariothmic scoring rule.
%
% Differentiable inpu... |
github | bsxfan/meta-embeddings-master | neg_gaussll_taylor.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/neg_gaussll_taylor.m | 1,332 | utf_8 | 4efafbe09f47ca5947e223ca80f063c6 | function [y,deriv] = neg_gaussll_taylor(w,x)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% This function represents the part of log N(x|0,W) that is dependent on
% W = reshape(w,...), where w is variable and x is given.
%
% y = -0.5*x'*inv(W)*x - 0.5*log(det(W)), where W is positive definite and W = reshap... |
github | bsxfan/meta-embeddings-master | brier_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/brier_obj.m | 1,722 | utf_8 | f68fae1776aa1a970b6f329e4c0d1027 | function [y,deriv] = brier_obj(w,T,weights,logit_prior)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Weighted binary classifier cross-entropy objective, based on 'Brier'
% quadratic proper scoring rule. This rule places less emphasis on extreme scores,
% than the logariothmic scoring rule.
%
% Differentiab... |
github | bsxfan/meta-embeddings-master | gauss_ll.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/gauss_ll.m | 1,461 | utf_8 | 76707fbe20f1dae43305e2542e9644ce | function [y,deriv] = gauss_ll(w,x)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
% This function represents the part of log N(x|0,W) that is dependent on
% W = reshape(w,...), where w is variable and x is given.
%
% y = -0.5*x'*inv(W)*x - 0.5*log(det(W)), where W is positive definite and W = reshape(w,...)
... |
github | bsxfan/meta-embeddings-master | cllr_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/cllr_obj.m | 1,611 | utf_8 | 374952d66aa4641a000a48cc12baebad | function [y,deriv] = cllr_obj(w,T,weights,logit_prior)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Weighted binary classifier cross-entropy objective, based on logarithmic
% cost function.
%
% Differentiable inputs:
% w: is vector of N detection scores (in log-likelihood-ratio format)
%
% Fixed parame... |
github | bsxfan/meta-embeddings-master | mce_obj.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/mce_obj.m | 1,711 | utf_8 | 93cfa59b8a57d279ebbdb02376bd696c | function [y,deriv] = mce_obj(w,T,weights,logprior)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Weighted multiclass cross-entropy objective.
% w is vectorized K-by-N score matrix W (to be optimized)
% T is K-by-N, 0/1 class label matrix, with exactly one 1 per column.
% weights is N-vector of objectiv... |
github | bsxfan/meta-embeddings-master | sum_ai_f_of_w_i.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/scalar/templates/sum_ai_f_of_w_i.m | 1,367 | utf_8 | af9137c86c4b6c7456dbd1688c9ba0bb | function [y,deriv] = sum_ai_f_of_w_i(w,a,f,b)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Does y = sum_i a_i f(w_i) + b, where f is non-linear.
%
%Notes:
%
% f is a function handle, with behaviour as demonstrated in the test code
% of this function.
%
% b is optional, defaults to 0 if omitted
if nargi... |
github | bsxfan/meta-embeddings-master | KtimesW.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/KtimesW.m | 726 | utf_8 | d53d40345ce7668d43a1efa9eb621335 | function [y,deriv] = KtimesW(w,K)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
%
%
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w) map_this(w,K);
transmap = @(y) transmap_this(y,K);
y = linTrans(w,map,transmap);
return;
end
if isa(w,'function_handle')
f = ... |
github | bsxfan/meta-embeddings-master | scaleRows.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/scaleRows.m | 798 | utf_8 | c848225d200f35d733b8bb76c2495127 | function [y,deriv] = scaleRows(w,scales)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% w --> bsxfun(@times,reshape(w,m,[]),scales(:))
%
% where m = length(scales);
%
% Note: this is a symmetric linear transform.
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w)map_this(w,scale... |
github | bsxfan/meta-embeddings-master | sumcolumns_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/sumcolumns_fh.m | 602 | utf_8 | 7a2cd01c3b7076cda20fa6a96cae0069 | function fh = sumcolumns_fh(m,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% w -> W = reshape(w,m,[]) -> sum(W,1)'
if nargin==0
test_this();
return;
end
map = @(w) map_this(w,m);
transmap = @(y) transmap_this(y,m);
fh = linTrans([],map,transmap);
if exist('w'... |
github | bsxfan/meta-embeddings-master | columnJofN_fh.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/columnJofN_fh.m | 634 | utf_8 | 23448c0cc436ac53b95d5e4ec48c7b35 | function fh = columnJofN_fh(j,n,w)
% This is almost an MV2DF, but it does not return derivatives on numeric
% input, w.
%
% w -> W = reshape(w,[],n) -> W(:,j)
if nargin==0
test_this();
return;
end
map = @(w) map_this(w,j,n);
transmap = @(y) transmap_this(y,j,n);
fh = linTrans([],map,transmap);
if exist(... |
github | bsxfan/meta-embeddings-master | scaleColumns.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/scaleColumns.m | 811 | utf_8 | cacb0b80cb3f3871595674e741382d26 | function [y,deriv] = scaleColumns(w,scales)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% w --> bsxfun(@times,reshape(w,[],n),scales(:)')
%
% where n = length(scales);
%
% Note: this is a symmetric linear transform.
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w)map_this(w,s... |
github | bsxfan/meta-embeddings-master | subvec.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/subvec.m | 733 | utf_8 | ed189df10ecad63eca1130710c559631 | function [y,deriv] = subvec(w,size,first,length)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
% w --> w(first:first+length-1)
%
if nargin==0
test_this();
return;
end
last = first+length-1;
if isempty(w)
map = @(w) w(first:last);
transmap = @(w) transmap_this(w,size,first,last);
y... |
github | bsxfan/meta-embeddings-master | identity_trans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/identity_trans.m | 495 | utf_8 | aec19df7ff1e1fa5079b22973d9122fc | function [y,deriv] = identity_trans(w)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
% w --> w
%
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w) w;
y = linTrans(w,map,map);
return;
end
if isa(w,'function_handle')
f = identity_trans([]);
y = compose_mv(f,w,[])... |
github | bsxfan/meta-embeddings-master | WtimesK.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/WtimesK.m | 726 | utf_8 | 20d6a4715d3fb8e2c51fc17f1a45e865 | function [y,deriv] = WtimesK(w,K)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
%
%
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w) map_this(w,K);
transmap = @(y) transmap_this(y,K);
y = linTrans(w,map,transmap);
return;
end
if isa(w,'function_handle')
f = ... |
github | bsxfan/meta-embeddings-master | transpose_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/transpose_mv2df.m | 700 | utf_8 | 58016f72134e4ccf6256f2ea1f952a43 | function [y,deriv] = transpose_mv2df(w,M,N)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
% vec(A) --> vec(A'),
%
% where A is M by N
%
% Note: this is an orthogonal linear transform.
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w) reshape(reshape(w,M,N).',[],1);
transmap... |
github | bsxfan/meta-embeddings-master | fusion_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/fusion_mv2df.m | 1,182 | utf_8 | df0b186cde5dcc42aea6490f13d6d479 | function [y,deriv] = fusion_mv2df(w,scores)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% The function is a 'score fusion' computed thus:
% y.' = w(1:end-1).'*scores + w(end)
%
% Here w is the vector of fusion weights, one weight per system and
% an offset.
%
% Parameters:
% scores: is... |
github | bsxfan/meta-embeddings-master | addSigmaI.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/addSigmaI.m | 771 | utf_8 | 78b1a5b40a699c613a11ce64085abe6e | function [y,deriv] = addSigmaI(w)
% This is an MV2DF . See MV2DF_API_DEFINITION.readme.
%
%
%
if nargin==0
test_this();
return;
end
if isempty(w)
map = @(w) map_this(w);
transmap = @(w) transmap_this(w);
y = linTrans(w,map,transmap);
return;
end
if isa(w,'function_handle')
f = addS... |
github | bsxfan/meta-embeddings-master | addOffset.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/addOffset.m | 1,057 | utf_8 | 38390e8a3f92c5a6b760571e3ba340e3 | function [y,deriv] = addOffset(w,K,N)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% w = [vec(A);b] --> vec(bsxfun(@plus,A,b))
%
% This function retrieves a K by N matrix as well as a K-vector from w,
% adds the K-vector to every column of the matrix
% and outputs the vectorized result.
% Note this... |
github | bsxfan/meta-embeddings-master | const_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/templates/const_mv2df.m | 856 | utf_8 | 541e86c2041370727a8705935c4d575e | function [y,deriv] = const_mv2df(w,const)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% y = const(:);
%
% This wraps the given constant into an MV2DF. The output, y, is
% independent of input w. The derivatives are sparse zero vectors of the
% appropriate size.
if nargin==0
test_this();
return;
... |
github | bsxfan/meta-embeddings-master | linTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/templates/linTrans.m | 1,012 | utf_8 | 5c26cd329441fa971c05127c464dfae5 | function [y,deriv] = linTrans(w,map,transmap)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Applies linear transform y = map(w). It needs the transpose of map,
% transmap for computing the gradient. map and transmap are function
% handles.
if nargin==0
test_this();
return;
end
if isempty(w)
y ... |
github | bsxfan/meta-embeddings-master | affineTrans.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/linear/templates/affineTrans.m | 1,378 | utf_8 | f1c4abd92c1dca63db5b0ccf3915a631 | function [y,deriv] = affineTrans(w,affineMap,linMap,transMap)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Applies affine transform y = affineMap(w). It needs also needs
% linMap, the linear part of the mapping, as well as transMap, the
% transpose of linMap. All of affineMap, linMap and transMap are funct... |
github | bsxfan/meta-embeddings-master | logsoftmax_trunc_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/logsoftmax_trunc_mv2df.m | 1,380 | utf_8 | 7933852f24348cedbc4c8750142e51de | function [y,deriv] = logsoftmax_trunc_mv2df(w,m)
% This is a MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Does:
% (i) Reshapes w to m-by-n.
% (ii) effectively (not physically) append a bottom row of zeros
% (iii) Computes logsoftmax of each of n columns.
% (iv) Omits last row (effectively)
if nargin==0
test_this... |
github | bsxfan/meta-embeddings-master | mm_special.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/mm_special.m | 1,465 | utf_8 | 735b9c605bad33588197fcc0c0d59eb5 | function [prod,deriv] = mm_special(w,extractA,extractB)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% [vec(A);vec(B)] --> vec(A*B)
%
% where
% A is extractA(w)
% B is extractB(w)
if nargin==0
test_this();
return;
end
if isempty(w)
prod = @(w)mm_special(w,extractA,extractB);
return;... |
github | bsxfan/meta-embeddings-master | sums_of_squares.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/sums_of_squares.m | 898 | utf_8 | 1fa8d45eea9355807d8ef47606407b36 | function [y,deriv] = sums_of_squares(w,m)
% This is a MV2DF. See MV2DF_API_DEFINITION.readme.
% Does:
% (i) Reshapes w to m-by-n.
% (ii) Computes sum of squares of each of n columns.
% (iii) Transposes to output n-vector.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)sums_of_squares(w,m)... |
github | bsxfan/meta-embeddings-master | gemm.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/gemm.m | 1,283 | utf_8 | b9245303ab8248f450ad033cde69bf29 | function [prod,deriv] = gemm(w,m,k,n)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% [vec(A);vec(B)] --> vec(A*B)
%
% where
% A is m-by-k
% B is k-by-n
if nargin==0
test_this();
return;
end
if isempty(w)
prod = @(w)gemm(w,m,k,n);
return;
end
if isa(w,'function_handle')
outer =... |
github | bsxfan/meta-embeddings-master | XtKX.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/XtKX.m | 849 | utf_8 | 0298041dbd9ce1171c7cf66e0edb8a09 | function [y,deriv] = XtKX(w,K)
%This is an MV2DF.
%
% vec(X) --> vec(X'KX)
%
if nargin==0
test_this();
return;
end
m = size(K,1);
if isempty(w)
y = @(w) XtKX(w,K);
return;
end
if isa(w,'function_handle')
outer = XtKX([],K);
y = compose_mv(outer,w,[]);
return;
end
X = reshape(w,m,[]);... |
github | bsxfan/meta-embeddings-master | UtU.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/UtU.m | 945 | utf_8 | 086256cb24f7c7b69d69614ceff1519b | function [prod,deriv] = UtU(w,m,n)
% This is a MV2DF. See MV2DF_API_DEFINITION.readme.
% U = reshape(w,m,n), M = U'*U, prod = M(:).
if nargin==0
test_this();
return;
end
if isempty(w)
prod = @(w)UtU(w,m,n);
return;
end
if isa(w,'function_handle')
outer = UtU([],m,n);
prod = compose_mv(outer... |
github | bsxfan/meta-embeddings-master | bsxtimes.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/bsxtimes.m | 1,144 | utf_8 | 599b65f85120f5dec9d1a62d06393c35 | function [y,deriv] = bsxtimes(w,m,n)
% This is an MV2DF
%
% w = [vec(A); vec(b) ] --> vec(bsxfun(@times,A,b)),
%
% where A is an m-by-n matrix and
% b is a 1-by-n row.
%
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w) bsxtimes(w,m,n);
return;
end
if isa(w,'function_... |
github | bsxfan/meta-embeddings-master | calibrateScores.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/calibrateScores.m | 1,095 | utf_8 | 36a554ff63a06324896dbea86ca33308 | function [y,deriv] = calibrateScores(w,m,n)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% [vec(A);scal;offs] --> vec(bsxfun(@plus,scal*A,b))
%
% This function retrieves from w:
% (i) an m-by-n matrix, 'scores'
% (ii) a scalar 'scal', and
% (iii) an m-vector, 'offset'
%
% Then it scales ... |
github | bsxfan/meta-embeddings-master | solve_AXeqB.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/solve_AXeqB.m | 1,054 | utf_8 | cff7830e92caa23fabdd038a4e53750d | function [y,deriv] = solve_AXeqB(w,m)
% This is an MV2DF.
%
% [A(:);B(:)] --> inv(A) * B
%
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)solve_AXeqB(w,m);
return;
end
if isa(w,'function_handle')
outer = solve_AXeqB([],m);
y = compose_mv(outer,w,[]);
return;
end
[A,B... |
github | bsxfan/meta-embeddings-master | logsoftmax_mv2df.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/logsoftmax_mv2df.m | 1,248 | utf_8 | 1c29a9da21772e72c800bb7be4025fe6 | function [y,deriv] = logsoftmax_mv2df(w,m)
% This is a MV2DF. See MV2DF_API_DEFINITION.readme.
%
% Does:
% (i) Reshapes w to m-by-n.
% (ii) Computes logsoftmax of each of n columns.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)logsoftmax_mv2df(w,m);
return;
end
if isa(w,'function_h... |
github | bsxfan/meta-embeddings-master | sqdist.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/sqdist.m | 1,170 | utf_8 | bfa9c639ce948848c20501fec93af59c | function [y,deriv] = sqdist(w,dim)
% This is an MV2DF. See MV2DF_API_DEFINITION.readme.
%
% If W = reshape(w,dim,n), then Y = vec of symmetric n-by-n matrix of
% 1/2 squared euclidian distances between all columns of W.
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)sqdist(w,dim);
retu... |
github | bsxfan/meta-embeddings-master | dottimes.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/dottimes.m | 884 | utf_8 | 7e8e3dedc670c1f93364db61f3d2b41d | function [y,deriv] = dottimes(w)
% This is an MV2DF
%
% [a; b ] --> a.*b
%
% where length(a) == length(b)
%
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w) dottimes(w);
return;
end
if isa(w,'function_handle')
f = dottimes([]);
y = compose_mv(f,w,[]);
return;
end
... |
github | bsxfan/meta-embeddings-master | solveChol_AXeqB.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/multivariate/solveChol_AXeqB.m | 1,391 | utf_8 | f2ded36f846a5e9904fd8299ba4a5ed1 | function [y,deriv] = solveChol_AXeqB(w,m)
% This is an MV2DF.
%
% [A(:);B(:)] --> inv(A) * B
%
% We assume A is positive definite and we solve using Choleski
if nargin==0
test_this();
return;
end
if isempty(w)
y = @(w)solveChol_AXeqB(w,m);
return;
end
if isa(w,'function_handle')
outer = solve... |
github | bsxfan/meta-embeddings-master | test_MV2DF.m | .m | meta-embeddings-master/code/Niko/matlab/fous-y-tout/bosaris_toolkit/utility_funcs/Optimization_Toolkit/MV2DF/function_library/test/test_MV2DF.m | 2,104 | utf_8 | 1f7eea1823322c4c0741c86792fc73c4 | function test_MV2DF(f,x0,do_cstep)
%id_in = identity_trans([]);
%id_out = identity_trans([]);
%f = f(id_in);
%f = id_out(f);
x0 = x0(:);
if ~exist('do_cstep','var')
do_cstep = 1;
end
if do_cstep
Jc = cstepJacobian(f,x0);
end
Jr = rstepJacobian(f,x0);
[y0,deriv] = f(x0);
m = length(y0);
n = length(x0);
J2 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.