text:
function result=mcdregres(x,y,varargin)

%MCDREGRES is a robust multivariate regression method. It can handle multiple
% response variables. The estimates are based on the robust MCD estimator of
% location and scatter (see mcdcov.m). The explanatory variables should be
% low-dimensional, otherwise robust principal component regression (rpcr.m)
% or robust partial least squares (rsimpls.m) should be applied.
%
% The MCD regression method is described in
%    Rousseeuw, P.J., Van Aelst, S., Van Driessen, K, Agullo, J. (2004),
%    "Robust multivariate regression", Technometrics, 46, pp 293-305.
%
% Required input arguments:
%            x : Data matrix of the explanatory variables
%                (n observations in rows, p variables in columns)
%            y : Data matrix of the response variables
%                (n observations in rows, q variables in columns)
%
% Optional input arguments:
%        alpha : (1-alpha) measures the amount of contamination the algorithm should
%                resist. Any value between 0.5 and 1 may be specified. (default = 0.75)
%            h : The quantile of observations whose covariance determinant will
%                be minimized.  Any value between n/2 and n may be specified.
%                The default value is 0.75*n.
%       ntrial : The number of random trial subsamples that are drawn for
%                large datasets. (default = 500)
%        plots : If equal to one, a menu is shown which allows to draw a regression
%                outlier map. (default)
%                If the input argument 'classic' is equal to one, the classical
%                plot is drawn as well.
%                If 'plots' is equal to zero, all plots are suppressed.
%                See also makeplot.m
%      classic : If equal to one, classical multivariate linear regression
%                is performed as well, see mlr.m. (default = 0)
%
% Input arguments for advanced users:
%     Hsets : Instead of random trial h-subsets (default, Hsets = []), Hsets makes it possible to give certain
%             h-subsets as input. Hsets is a matrix that contains the indices of the observations of one
%             h-subset as a row.
%
% I/O: result=mcdregres(x,y,'alpha',0.75,'ntrial',500,'plots',1,'classic',0);
%  The user should only give the input arguments that have to change their default value.
%  The name of the input arguments needs to be followed by their value.
%  The order of the input arguments is of no importance.
%
% Example: result=mcdregres(x,y,'plots',0,'alpha',0.70)
%
% The output is a structure which contains
%   result.slope     : Robust slope (matrix)
%   result.int       : Robust intercept (vector)
%   result.fitted    : Robust prediction matrix
%   result.res       : Robust residuals
%   result.cov       : Estimated variance-covariance matrix of the residuals
%   result.rsquared  : Robust R-squared value
%   result.h         : The quantile h used throughout the algorithm
%   result.Hsubsets  : A structure that contains Hopt and Hfreq:
%                        Hopt  : The subset of h points whose covariance matrix has minimal determinant,
%                                ordered following increasing robust distances.
%                        Hfreq : The subset of h points which are the most frequently selected during the whole
%                                algorithm.
%   result.rd        : Robust scores distances in x-space
%   result.resd      : Residual distances (when there are several response variables).
%                      If univariate regression is performed, it contains the standardized residuals.
%   result.cutoff    : Cutoff values for the score and residual distances
%   result.weights   : The observations with weight one are used in the reweighting,
%                      the other observations have zero weight.
%   result.flag      : The observations whose residual distance is larger than result.cutoff.resd
%                      (bad leverage points/vertical outliers) can be considered as outliers and receive
%                      a flag equal to zero.
%                      The regular observations, including the good leverage points,
%                      receive a flag 1.
%   result.class     : 'MCDREG'
%   result.classic   : If the input argument 'classic' is equal to one, this structure
%                      contains results of classical multivariate regression (see also mlr.m).
%
% This function is part of LIBRA: the Matlab Library for Robust Analysis,
% available at:
%              http://wis.kuleuven.be/stat/robust.html
%
% Original S-PLUS code by Katrien Vandriessen, implemented in MATLAB by Sabine Verboven
% Version date : 12/02/2004
% Last update: 04/08/2006

%%%%%%%%%%%%%%%%
% INITIALIZATION
%
intercept=ones(length(x),1);
geg=[x,y];
[n,m]=size(geg);
alfa=0.75;
hdefault=min(floor(2*floor((n+m+1)/2)-n+2*(n-floor((n+m+1)/2))*alfa),n);

if nargin < 3
    options.alpha=alfa;
    options.h=hdefault;
    options.ntrial=500;
    options.plots=1;
    options.classic=0;
    options.Hsets=[];
else
    default=struct('alpha',alfa,'h',hdefault,'ntrial',500,'plots',1,'classic',0,'Hsets',[]);
    list=fieldnames(default);
    options=default;
    IN=length(list);
    i=1;
    counter=1;
    %
    if nargin>2
        %
        %placing inputfields in array of strings
        %
        for j=1:nargin-2
            if rem(j,2)~=0
                chklist{i}=varargin{j};
                i=i+1;
            end
        end
        dummy=sum(strcmp(chklist,'h')+2*strcmp(chklist,'alpha'));
        switch dummy
            case 0 %no input for alpha or h so take on the default values
                options.alpha=0.75;
                options.h=floor(options.alpha*n);
            case 3
                error('Both input arguments alpha and h are provided. Only one is required.')
        end
        %
        %Checking which default parameters have to be changed
        % and keep them in the structure 'options'.
        %
        while counter<=IN
            index=strmatch(list(counter,:),chklist,'exact');
            if ~isempty(index) %in case of similarity
                for j=1:nargin-2 %searching the index of the accompanying field
                    if rem(j,2)~=0 %fieldnames are placed on odd index
                        if strcmp(chklist{index},varargin{j})
                            I=j;
                        end
                    end
                end
                options=setfield(options,chklist{index},varargin{I+1});
                index=[];
            end
            counter=counter+1;
        end
        if dummy==1
            options.alpha=options.h/n;
        elseif dummy==2
            options.h=floor(options.alpha*n);
        end
        Hsets = options.Hsets;
    end
end
%%%%%%%%
% MAIN %
[mcd_res, mcd_raw]=mcdcov(geg,'h',options.h,'plots',0,'Hsets',options.Hsets);
options.h = mcd_res.h;

%in case of an exact fit, the calculations stop at this point.
if ~isempty(mcd_res.plane)
    disp('Warning (mcdregres): The MCD covariance matrix is singular. See also mcdcov.m.')
    result=mcd_res;
    return
end

mcdreg.Hsubsets.Hopt = mcd_res.Hsubsets.Hopt;
mcdreg.Hsubsets.Hfreq = mcd_res.Hsubsets.Hfreq;

rewcovmcd=mcd_res.cov; %one-step reweighted covariance matrix
rewcenmcd=mcd_res.center; %one-step reweighted location
q=size(y,2);
p=size(x,2);

%initializing reweighted location and reweighted scatter (paragraph 5.1 of paper)
rewtmcdx=rewcenmcd(1:p)'; %column vectors!!!
rewtmcdy=rewcenmcd((p+1):m)';

rewsmcdx=rewcovmcd(1:p,1:p);
rewsmcdxy=rewcovmcd(1:p,(p+1):m);
rewsmcdyx=rewsmcdxy';
rewsmcdy=rewcovmcd((p+1):m,(p+1):m);

covyy=rewsmcdy;
covxx = rewsmcdx;
covxy = rewsmcdxy;
covyx = rewsmcdyx;
mcdreg.Sigma = [covxx, covxy ; covyx, covyy];
mcdreg.Mu = [rewtmcdx;rewtmcdy];

