function para=parametersList()
%% parameters for codebook

para.working_add='working_matSaving';
para.output_add='outputCoodBook';
para.output_sparseFrame='outputSparseFrame';

para.templateSize = [108 108];
para.minHeightOrWidth = 150;
para.numRandomStart = 1;
para.numIter = 12; % number of EM iterations
para.numCluster = 3; % number of data clusters
para.numSketch=40; % number of Gabors in active basis at the first sc
para.rotateShiftLimit = 1;
para.locationPerturbationFraction = .4; %.4; % the size of neighborhood for MAX2 pooling, as well as surround supression
para.locationPerturbationFraction_final = para.locationPerturbationFraction;%.4; % (used in later EM iterations) the size of neighborhood for MAX2 pooling, as well as surround supression
para.resizeTrainingImages=true;

para.locationShiftLimit = 2; % shift in location 
para.orientShiftLimit = 1; % shift in orientation 

para.resolutionGap = .2; % gap between consecutive resolutions in detection
para.numExtend = 1; % number of gaps extended both below and above zero
para.numResolution = para.numExtend*2 + 1;  % number of resolutions to search for in detection stage
para.originalResolution = para.numExtend + 1; % original resolution is the one at which the imresize factor = 1
para.allResolution = (-para.numExtend : para.numExtend)* para.resolutionGap + 1.;

%% parameters for filters (Gabor and DoG) 
isOption1=false;
if isOption1
    %% option 1: automatical filters generation
    %parameters for automatically generating scale List
    initialScale = 1.4; %initial scale for Gabor wavelets
    shrinkFactor = sqrt(2.0);
    expandDoG = 20;

    para.GaborScaleList=[initialScale, initialScale/shrinkFactor, initialScale/(shrinkFactor^2), initialScale/(shrinkFactor^3)];  % scales list for Gabor filters
    para.DoGScaleList=[initialScale*expandDoG/shrinkFactor];  % scales list for DoG filters
%% option 2: manually filters generation
else
    para.DoGScaleList=[];
    para.GaborScaleList=[0.7];   % add scales of Gabor filters here
end
para.nScaleGabor=length(para.GaborScaleList);
para.nScaleDoG=length(para.DoGScaleList);
para.numOrient = 16;
para.numFilter = para.nScaleGabor*2* para.numOrient+ para.nScaleDoG;  % sin and cosin separately



%% parameters for HMC
para.sigsq=10;
para.lambdaLearningRate = 0.1/sqrt(para.sigsq);
para.nIter = 40; % the number of iterations for learning lambda
para.epsilon = 0.03; % step size for the leapfrog
para.L = 10; % leaps for the leapfrog
para.numSample = 3; % how many HMC calls for each learning iteration
para.nTileRow = 12;%12; %nTileRow \times nTileCol defines the number of paralle chains
para.nTileCol = 12;%12;

%% parameters for normalization
para.isGlobalNormalization=true; % for the input training image. the images substracts the mean and is divided by standard deviation

para.isLocalNormalize=true;
para.isSeparate=false;
para.localHalfx=20;
para.localHalfy=20;
para.localNormScaleFactor=0.6;
para.thresholdFactor=0.01;  

% create filters bank

filters=[];
for iScale=1:para.nScaleGabor
    f = MakeFilter(para.GaborScaleList(iScale),para.numOrient);
    for i=1:para.numOrient
     f_r{i} =real(f{i});
     f_i{i} =imag(f{i});
    end
    
    filters = [filters f_r f_i];
end


for iScale=1:para.nScaleDoG

    f0 = single(dog(para.DoGScaleList(iScale),0));
    filters = [filters f0];

end

halfFilterSizes = zeros(size(filters));
for iF = 1:para.numFilter
    filters{iF} = single(filters{iF});
    halfFilterSizes(iF)=(size(filters{iF},1)-1)/2;
end

para.filters = filters;
para.halfFilterSizes = halfFilterSizes;