%reweighted beta and alpha (the columnvector [\beta^L ; \alpha^L])
rewbetamcd=[inv(rewsmcdx)*rewsmcdxy; (rewtmcdy-(rewsmcdyx*inv(rewsmcdx)*rewtmcdx))'];

%calculation of the reweighted weights based on
%the residuals calculated with the reweighted beta-coefficients
rewweights=zeros(n,1);
weights=zeros(n,1);
rewfitted=[x,intercept]*rewbetamcd(1:(p+1),:);
rewresid=y-rewfitted; %(r_i^L)
rewE=rewsmcdy-rewbetamcd(1:p,1:q)'*rewsmcdx*rewbetamcd(1:p,1:q); %reweighted scatter (\Sigma_eps^L)
for j=1:n
    if (sqrt(rewresid(j,1:q)*inv(rewE)*rewresid(j,1:q)')) <= sqrt(chi2inv(0.99,q))
        rewweights(j)=1;
    end
end

%regression reweighting part based on the reweighted observations. (paragraph 5.3 of paper)
rewclasscov=cov(geg(rewweights==1,:));
rewclasscenter=mean(geg(rewweights==1,:));

rewtmcdx=rewclasscenter(1:p)';
rewtmcdy=rewclasscenter((p+1):m)';

rewsmcdx=rewclasscov(1:p,1:p);
rewsmcdxy=rewclasscov(1:p,(p+1):m);
rewsmcdyx=rewsmcdxy';
rewsmcdy=rewclasscov((p+1):m,(p+1):m);

%regression reweighted coefficients beta and alpha ([\beta^{RL} \alpha^{RL}])
rewbetamcdrew=[inv(rewsmcdx)*rewsmcdxy; (rewtmcdy-(rewsmcdyx*inv(rewsmcdx)*rewtmcdx))'];
%regression reweighted scatter (\Sigma_eps^{RL}])
rewE2=rewsmcdy-rewbetamcdrew(1:p,1:q)'*rewsmcdx*rewbetamcdrew(1:p,1:q);
rewfittedrew=[x,intercept]*rewbetamcdrew(1:(p+1),:);
rewresidrew=y-rewfittedrew;

%%%%%%%%%%%%%%%%%
%OUTPUT STRUCTURE
%
mcdreg.covyy=rewsmcdy; %regression and location reweighted covariance matrix of responses
mcdreg.covxx = rewsmcdx;
mcdreg.covxy = rewsmcdxy;
mcdreg.covyx = rewsmcdyx;
mcdreg.Sigmarew = [mcdreg.covxx, mcdreg.covxy ; mcdreg.covyx, mcdreg.covyy];
mcdreg.Murew = [rewtmcdx;rewtmcdy];

mcdreg.x=x;
mcdreg.y=y;
mcdreg.coeffs=rewbetamcdrew; %regression and location reweighted coefficients
mcdreg.cov=rewE2; %scatter matrix based on location and regression reweighting
mcdreg.fitted=rewfittedrew; %estimated respons(es);
mcdreg.res=rewresidrew; %regression and location reweighted residuals

if(intercept)
   mcdreg.interc=1;
else
   mcdreg.interc=0;
end

% Robust distances in x-space = x-distances (rd) needed in diagnostic regression plot
if (-log(det(mcd_res.cov))/m) > 50
   mcdreg.rd='singularity';
else
   mcdreg.rd=sqrt(libra_mahalanobis(mcdreg.x,rewcenmcd(1:p),'cov',rewcovmcd(1:p,1:p)))';
end

% Robust residual distances (resd) needed in diagnostic regression plot
if q>1
   if (-log(det(mcd_res.cov))/m)>50
       mcdreg.resd='singularity';
       disp('Warning (mcdregres): A singularity ')
   else
      cen=zeros(q,1)';
      [nn,pp]=size(rewresidrew);
      mcdreg.resd=sqrt(libra_mahalanobis(rewresidrew,cen,'cov',mcdreg.cov))'; %robust distances of residuals
  end
else
    mcdreg.covarRes=sqrt(mcdreg.cov);
    mcdreg.resd=rewresidrew(:,1)/mcdreg.covarRes; %standardized residuals
end

% cutoff values
mcdreg.cutoff.rd=sqrt(chi2inv(0.975,p));
mcdreg.cutoff.resd=sqrt(chi2inv(0.975,q));
mcdreg.flag=(abs(mcdreg.resd)<=mcdreg.cutoff.resd);

% robust multivariate Rsquared
mcdreg.weights=rewweights;
Yw=y(mcdreg.weights==1,:);
cYw=mcenter(Yw);
res=rewresidrew(mcdreg.weights==1,:);
mcdreg.rsquared=1-(det(res'*res)/det(cYw'*cYw));
mcdreg.class='MCDREG';

if options.classic
    mcdreg.classic=mlr(x,y,'plots',0);
else
    mcdreg.classic=0;
end

result=struct('slope',{mcdreg.coeffs(1:p,:)}, 'int',{mcdreg.coeffs(p+1,:)}, ...
    'fitted',{mcdreg.fitted},'res',{mcdreg.res},'cov',{mcdreg.cov},'rsquared',{mcdreg.rsquared},...
    'h',{options.h},'Hsubsets',{mcdreg.Hsubsets},'rd', {mcdreg.rd},'resd',{mcdreg.resd},'cutoff',{mcdreg.cutoff},...
    'weights',{mcdreg.weights},'flag',{mcdreg.flag'},'class',{mcdreg.class},'classic',{mcdreg.classic},...
    'Mu',{mcdreg.Mu},'Sigma',{mcdreg.Sigma},'Murew',{mcdreg.Murew},'Sigmarew',{mcdreg.Sigmarew});

try
    if options.plots & options.classic
        makeplot(result,'classic',1)
    elseif options.plots
        makeplot(result)
    end
catch %output must be given even if plots are interrupted
    %> delete(gcf) to get rid of the menu
end

author: marianux

repo: ecg-kit

save_path: github-repos/MATLAB/marianux-ecg-kit


text:
function h = get_parent_stats(h)

h.dat.stat(1).V = [];
for i = 1:length(h.dat.stat)
    if ~isfield(h.dat.stat(i), 'V') || isempty(h.dat.stat(i).V)
        h.dat.stat(i).V         = sum([h.dat.stat(i).region.V]);
        h.dat.stat(i).mrs = min(h.dat.stat(i).mrs, 1e4);
       % this is a parent region
        h.dat.stat(i).parent    = i;
        h.dat.stat(i).VperPix   = h.dat.stat(i).V/h.dat.stat(i).npix;
        h.dat.stat(i).npix_res  = numel(h.dat.stat(i).ipix);
        h.dat.stat(i).nregions  = numel(h.dat.stat(i).region);
    end
end

nreg = [h.dat.stat.nregions];
npix_res = [h.dat.stat.npix_res];
npix = [h.dat.stat.npix];

VperPix = [h.dat.stat.VperPix];
mrs = [h.dat.stat.mrs]./[h.dat.stat.mrs0];
iparent = [h.dat.stat.parent];

h.dat.cl.nreg       = nreg(iparent);
h.dat.cl.npix_res   = npix_res(iparent);
h.dat.cl.npix_par   = npix(iparent);
h.dat.cl.VperPix    = VperPix(iparent);
h.dat.cl.mrs_parent = mrs(iparent);

author: cortex-lab


text:
function [ehmm,XW] = updateW_ehmm(ehmm,Gamma,residuals,XX,XXGXX,Tfactor,lambda)

if nargin < 6, Tfactor = 1; end
if nargin < 7, lambda = []; end

XW = zeros(size(residuals,1),size(residuals,2),ehmm.K+1);
[ehmm,XW(:,:,1:ehmm.K)] = updateW(ehmm,Gamma,residuals,XX,XXGXX,...
    Tfactor,1:ehmm.K,lambda);
XW(:,:,ehmm.K+1) = XX * ehmm.state(end).W.Mu_W;

K = size(Gamma,2); ndim = size(ehmm.train.S,1); np = size(XX,2);
for k = 1:K
    ind = (k-1)*np + (1:np);
    for n = 1:ndim
        ehmm.state_shared(n).iS_W(ind,ind) = ehmm.state(k).W.iS_W;
        ehmm.state_shared(n).S_W(ind,ind) = ehmm.state(k).W.S_W;
        ehmm.state_shared(n).Mu_W(ind) = ehmm.state(k).W.Mu_W;
    end
%     if ndim == 1
%         ehmm.state(k).W.S_W = reshape(ehmm.state(k).W.S_W,[1 np np]);
%         ehmm.state(k).W.iS_W = reshape(ehmm.state(k).W.iS_W,[1 np np]);
%     end
end

% setstateoptions;
% K = size(Gamma,2); ndim = size(ehmm.train.S,1); np = size(XX,2);
%
% Gamma = [Gamma prod(1-Gamma,2) ];
% Gamma = rdiv(Gamma,sum(Gamma,2));
%
% for k = 1:K % 1:K+1 for updating baseline as well
%
%     G = Gamma(:,k);
%     XG = bsxfun(@times, XX, G);
%     gram = XG' * XX;
%     XR = XG' * residuals;
%
%     for n = 1:ndim
%
%         if ~regressed(n), continue; end
%         ndim_n = sum(S(:,n)>0);
%
%         if ~isempty(lambda)
%             regterm = lambda * eye(np);
%             c = 1;
%         else
%             regterm = [];
%             if ~train.zeromean, regterm = ehmm.state(k).prior.Mean.iS(n); end
%             if ehmm.train.order > 0
%                 alphaterm = ...
%                     repmat( (ehmm.state(k).alpha.Gam_shape ./  ...
%                     ehmm.state(k).alpha.Gam_rate), ndim_n, 1);
%                 if ndim==1
%                     regterm = [regterm; alphaterm(:) ];
%                 else
%                     sigmaterm = repmat(ehmm.state(k).sigma.Gam_shape(S(:,n),n) ./ ...
%                         ehmm.state(k).sigma.Gam_rate(S(:,n),n), length(orders), 1);
%                     regterm = [regterm; sigmaterm .* alphaterm(:) ];
%                 end
%             end
%             c = ehmm.Omega.Gam_shape / ehmm.Omega.Gam_rate(n);
%             regterm = diag(regterm);
%         end
%
%         iS_W = regterm(Sind(:,n),Sind(:,n)) + Tfactor * c * gram(Sind(:,n),Sind(:,n));
%         iS_W = (iS_W + iS_W') / 2;
%         S_W = inv(iS_W);
%         Mu_W = Tfactor * c * S_W * XR(Sind(:,n),n);
%
%         ehmm.state(k).W.iS_W(n,:,:) = iS_W;
%         ehmm.state(k).W.S_W(n,:,:) = S_W;
%         ehmm.state(k).W.Mu_W(:,n) = Mu_W;
%
%         ind = (k-1)*np + (1:np);
%         ehmm.state_shared(n).iS_W(ind,ind) = iS_W;
%         ehmm.state_shared(n).S_W(ind,ind) = S_W;
%         ehmm.state_shared(n).Mu_W(ind) = Mu_W;
%
%     end
%
% end

end

author: OHBA-analysis

repo: HMM-MAR


text:
%% Kruskal tensors
% Kruskal format is a decomposition of a tensor X as the sum of the outer
% products a the columns of matrices. For example, we might write
%
% $${\mathcal X} = \sum_r a_r \circ b_r \circ c_r$$
%
% where a subscript denotes column index and a circle denotes outer
% product. In other words, the tensor X is built frm the columns of the
% matrices A,B, and C. It's often helpful to explicitly specify a weight
% for each outer product, which we do here:
%
% $${\mathcal X} = \sum_r \lambda_r \; a_r \circ b_r \circ c_r$$
%
% The |ktensor| class stores the components of the tensor X and can perform
% many operations, e.g., |ttm|, without explicitly forming the tensor X.

%% Kruskal tensor format via ktensor
% Kruskal format stores a tensor as a sum of rank-1 outer products. For
% example, consider a tensor of the following form.
%
% $$X = a_1 \circ b_1 \circ c_1 + a_2 \circ b_2 \circ c_2$$
%
% This can be stored in Kruskal form as follows.
rand('state',0);
A = rand(4,2); %<-- First column is a_1, second is a_2.
B = rand(3,2); %<-- Likewise for B.
C = rand(2,2); %<-- Likewise for C.
X = ktensor({A,B,C}) %<-- Create the ktensor.
%%
% For Kruskal format, there can be any number of matrices, but every matrix
% must have the same number of columns. The number of rows can vary.
Y = ktensor({rand(4,1),rand(2,1),rand(3,1)}) %<-- Another ktensor.
%% Specifying weights in a ktensor
% Weights for each rank-1 tensor can be specified by passing in a
% column vector.  For example,
%
% $$X = \lambda_1 \; a_1 \circ b_1 \circ c_1 + \lambda_2 \; a_2 \circ b_2 \circ c_2$$
%
lambda = [5.0; 0.25]; %<-- Weights for each factor.
X = ktensor(lambda,{A,B,C}) %<-- Create the ktensor.
%% Creating a one-dimensional ktensor
Y = ktensor({rand(4,5)}) %<-- A one-dimensional ktensor.
%% Constituent parts of a ktensor
X.lambda %<-- Weights or multipliers.
%%
X.U %<-- Cell array of matrices.
%% Creating a ktensor from its constituent parts
Y = ktensor(X.lambda,X.U) %<-- Recreate X.
%% Creating an empty ktensor
Z = ktensor %<-- Empty ktensor.
%% Use full or tensor to convert a ktensor to a tensor
full(X) %<-- Converts to a tensor.
%%
tensor(X) %<-- Same as above.
%% Use double to convert a ktensor to a multidimensional array
double(X) %<-- Converts to an array.
%% Use tendiag or sptendiag to convert a ktensor to a ttensor.
% A ktensor can be regarded as a ttensor with a diagonal core.
R = length(X.lambda);  %<-- Number of factors in X.
core = tendiag(X.lambda, repmat(R,1,ndims(X))); %<-- Create a diagonal core.
Y = ttensor(core, X.u) %<-- Assemble the ttensor.
%%
norm(full(X)-full(Y)) %<-- They are the same.
%%
core = sptendiag(X.lambda, repmat(R,1,ndims(X))); %<-- Sparse diagonal core.
Y = ttensor(core, X.u) %<-- Assemble the ttensor
%%
norm(full(X)-full(Y)) %<-- They are the same.
%% Use ndims and size for the dimensions of a ktensor
ndims(X) %<-- Number of dimensions.
%%
size(X) %<-- Row vector of the sizes.
%%
size(X,2) %<-- Size of the 2nd mode.
%% Subscripted reference for a ktensor
X(1,1,1) %<-- Assemble the (1,1,1) element (requires computation).
%%
X.lambda(2) %<-- Weight of 2nd factor.
%%
X.U{2} %<-- Extract a matrix.
%%
X{2} %<-- Same as above.
%% Subscripted assignment for a ktensor
X.lambda = ones(size(X.lambda)) %<-- Insert new multipliers.
%%
X.lambda(1) = 7 %<-- Change a single element of lambda.
%%
X{3}(1:2,1) = [1;1] %<-- Change the matrix for mode 3.
%% Use end for the last array index.
X(3:end,1,1)  %<-- Calculated X(3,1,1) and X((4,1,1).
%%
X(1,1,1:end-1)  %<-- Calculates X(1,1,1).
%%
X{end}  %<-- Or use inside of curly braces. This is X{3}.
%% Adding and subtracting ktensors
% Adding two ktensors is the same as concatenating the matrices
X = ktensor({rand(4,2),rand(2,2),rand(3,2)}) %<-- Data.
Y = ktensor({rand(4,2),rand(2,2),rand(3,2)}) %<-- More data.
%%
Z = X + Y %<-- Concatenates the factor matrices.
%%
Z = X - Y %<-- Concatenates as with plus, but changes the weights.
%%
norm( full(Z) - (full(X)-full(Y)) ) %<-- Should be zero.
%% Basic operations with a ktensor
+X %<-- Calls uplus.
%%
-X %<-- Calls uminus.
%%
5*X %<-- Calls mtimes.
%% Use permute to reorder the modes of a ktensor
permute(X,[2 3 1]) %<-- Reorders modes of X
%% Use arrange to normalize the factors of a ktensor
% The function |arrange| normalizes the columns of the factors and then
% arranges the rank-one pieces in decreasing order of size.
X = ktensor({rand(3,2),rand(4,2),rand(2,2)})  % <-- Unit weights.
%%
arrange(X) %<-- Normalized a rearranged.
%% Use fixsigns for sign indeterminacies in a ktensor
% The largest magnitude entry for each factor is changed to be
% positive provided that we can flip the signs of _pairs_ of vectors in
% that rank-1 component.
Y = X;
Y.u{1}(:,1) = -Y.u{1}(:,1);  % switch the sign on a pair of columns
Y.u{2}(:,1) = -Y.u{2}(:,1)
%%
fixsigns(Y)
%% Use ktensor to store the 'skinny' SVD of a matrix
A = rand(4,3) %<-- A random matrix.
%%
[U,S,V] = svd(A,0); %<-- Compute the SVD.
X = ktensor(diag(S),{U,V}) %<-- Store the SVD as a ktensor.
%%
double(X) %<-- Reassemble the original matrix.
%% Displaying a ktensor
disp(X) %<-- Displays the vector lambda and each factor matrix.
%% Displaying data
% The |datadisp| function allows the user to associate meaning to the modes
% and display those modes with the most meaning (i.e., corresponding to the
% largest values).
X = ktensor({[0.8 0.1 1e-10]',[1e-5 2 3 1e-4]',[0.5 0.5]'}); %<-- Create tensor.
X = arrange(X) %<-- Normalize the factors.
%%
labelsDim1 = {'one','two','three'}; %<-- Labels for mode 1.
labelsDim2 = {'A','B','C','D'}; %<-- Labels for mode 2.
labelsDim3 = {'on','off'}; %<-- Labels for mode 3.
datadisp(X,{labelsDim1,labelsDim2,labelsDim3}) %<-- Display.

author: andrewssobral

repo: mtt

save_path: github-repos/MATLAB/andrewssobral-mtt


text:
function [P,x] = polytope(X,options)
% polytope  Converts constraints to polytope object
%
% P     = polytope(F)
% [P,x] = polytope(F)
%
% P : polytope object (Requires the Multi-parametric Toolbox)
% x : sdpvar object defining the variables in the polytope P.H*x<=P.K
% F : Constraint object with linear inequalities
%
% See also sdpvar/polytope

if nargin < 2
    options = sdpsettings;
elseif isempty(options)
    options = sdpsettings;
end

[p,recoverdata,solver,diagnostic,F] = compileinterfacedata(X,[],[],[],options,0);

if any(p.K.q) || any(p.K.s) || any(p.variabletype)
  error('Polytope can only be applied to MILP-representable constraints.')
end

if any(p.K.f)
    try
        [P,x] = polyhedron(X,options);
        return
    catch
        disp('MPT does not support polytopes with empty interior')
        disp('Note that these equality constraints might have been generated internally by YALMIP')
        error('Functionality not yet supported')
    end
end

if isempty(p.binary_variables) && isempty(p.integer_variables)
    P = polytope(-p.F_struc(:,2:end),p.F_struc(:,1));
    x = recover(p.used_variables);
else
    nBin = length(p.binary_variables);
    [pBinary,removeEQ,removeLP] = extractOnly(p,p.binary_variables);
    p.F_struc = [p.F_struc(removeEQ,:);p.F_struc(p.K.f+removeLP,:)];
    p.K.f = length(removeEQ);
    p.K.l = length(removeLP);
    p.used_variables(p.binary_variables)=[];
    x = recover(p.used_variables);

    P = [];
    for i = 0:2^nBin-1
        comb = dec2decbin(i,nBin);
        if checkfeasiblefast(pBinary,comb(:),1e-6)
            pi = p;
            H = -p.F_struc(:,2:end);% Hx < K
            K = p.F_struc(:,1);
            K = K-H(:,p.binary_variables)*comb(:);
            H(:,p.binary_variables)=[];
            P = [P polytope(H,K)];
        end
    end
end

function pLP = extractLP(p)
pLP = p;
pLP.F_struc = pLP.F_struc(1:p.K.f+p.K.l,:);
pLP.K.q = 0;
pLP.K.s = 0;

function [pRed,removeEQ,removeLP] = extractOnly(p,these)
pRed = p;
p.F_struc(:,1+these) = 0;

removeEQ = find(any(p.F_struc(1:pRed.K.f,2:end),2));
removeLP = find(any(p.F_struc(1+pRed.K.f:end,2:end),2));
pRed.F_struc(pRed.K.f+removeLP,:)=[];
pRed.F_struc(removeEQ,:)=[];
pRed.K.f = pRed.K.f - length(removeEQ);
pRed.K.l = pRed.K.l - length(removeLP);
pRed.F_struc = pRed.F_struc(:,[1 1+these]);
pRed.lb = pRed.lb(these);
pRed.ub = pRed.ub(these);

author: yalmip

repo: YALMIP

save_path: github-repos/MATLAB/yalmip-YALMIP


text:
function [E,J]=SynthMeasWatsonSHCylSingleRadTortIsoV_GPD_B0(x, protocol, fibredir, roots)
% Substrate: Impermeable cylinders with one radius in a homogeneous background.
% Orientation distribution: Watson's distribution with SH approximation
% Signal approximation: Gaussian phase distribution.
% Notes: This version estimates the hindered diffusivity from the free diffusivity
% and packing density using Szafer et al's tortuosity model for randomly
% packed cylinders.
% This version includes an isotropic diffusion compartment with its own
% diffusivity.
% Includes a free parameter for the measurement at b=0.
%
% [E,J]=SynthMeasWatsonSHCylSingleRadTortIsoV_GPD_B0(x, protocol, fibredir, roots)
% returns the measurements E according to the model and the Jacobian J of the
% measurements with respect to the parameters.  The Jacobian does not
% include derivates with respect to the fibre direction.
%
% x is the list of model parameters in SI units:
% x(1) is the volume fraction of the intracellular space.
% x(2) is the free diffusivity of the material inside and outside the cylinders.
% x(3) is the radius of the cylinders.
% x(4) is the concentration parameter of the Watson's distribution.
% x(5) is the volume fraction of the isotropic compartment.
% x(6) is the diffusivity of the isotropic compartment.
% x(7) is the measurement at b=0.
%
% protocol is the object containing the acquisition protocol.
%
% fibredir is a unit vector along the symmetry axis of the Watson's
% distribution.  It must be in Cartesian coordinates [x y z]' with size [3 1].
%
% roots contains solutions to the Bessel function equation from function
% BesselJ_RootsCyl.
%
% author: Gary Hui Zhang (gary.zhang@ucl.ac.uk)
%

S0 = x(7);

% Call the other function to get normalized measurements.
if(nargout == 1)
    Enorm=SynthMeasWatsonSHCylSingleRadTortIsoV_GPD(x, protocol, fibredir, roots);
else
    [Enorm,Jnorm]=SynthMeasWatsonSHCylSingleRadTortIsoV_GPD(x, protocol, fibredir, roots);
end

E = Enorm*S0;

if(nargout>1)
    J = Jnorm*S0;
    [meas, params] = size(J);
    J(:,params+1) = Enorm;
end

author: qMRLab

repo: qMRLab

save_path: github-repos/MATLAB/qMRLab-qMRLab


text:
function outputImage = mod(this, divisor, varargin)
% Computes modulus of division with divisor
%
%   Y = MrImage();
%   modY = Y.mod(divisor)
%   modY = mod(Y);
%
%
% This is a method of class MrImage.
%
% IN
%
% OUT
%   outputImage             value modulo
%
% EXAMPLE
%   modY = mod(Y, 2*pi)
%
%   See also MrImage MrImage.perform_unary_operation

% Author:   Saskia Klein & Lars Kasper
% Created:  2014-11-29
% Copyright (C) 2014 Institute for Biomedical Engineering
%                    University of Zurich and ETH Zurich
%
% This file is part of the TAPAS UniQC Toolbox, which is released
% under the terms of the GNU General Public Licence (GPL), version 3.
% You can redistribute it and/or modify it under the terms of the GPL
% (either version 3 or, at your option, any later version).
% For further details, see the file COPYING or
%  <http://www.gnu.org/licenses/>.
%

outputImage = this.perform_unary_operation(@(x) mod(x, divisor), varargin{:});

author: translationalneuromodeling

repo: tapas


text:
clc;
clearvars;
close all;
rng default;

basis = orth(randn(3, 2))
basis'*basis

rng(10);
A = orth(randn(3, 2))
e1 = A(:, 1);
e2 = A(:, 2);
corners = [e1+e2, e2-e1, -e1-e2, -e2+e1];
spx.graphics.figure.full_screen;
fill3(corners(1,:),corners(2,:),corners(3,:),'r');
grid on;
hold on;
alpha(0.3);
quiver3(0, 0, 0, e1(1), e1(2), e1(3), 'color', 'r');
quiver3(0, 0, 0, e2(1), e2(2), e2(3), 'color', 'r');
saveas(gcf, 'images/random_subspace_a_3d.png');
rng(30);
B = orth(randn(3, 2));
e1 = B(:, 1);
e2 = B(:, 2);
corners = [e1+e2, e2-e1, -e1-e2, -e2+e1];
fill3(corners(1,:),corners(2,:),corners(3,:),'g');
alpha(0.3);
quiver3(0, 0, 0, e1(1), e1(2), e1(3), 'color', spx.graphics.rgb('DarkGreen'));
quiver3(0, 0, 0, e2(1), e2(2), e2(3), 'color', spx.graphics.rgb('DarkGreen'));
saveas(gcf, 'images/random_subspace_a_b_3d.png');

% subspace dimension
D = 4;
% ambient dimension
M = 10;
% Number of subspaces
K = 2;
import spx.data.synthetic.subspaces.random_subspaces;
bases = random_subspaces(M, K, D);
A = bases{1};
B = bases{2};
G = A' * B
sigmas = svd(G)'
largest_product = sigmas(1)
smallest_angle_rad  = acos(largest_product)
smallest_angle_deg = rad2deg(smallest_angle_rad)

author: indigits

repo: sparse-plex


text:
function x = gpl_curve ( filename, m, n )

%*****************************************************************************80
%
%% GPL_CURVE reads a GPL file of 1D, 2D or 3D data.
%
%  Discussion:
%
%    The GPL file is assumed to consist of a single list of 1D, 2D or 3D data.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 May 2014
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, string FILENAME, the name of the input file.
%
%    Input, integer M, the spatial dimension.
%
%    Input, integer N, the number of data values.
%
%    Output, real X(M,N), the data.
%
  x = zeros ( m, n );

  file = fopen ( filename, 'rt' );

  line_num = 0;

  for j = 1 : n

    while ( 1 )

      line_num = line_num + 1;
      s = fgetl ( file );
%
%  Unexpected end of file?
%
      if ( ~ ischar ( s ) )
        fprintf ( 1, '\n' );
        fprintf ( 1, 'GPL_CURVE - Fatal error!\n' );
        fprintf ( 1, '  Unexpected end of file reading line %d\n', line_num );
        error ( 'GPL_CURVE - Fatal error!\n' );
      end
%
%  Unexpected empty line?
%
      if ( length ( s ) < 1 )
        fprintf ( 1, '\n' );
        fprintf ( 1, 'GPL_CURVE - Fatal error!\n' );
        fprintf ( 1, '  Unexpected empty record, reading line %d\n', line_num );
        error ( 'GPL_CURVE - Fatal error!\n' );
      end
%
%  Comments are OK.
%
      if ( s(1) ~= '#' )
        break
      end

    end
%
%  Otherwise, read X
%
    [ values, count ] = sscanf ( s, '%f' );
%
%  Failed to read M things?
%
    if ( count ~= m )
      fprintf ( 1, '\n' );
      fprintf ( 1, 'GPL_CURVE - Fatal error!\n' );
      fprintf ( 1, '  Did not get %d data items on line %d\n', m, line_num );
      error ( 'GPL_CURVE - Fatal error!\n' );
    end

    x(1:m,j) = values(1:m)';

  end

  fclose ( file );

  return
end

author: johannesgerer

repo: jburkardt-m


text:
function pf = loadPoleFigure_popla(fname,varargin)
% import data fom Popla file
%
% Syntax
%   pf = loadPoleFigure_popla(fname)
%
% Input
%  fname    - filename
%
% Output
%  pf - vector of @PoleFigure
%
% See also
% ImportPoleFigureData loadPoleFigure

fid = efopen(fname);

ipf = 1;

try
  while ~feof(fid)

    try

      % read header
      % first line --> comments
      comment = fgetl(fid);
      % second line
      s = fgetl(fid);

      p = @(k) s(5*k+1:5*k+5);
      n = @(k) str2num(p(k));
      m = @(k) str2num(s(26+(k*2:k*2+1)));

      % Miller indice
      allH{ipf} = string2Miller(p(0));

      dtheta = n(1); assert(dtheta > 0 && dtheta < 90);
      mtheta = n(2); assert(mtheta > 0 && mtheta <= 180);
      drho = n(3); assert(drho > 0 && drho < 90);
      mrho = n(4); assert(mrho > 0 && mrho <= 360);
      shifttheta = m(0); assert(shifttheta == 1 || shifttheta == 0);
      shiftrho = m(1); assert(abs(shiftrho) == 1 || shiftrho == 0);
      iper = [m(2) m(3) m(4)]; assert(all(abs(iper)>0) && all(abs(iper)<4));
      scaling = n(7); assert(scaling>0);
      bg = n(8);

      % generate specimen directions
      theta = (dtheta*~shifttheta/2:dtheta:mtheta)*degree;
      rho = (drho*~shiftrho/2:drho:mrho-drho/(1+~shiftrho))*degree;
      allR{ipf} = regularS2Grid('theta',theta,'rho',rho,'antipodal');

      % read data
      % TODO there are some data files that have 18 and some that have 19
      % colums - make interface working for those!
      d = [];
      l = fgetl(fid);
      while ~isempty(l) && ischar(l) %length(d) < length(r)
        l = l(1+mod(numel(l),4):end);
        data = str2num(reshape(l,4,[])');
        d = [d; data(1:18) ./ scaling];
        l = fgetl(fid);
      end

      % restrict data to specified domain
      allI{ipf} = double(reshape(d(1:length(allR{ipf})),size(allR{ipf})));

      ipf = ipf+1;
    catch %#ok<CTCH>
      if ~exist('pf','var')
        interfaceError(fname,fid);
      end
    end
  end

  % generate Polefigure
  pf = PoleFigure(allH,allR,allI,varargin{:});
catch
  interfaceError(fname,fid);
end

fclose(fid);

author: mtex-toolbox

repo: mtex

save_path: github-repos/MATLAB/mtex-toolbox-mtex


text:
function Sigma = UpdateCMA(X,Sigma,gen)
% Update the CMA model

%------------------------------- Copyright --------------------------------
% Copyright (c) 2023 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB platform
% for evolutionary multi-objective optimization [educational forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------

    n = size(X,2);

    %% Calculate the CMA parameters
    mu    = 4 + floor(3*log(n));
    mu1   = floor(mu/2);
    w     = log((mu+1)/2) - log(1:mu1);
    w     = w./sum(w);
    mueff = 1./sum(w.^2);
    cs    = (mueff+2)./(n+mueff+5);
    ds    = 1 + 2*max(0,sqrt((mueff-1)./(n+1))-1) + cs;
    cc    = (4+mueff/n)./(n+4+2*mueff/n);
    c1    = 2./((n+1.3).^2+mueff);
    cmu   = min(1-c1,2*(mueff-2+1/mueff)./((n+2).^2+mueff)); % Modified
    ENI   = sqrt(n)*(1-1/4/n+1/21/n^2);

    %% Update the CMA model
    y           = (X(1:mu1,:)-repmat(Sigma.x,mu1,1))/Sigma.sigma;
    yw          = w*y;
    Sigma.x     = Sigma.x + Sigma.sigma*yw;
    Sigma.ps    = (1-cs)*Sigma.ps + sqrt(cs*(2-cs)*mueff)*Sigma.C^(-1/2)*yw';
    hs          = norm(Sigma.ps)./sqrt(1-(1-cs).^(2*(gen+1))) < (1.4+2/(n+1))*ENI;
    deltahs     = 1 - hs; % Modified
    Sigma.pc    = (1-cc)*Sigma.pc + hs*sqrt(cc*(2-cc)*mueff)*yw;
    Sigma.sigma = Sigma.sigma*exp(cs/ds*(norm(Sigma.ps)/ENI-1));
    Sigma.C     = (1-c1-cmu)*Sigma.C + c1*(Sigma.pc'*Sigma.pc+deltahs*Sigma.C) + cmu*y'*diag(w)*y;
    Sigma.C     = triu(Sigma.C) + triu(Sigma.C,1)'; % Enforce symmetry

    %% Reset the CMA model if possible
    [B,D] = eig(Sigma.C);
    diagD = diag(D);
    diagC = diag(Sigma.C);
    ConditionCov  = max(diagD) > 1e14*min(diagD);
    NoEffectCoord = any(Sigma.x==Sigma.x+0.2*Sigma.sigma*sqrt(diagC)');
    NoEffectAxis  = all(Sigma.x==Sigma.x+0.1*Sigma.sigma*sqrt(diagD(mod(gen,n)+1))*B(:,mod(gen,n)+1)');
    TolXUp        = any(Sigma.sigma*sqrt(diagC)>1e4);
    if ConditionCov || NoEffectCoord || NoEffectAxis || TolXUp
        Sigma = struct('s',[],'x',[],'sigma',0.5,'C',eye(n),'pc',0,'ps',0);
    end
end

author: BIMK

repo: PlatEMO

save_path: github-repos/MATLAB/BIMK-PlatEMO


text:
function [ fea, out ] = ex_swirl_flow1( varargin )
%EX_SWIRL_FLOW1 2D Axisymmetric laminar swirl flow.
%
%   [ FEA, OUT ] = EX_SWIRL_FLOW1( VARARGIN ) Axisymmetric swirl for in tubular region
%   where the inner cylindrical wall is rotating. Comparison with analytical solution.
%
%   Accepts the following property/value pairs.
%
%       Input       Value/{Default}        Description
%       -----------------------------------------------------------------------------------
%       rho         scalar {2}             Density
%       miu         scalar {3}             Molecular/dynamic viscosity
%       omega       scalar {5}             Angular rotational frequency (of inner wall)
%       ri          scalar {0.5}           Inner radius
%       ro          scalar {1.5}           Outer radius
%       h           scalar {3}             Height of cylinder
%       sf_u        string {sflag1}        Shape function for velocity
%       sf_p        string {sflag1}        Shape function for pressure
%       iplot       scalar 0/{1}           Plot solution (=1)
%                                                                                .
%       Output      Value/(Size)           Description
%       -----------------------------------------------------------------------------------
%       fea         struct                 Problem definition struct
%       out         struct                 Output struct

% Copyright 2013-2022 Precise Simulation, Ltd.

cOptDef = { 'rho',      2;
            'miu',      3;
            'omega',    5;
            'ri',       0.5
            'ro',       1.5;
            'h',        3;
            'sf_u',     'sflag1';
            'sf_p',     'sflag1';
            'iphys',    1;
            'iplot',    1;
            'tol',      [];
            'fid',      1 };
[got,opt] = parseopt(cOptDef,varargin{:});
fid       = opt.fid;

% Geometry and grid generation.
fea.sdim = {'r' 'z'};

ri = opt.ri;   % Inner radius.
ro = opt.ro;   % Outer radius.
h  = opt.h;    % Height of cylinder.
fea.geom.objects = { gobj_rectangle(ri,ro,-h/2,h/2) };

fea.grid = gridgen( fea, 'hmax', (ro-ri)/8, 'fid', fid );

% Equation definition.
if ( opt.iphys==1 )

  fea = addphys(fea,@swirlflow);
  fea.phys.sw.eqn.coef{1,end} = { opt.rho };
  fea.phys.sw.eqn.coef{2,end} = { opt.miu };
  fea.phys.sw.sfun            = [ repmat( {opt.sf_u}, 1, 3 ) {opt.sf_p} ];
  fea.phys.sw.bdr.sel = [5 1 5 2];
  fea.phys.sw.bdr.coef{2,end}{2,4} = opt.omega*ri;

  fea = parsephys(fea);

else

  opt.sf_u = 'sflag2';
  opt.sf_p = 'sflag1';

  fea.dvar = { 'u', 'v', 'w', 'p' };
  fea.sfun = [ repmat( {opt.sf_u}, 1, 3 ) {opt.sf_p} ];
  c_eqn    = { 'r*rho*u'' - r*miu*(2*ur_r + uz_z  +   wr_z) + r*rho*(u*ur_t + w*uz_t) + r*p_r     = r*Fr - 2*miu/r*u_t + p_t + rho*v*v_t';
               'r*rho*v'' - r*miu*(  vr_r + vz_z) + miu*v_r + r*rho*(u*vr_t + w*vz_t) + rho*u*v_t = r*Fth + miu*(v_r - 1/r*v_t)';
               'r*rho*w'' - r*miu*(  wr_r + uz_r  + 2*wz_z) + r*rho*(u*wr_t + w*wz_t) + r*p_z     = r*Fz';
               'r*ur_t + r*wz_t + u_t = 0' };
  fea.eqn = parseeqn( c_eqn, fea.dvar, fea.sdim );

  fea.coef = { 'rho', opt.rho ;
               'miu', opt.miu ;
               'Fr',  0 ;
               'Fth', 0 ;
               'Fz',  0 };

  % Boundary conditions.
  fea.bdr.d = { []  0 [] 0 ;
                []  0 [] opt.omega*ri ;
                0   0  0 0 ;
                [] [] [] [] };
  fea.bdr.n = cell(size(fea.bdr.d));

  % Fix pressure at p([r,z]=[ro,h/2]) = 0.
  [~,ix_p] = min( sqrt( (fea.grid.p(1,:)-ro).^2 + (fea.grid.p(2,:)-h/2).^2) );
  fea.pnt = struct( 'type',  'constr', ...
                    'index', ix_p, ...
                    'dvar',  'p', ...
                    'expr',  '0' );
end

% Parse and solve problem.
fea = parseprob( fea );
fea.sol.u = solvestat( fea, 'fid', fid );

% Exact (analytical) solution.
a = - opt.omega*ri^2 / (ro^2-ri^2);
b =   opt.omega*ri^2*ro^2 / (ro^2-ri^2);
v_th_ex = @(r,a,b) a.*r + b./r;

% Postprocessing.
if( opt.iplot )
  subplot(1,2,1)
  postplot( fea, 'surfexpr', 'sqrt(u^2+v^2+w^2)', 'isoexpr', 'v' )

  subplot(1,2,2)
  hold on
  grid on
  r = linspace( ri, ro, 100 );
  v_th = evalexpr( 'v', [r;zeros(1,length(r))], fea );
  plot( r, v_th, 'b--' )
  r = linspace( ri, ro, 10 );
  plot( r, v_th_ex(r,a,b), 'r.' )
  legend( 'Computed solution', 'Exact solution')
  xlabel( 'Radius, r')
  ylabel( 'Angular velocity, v')
end

% Error checking.
if( ~got.tol )
  if( opt.sf_u(end) == '2' )
    opt.tol = 0.01;
  else
    opt.tol = 0.16;
  end
end
r = linspace( ri, ro, 100 );
v_th = evalexpr( 'v', [r;zeros(1,length(r))], fea )';
out.err  = norm( v_th - v_th_ex(r,a,b) );
out.pass = out.err < opt.tol;

if( nargout==0 )
  clear fea out
end

author: precise-simulation

repo: featool-multiphysics


text:
Network Resnet50 {
	Layer CONV1 {
		Type: CONV
		Stride { X: 2, Y: 2 }
		Dimensions { K: 64, C: 3, R: 7, S: 7, Y:224, X:224 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV2_1_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 64, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV2_1_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 64, R: 3, S: 3, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV2_1_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 64, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV2_1_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV2_2_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_2_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 64, R: 3, S: 3, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_2_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 64, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_2_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_3_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_3_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 64, C: 64, R: 3, S: 3, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_3_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 64, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV2_3_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_1_1 {
		Type: CONV
		Stride { X: 2, Y: 2 }
		Dimensions { K: 128, C: 256, R: 1, S: 1, Y: 56, X: 56 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_1_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 128, R: 3, S: 3, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_1_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 128, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_1_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 512, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_2_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 256, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_2_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 128, R: 3, S: 3, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_2_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 128, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_1_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 512, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_3_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 256, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_3_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 128, R: 3, S: 3, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_3_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 128, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_3_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 512, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_4_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 256, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_4_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 128, C: 128, R: 3, S: 3, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_4_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 128, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV3_4_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 512, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_1_1 {
		Type: CONV
		Stride { X: 2, Y: 2 }
		Dimensions { K: 256, C: 512, R: 1, S: 1, Y: 28, X: 28 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV4_1_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_1_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_1_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_2_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_2_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_2_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_2_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_3_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_3_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_3_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_3_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_4_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_4_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}
	}

	Layer CONV4_4_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_4_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_5_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_5_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_5_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_5_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_6_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_6_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 256, C: 256, R: 3, S: 3, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_6_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1024, C: 256, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV4_6_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_1_1 {
		Type: CONV
		Stride { X: 2, Y: 2 }
		Dimensions { K: 512, C: 1024, R: 1, S: 1, Y: 14, X: 14 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_1_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 512, R: 3, S: 3, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_1_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 2048, C: 512, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_1_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 2048, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_2_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 2048, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_2_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 512, R: 3, S: 3, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_2_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 2048, C: 512, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_2_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 2048, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_3_1 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 2048, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_3_2 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 512, C: 512, R: 3, S: 3, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_3_3 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 2048, C: 512, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer CONV5_3_Residual {
		Type: DSCONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1, C: 2048, R: 1, S: 1, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

	Layer FC1000 {
		Type: CONV
		Stride { X: 1, Y: 1 }
		Dimensions { K: 1000, C: 2048, R: 7, S: 7, Y: 7, X: 7 }
		Dataflow {
			TemporalMap (1,1) K;
			TemporalMap (Sz(R), 1) Y;
			TemporalMap (Sz(S), 1) X;
			TemporalMap (Sz(R), Sz(R)) R;
			TemporalMap (Sz(S), Sz(S)) S;
			SpatialMap (1,1) C;
		}

	}

}

author: maestro-project

repo: maestro


text:
function bc = specific_bc(xbd,ybd)
%zero_bc   zero boundary condition
%   bc = specific_bc(xbd,ybd);
%   input
%          xbd          x boundary coordinate vector
%          ybd          y boundary coordinate vector
%   IFISS function: DJS; 28 February 2005.
% Copyright (c) 2005 D.J. Silvester, H.C. Elman, A. Ramage
bc=zeros(size(xbd));
return


text:
%kcpLuvstartoRGBNTSC 'converts an image from L*u*v* to RGB NTSC '
% This MatLab function was automatically generated by a converter (KhorosToMatLab) from the Khoros cpLuvstartoRGBNTSC.pane file
%
% Parameters:
% InputFile: i 'Input ', required: 'First Input data object'
% OutputFile: o 'Output', required: 'Resulting output data object'
%
% Example: o = kcpLuvstartoRGBNTSC(i, {'i','';'o',''})
%
% Khoros helpfile follows below:
%
%  PROGRAM
% cpLuvstartoRGBNTSC - converts an image from L*u*v* to RGB NTSC
%
%  DESCRIPTION
% Calls cktoRGBNTSC with the -luvstar parameter to convert an image from L*u*v* to RGB NTSC
%
%
%
%  EXAMPLES
%
%  "SEE ALSO"
%
%  RESTRICTIONS
%
%  REFERENCES
% All references for the COLOR toolbox are on the file $COLOR/Readme.html
%
%  COPYRIGHT
% Copyright (C) 1997 Rafael Santos. Khoros (C) Khoral Research, Inc.
%

function varargout = kcpLuvstartoRGBNTSC(varargin)
if nargin ==0
  Inputs={};arglist={'',''};
elseif nargin ==1
  Inputs=varargin{1};arglist={'',''};
elseif nargin ==2
  Inputs=varargin{1}; arglist=varargin{2};
else error('Usage: [out1,..] = kcpLuvstartoRGBNTSC(Inputs,arglist).');
end
if size(arglist,2)~=2
  error('arglist must be of form {''ParameterTag1'',value1;''ParameterTag2'',value2}')
 end
narglist={'i', '__input';'o', '__output'};
maxval={0,0};
minval={0,0};
istoggle=[0,0];
was_set=istoggle * 0;
paramtype={'InputFile','OutputFile'};
% identify the input arrays and assign them to the arguments as stated by the user
if ~iscell(Inputs)
Inputs = {Inputs};
end
NumReqOutputs=1; nextinput=1; nextoutput=1;
  for ii=1:size(arglist,1)
  wasmatched=0;
  for jj=1:size(narglist,1)
   if strcmp(arglist{ii,1},narglist{jj,1})  % a given argument was matched to the possible arguments
     wasmatched = 1;
     was_set(jj) = 1;
     if strcmp(narglist{jj,2}, '__input')
      if (nextinput > length(Inputs))
        error(['Input ' narglist{jj,1} ' has no corresponding input!']);
      end
      narglist{jj,2} = 'OK_in';
      nextinput = nextinput + 1;
     elseif strcmp(narglist{jj,2}, '__output')
      if (nextoutput > nargout)
        error(['Output nr. ' narglist{jj,1} ' is not present in the assignment list of outputs !']);
      end
      if (isempty(arglist{ii,2}))
        narglist{jj,2} = 'OK_out';
      else
        narglist{jj,2} = arglist{ii,2};
      end

      nextoutput = nextoutput + 1;
      if (minval{jj} == 0)
         NumReqOutputs = NumReqOutputs - 1;
      end
     elseif isstr(arglist{ii,2})
      narglist{jj,2} = arglist{ii,2};
     else
        if strcmp(paramtype{jj}, 'Integer') & (round(arglist{ii,2}) ~= arglist{ii,2})
            error(['Argument ' arglist{ii,1} ' is of integer type but non-integer number ' arglist{ii,2} ' was supplied']);
        end
        if (minval{jj} ~= 0 | maxval{jj} ~= 0)
          if (minval{jj} == 1 & maxval{jj} == 1 & arglist{ii,2} < 0)
            error(['Argument ' arglist{ii,1} ' must be bigger or equal to zero!']);
          elseif (minval{jj} == -1 & maxval{jj} == -1 & arglist{ii,2} > 0)
            error(['Argument ' arglist{ii,1} ' must be smaller or equal to zero!']);
          elseif (minval{jj} == 2 & maxval{jj} == 2 & arglist{ii,2} <= 0)
            error(['Argument ' arglist{ii,1} ' must be bigger than zero!']);
          elseif (minval{jj} == -2 & maxval{jj} == -2 & arglist{ii,2} >= 0)
            error(['Argument ' arglist{ii,1} ' must be smaller than zero!']);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} < minval{jj})
            error(['Argument ' arglist{ii,1} ' must be bigger than ' num2str(minval{jj})]);
          elseif (minval{jj} ~= maxval{jj} & arglist{ii,2} > maxval{jj})
            error(['Argument ' arglist{ii,1} ' must be smaller than ' num2str(maxval{jj})]);
          end
        end
     end
     if ~strcmp(narglist{jj,2},'OK_out') &  ~strcmp(narglist{jj,2},'OK_in')
       narglist{jj,2} = arglist{ii,2};
     end
   end
   end
   if (wasmatched == 0 & ~strcmp(arglist{ii,1},''))
        error(['Argument ' arglist{ii,1} ' is not a valid argument for this function']);
   end
end
% match the remaining inputs/outputs to the unused arguments and test for missing required inputs
 for jj=1:size(narglist,1)
     if  strcmp(paramtype{jj}, 'Toggle')
        if (narglist{jj,2} ==0)
          narglist{jj,1} = '';
        end;
        narglist{jj,2} = '';
     end;
     if  ~strcmp(narglist{jj,2},'__input') && ~strcmp(narglist{jj,2},'__output') && istoggle(jj) && ~ was_set(jj)
          narglist{jj,1} = '';
          narglist{jj,2} = '';
     end;
     if strcmp(narglist{jj,2}, '__input')
      if (minval{jj} == 0)  % meaning this input is required
        if (nextinput > size(Inputs))
           error(['Required input ' narglist{jj,1} ' has no corresponding input in the list!']);
        else
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        end
      else  % this is an optional input
        if (nextinput <= length(Inputs))
          narglist{jj,2} = 'OK_in';
          nextinput = nextinput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end;
     else
     if strcmp(narglist{jj,2}, '__output')
      if (minval{jj} == 0) % this is a required output
        if (nextoutput > nargout & nargout > 1)
           error(['Required output ' narglist{jj,1} ' is not stated in the assignment list!']);
        else
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
          NumReqOutputs = NumReqOutputs-1;
        end
      else % this is an optional output
        if (nargout - nextoutput >= NumReqOutputs)
          narglist{jj,2} = 'OK_out';
          nextoutput = nextoutput + 1;
        else
          narglist{jj,1} = '';
          narglist{jj,2} = '';
        end;
      end
     end
  end
end
if nargout
   varargout = cell(1,nargout);
else
  varargout = cell(1,1);
end
global KhorosRoot
if exist('KhorosRoot') && ~isempty(KhorosRoot)
w=['"' KhorosRoot];
else
if ispc
  w='"C:\Program Files\dip\khorosBin\';
else
[s,w] = system('which cantata');
w=['"' w(1:end-8)];
end
end
[varargout{:}]=callKhoros([w 'cktoRGBNTSC"  -luvstar'],Inputs,narglist);

author: aludnam

repo: MATLAB

save_path: github-repos/MATLAB/aludnam-MATLAB


text:
function [clrmap,clrIX_x,clrIX_y,clrIX_z] = MapXYto3Dcolormap(gIX_in,X,Y,Z,Xrange,Yrange,Zrange,cmap3D)
% gIX_in corresponds to the 2D values X and Y.
% The output clrmap is a linear colormap of the same length as numK
% (=max(gIX_in)), and same as clrIX_x and clrIX_y.
% clrIX_x and clrIX_y are the coordinates in the 2D colormap for the range of values in gIX_in.

if nargin < 5
    Xrange = [min(X),max(X)];
end
if nargin < 6
    Yrange = [min(Y),max(Y)];
end
if nargin < 7
    Zrange = [min(Z),max(Z)];
end

if nargin < 8
    cmap3D = MakeDiagonal3Dcolormap;
end
res = size(cmap3D,1);

% check input dimensions
if size(X,2)>1
    X = X';
end
if size(Y,2)>1
    Y = Y';
end
if size(Z,2)>1
    Z = Z';
end
% assert(isequal(size(X),size(Y)));
% assert(isequal(size(X),size(Z)));

% set data range
X(X<Xrange(1)) = Xrange(1);
Y(Y<Yrange(1)) = Yrange(1);
Z(Z<Zrange(1)) = Zrange(1);
X(X>Xrange(2)) = Xrange(2);
Y(Y>Yrange(2)) = Yrange(2);
Z(Z<Zrange(1)) = Zrange(1);

clrIX_x = round((X-Xrange(1))/(Xrange(2)-Xrange(1))*(res-1))+1;
clrIX_y = round((Y-Yrange(1))/(Yrange(2)-Yrange(1))*(res-1))+1;
clrIX_z = round((Z-Zrange(1))/(Zrange(2)-Zrange(1))*(res-1))+1;

%%
clrmap = zeros(length(clrIX_x),3);
cmap3D_flat = reshape(cmap3D,res*res*res,3); % for efficient indexing

U = unique(gIX_in);

ix = sub2ind([res,res,res],clrIX_x(U),clrIX_y(U),clrIX_z(U));
% ix = (clrIX_x(U)-1)*res+clrIX_y(U);
clrmap(U,:) = cmap3D_flat(ix,:);
% for i = 1:length(U)
% %     ix = sub2ind([res,res],clrIX_y(U(i))',clrIX_x(U(i))');
%     ix = (clrIX_x(U(i))'-1)*res+clrIX_y(U(i))';
% %     center_ix = (M_xyz(j,2)-1)*dimv(1)+M_xyz(j,1); % linear pixel index, faster equivalent of:
%         %     center_ix = sub2ind([dimv(1),dimv(2)],M_xyz(j,1),M_xyz(j,2));
%
%
%     clrmap(U(i),:) = clrmap_2D_flat(ix,:);
% end
end

author: xiuyechen

repo: FishExplorer


text:
%EEGLAB group processing (STUDY) functions (studyfunc folder):
%  compute_ersp_times   - Computes the widest possible ERSP/ITC time window,...
%  neural_net           - Computes clusters using Matlab Neural Net toolbox.
%  pop_chanplot         - Graphic user interface (GUI)-based function with plotting...
%  pop_clust            - Select and run a clustering algorithm on components from an EEGLAB STUDY...
%  pop_clustedit        - Graphic user interface (GUI)-based function with editing and plotting...
%  pop_erpimparams      - Set plotting and statistics parameters for...
%  pop_erpparams        - Set plotting and statistics parameters for cluster ERP...
%  pop_erspparams       - Set plotting and statistics parameters for...
%  pop_loadstudy        - Load an existing EEGLAB STUDY set of EEG datasets plus...
%  pop_preclust         - Prepare STUDY components' location and activity measures for later clustering.
%  pop_precomp          - Precompute measures (spectrum, ERP, ERSP) for a collection of data...
%  pop_savestudy        - Save a STUDY structure to a disk file...
%  pop_specparams       - Set plotting and statistics parameters for computing...
%  pop_statparams       - Helper function for pop_erspparams, pop_erpparams, and...
%  pop_study            - Create a new STUDY set structure defining a group of related EEG datasets.
%  pop_studydesign      - Create a STUDY design structure.
%  pop_studyerp         - Create a simple design for ERP analysis...
%  robust_kmeans        - An extension of Matlab kmeans() that removes outlier...
%  std_cell2setcomps    - Convert .sets and .comps to cell array. The .sets and...
%  std_centroid         - Compute cluster centroid in EEGLAB dataset STUDY.
%  std_changroup        - Create channel groups for plotting.
%  std_chaninds         - Look up channel indices in a STUDY...
%  std_chantopo         - Plot ERP/spectral/ERSP topoplot at a specific...
%  std_checkconsist     - Create channel groups for plotting.
%  std_checkfiles       - Check all STUDY files consistency...
%  std_checkset         - Check STUDY set consistency...
%  std_clustmaxelec     - Function to find the electrode with maximum absolute projection...
%  std_clustread        - This function has been replaced by std_readdata() for...
%  std_comppol          - Inverse component polarity in a component cluster...
%  std_convertdesign    - Temporary function converting STUDY design legacy...
%  std_createclust      - Dreate a new empty cluster.  After creation, components...
%  std_dipoleclusters   - Plots clusters of ICs as colored dipoles in MRI...
%  std_dipplot          - Commandline function to plot cluster component dipoles. Dipoles for each...
%  std_editset          - Modify a STUDY set structure.
%  std_erp              - Constructs and returns channel or ICA activation ERPs for a dataset.
%  std_erpimage         - Compute ERP images and save them on disk.
%  std_erpimageplot     - Commandline function to plot cluster ERPimage or channel erpimage.
%  std_erpplot          - Command line function to plot STUDY cluster component ERPs. Either...
%  std_ersp             - Compute ERSP and/or ITC transforms for ICA components...
%  std_erspplot         - Plot STUDY cluster ERSPs. Displays either mean cluster ERSPs,...
%  std_figtitle         - Generate plotting figure titles in a cell array...
%  std_filecheck        - Check if ERSP or SPEC file contain specific parameters.
%  std_fileinfo         - Check uniform channel distribution accross datasets...
%  std_findoutlierclust - Determine whether an outlier cluster already exists...
%  std_findsameica      - Find groups of datasets with identical ICA decomposiotions...
%  std_getdataset       - Constructs and returns EEG dataset from STUDY design.
%  std_getindvar        - Get independent variables of a STUDY...
%  std_indvarmatch      - Match independent variable value in a list of values...
%  std_interp           - Interpolate, if needed, a list of named data channels...
%  std_itcplot          - Commandline function to plot cluster ITCs. Either displays mean cluster...
%  std_loadalleeg       - Constructs an ALLEEG structure, given the paths and file names...
%  std_makedesign       - Create a new or edit an existing STUDY.design by...
%  std_maketrialinfo    - Create trial information structure using the...
%  std_mergeclust       - Commandline function, to merge several clusters.
%  std_movecomp         - Move ICA component(s) from one cluster to another.
%  std_moveoutlier      - Commandline function, to reassign specified outlier component(s)...
%  std_movie            - Make movie in the frequency domain...
%  std_pac              - Compute or read PAC data (Phase Amplitude Coupling).
%  std_pacplot          - Commandline function to plot cluster PAC...
%  std_plot             - This function is outdated. Use std_plottf() to plot time/...
%  std_plotcurve        - Plot ERP or spectral traces for a STUDY component...
%  std_plottf           - Plot ERSP/ITC images a component...
%  std_preclust         - Select measures to be included in computation of a preclustering array.
%  std_precomp          - Precompute measures (ERP, spectrum, ERSP, ITC) for channels in a...
%  std_precomp_worker   - Allow dispatching ERSP to be computed in parallel...
%  std_prepare_neighbors - Prepare Fieldtrip channel neighbor structure.
%  std_propplot         - Command line function to plot component cluster...
%  std_pvaf             - Compute 'percent variance accounted for' (pvaf) by specified...
%  std_readdata         - LEGACY FUNCTION, SHOULD NOT BE USED ANYMORE. INSTEAD...
%  std_readerp          - Load ERP measures for data channels or...
%  std_readerpimage     - Load ERPimage measures for data channels or...
%  std_readersp         - Load ERSP measures for data channels or  for all...
%  std_readfile         - Read data file containing STUDY measures.
%  std_readitc          - Load ITC measures for data channels or...
%  std_readpac          - Read phase-amplitude correlation...
%  std_readspec         - Load spectrum measures for data channels or...
%  std_readspecgram     - Returns the stored mean power spectrogram for an ICA component...
%  std_readtopo         - Returns the scalp map of a specified ICA component, assumed...
%  std_readtopoclust    - Compute and return cluster component scalp maps.
%  std_rebuilddesign    - Reduild design structure when datasets have been...
%  std_rejectoutliers   - Commandline function, to reject outlier component(s) from clusters.
%  std_renameclust      - Commandline function, to rename clusters using specified (mnemonic) names.
%  std_renamestudyfiles - Rename files for design 1 if necessary. In design...
%  std_reset            - Remove all preloaded measures from STUDY...
%  std_rmalldatafields  - Remove all data fields from STUDY (before saving...
%  std_savedat          - Save measure for computed data...
%  std_selcomp          - Helper function for std_erpplot(), std_specplot()...
%  std_selectdataset    - Select datasets and trials for a given independent...
%  std_selectdesign     - Select an existing STUDY design.
%  std_selsubject       - Helper function for std_erpplot(), std_specplot()...
%  std_setcomps2cell    - Convert .sets and .comps to cell array. The .sets and...
%  std_spec             - Returns the ICA component spectra for a dataset. Updates the EEG structure...
%  std_specgram         - Returns the ICA component or channel spectrogram for a dataset.
%  std_specplot         - Plot STUDY component cluster spectra, either mean spectra...
%  std_stat             - Compute statistics for ERP/spectral traces or ERSP/ITC images...
%  std_substudy         - Create a sub-STUDY set by removing datasets, conditions, groups, or...
%  std_topo             - Uses topoplot() to get the interpolated Cartesian grid of the...
%  std_topoplot         - Command line function to plot cluster component and mean scalp maps.
%  std_uniformfiles     - Check uniform channel distribution accross data files...
%  std_uniformsetinds   - Check uniform channel distribution accross datasets...
%  toporeplot           - Re-plot a saved topoplot() output image (a square matrix)...

author: buzsakilab

repo: buzcode

save_path: github-repos/MATLAB/buzsakilab-buzcode