function  Mparams = PLM_params1(seed_params)

%PLM_PARAMS1 -- Default parameters for the PLM_Hebb1 model
%
%  Mparams = PLM_params1
%  Mparams = PLM_params1(seed_params)
%
%  Reference:  Petrov, A., Dosher, B. & Lu, Z.-L. (2005). The dynamics
%    of perceptual learning: An incremental reweighting model.
%    Psychological Review, 102, ???-???.
%
%  SEED_PARAMS is a structure supplying values for one or more of the
%  fields. The rest are filled in with default values.
%
%  Ver 3.1, 23 Jul, 2003 -- Feedback attended with probability P.
%  Ver 3.0, 30 May, 2003 -- Hebbian learning rule.
%
%  Example: Mparams = PLM_params1
%    Mparams =
%       rep_size: [7 5 1]       % [N_orient,N_spfreq,N_centers]
%        max_act: 0.50          % output unit varies b/n -.5 and +.5
%       rep_gain: 0.80          % gain of the representn-layer act.fun
%      rep_noise: 0.10          % std.dev. of the representation noise
%      out_noise: 0.195         % std.dev. of the output-layer noise
%       W_minmax: [-1 +1]       % minimal and maximal weight
%         W_init: 0.17          % magnitude of the initial weight W0
%        W0_seed: [35x1]        % repmat([-1.5 -1 -.5 0 .5 1 1.5]',5,1)
%     learn_rate: 0.0015        % weight learning rate (*max_act)
%     runav_rate: 0.02          % running-average learning rate
%      criterion: 2.2           % for response-frequency correction
%     fdbk_fract: 1             % feedback-attended fraction of trials
%    %   trigger: 0             % when resp. freq's become too skewed
%    ---  auxiliary fields
%       blk_size: 300           % number of trials averaged in a "block"
%    %   mapping: [12x2]        % context-rearrangement correspondences
%
%  See also PLM_HEBB1, MAKE_PLMODEL, PLM_ZCONGR1, PLM_INPUT_PARAMS.

% Original coding by Alex Petrov, Ohio State University
% $Revision: 3.1 $  $Date: 2003/07/27 $
%
% Part of the Hebbian Perceptual Learning Model version 1.1 for MATLAB.
% http://alexpetrov.com/proj/plearn/
% Copyright (c) Alexander Petrov 1999-2008, http://alexpetrov.com
% Please read the LICENSE and NO WARRANTY statement in PercLearn_license.m

%---  Decipher SPEC
if (nargin==0)         % default
   Mparams = struct('rep_size',[7 5 1]) ; % [N_orient,N_spfreq,N_centers]
else
   Mparams = seed_params ;
end

%--- Fill-in missing slots
if (~isfield(Mparams,'rep_size'))
   Mparams.rep_size = [7 5 1] ; % length of the stimulus representation
end
N_orient = Mparams.rep_size(1) ;
N_spfreq = Mparams.rep_size(2) ;
if (length(Mparams.rep_size) >= 3)
   N_centers = Mparams.rep_size(3) ;
else

   N_centers = 1 ;  % default, e.g.  [7 5] --> [7 5 1]
end
if (~isfield(Mparams,'max_act'))
   Mparams.max_act = 0.50 ;     % max activation of the output unit
end
if (~isfield(Mparams,'rep_gain'))
   Mparams.rep_gain = 0.80 ;    % gain of the act.fun of the rep.layer
end
if (~isfield(Mparams,'rep_noise'))
   Mparams.rep_noise = 0.10 ;   % std.dev. of the representation noise
end
if (~isfield(Mparams,'out_noise'))
   Mparams.out_noise = 0.195 ;  % std.dev. of the output-layer noise
end
if (~isfield(Mparams,'W_minmax'))
   Mparams.W_minmax = [-1 +1] ; % minimal and maximal weight
end
if (~isfield(Mparams,'W_init'))
   Mparams.W_init = 0.17 ;      % initial weight of orientation units
end
if (~isfield(Mparams,'W0_seed'))    % initial weight pattern (*W_init)
   %one_orient = [-1 -1 -1 0 +1 +1 +1]' ;                % step-like
   one_orient = [-1.5 -1.0 -0.5  0  +0.5 +1.0 +1.5]' ;   % linear
   Mparams.W0_seed = repmat(one_orient,N_spfreq*N_centers,1) ;
   % Usage: W0 = W_init .* W0_seed
end
if (~isfield(Mparams,'learn_rate'))
   Mparams.learn_rate = 0.0015 ; % weight learning rate (*max_act)
end
if (~isfield(Mparams,'runav_rate'))
   Mparams.runav_rate = 0.02 ;   % running-average learning rate
end
if (~isfield(Mparams,'criterion'))
   Mparams.criterion = 2.2 ;     % for resp-freq correction
end
if (~isfield(Mparams,'fdbk_fract'))
   Mparams.fdbk_fract = 1 ;      % feedback-attended fraction of trials
end
%if (~isfield(Mparams,'trigger'))
%   Mparams.trigger = 0 ;         % (3.3) puts CRITERION into effect
%end

%--- Auxiliary fields
if (~isfield(Mparams,'blk_size'))    % used in PLM_ZCONGR1
   Mparams.blk_size = 300 ;     % number of trials averaged in a "block"
end
%if (~isfield(Mparams,'mapping'))
%   Mparams.mapping = [1  2  3  4  5  6  8  7 10  9 12 11 ; ...
%                      8  7 10  9 12 11  1  2  3  4  5  6]' ;
%end

%--- Return MPARAMS
%%%%% End of file PLM_PARAMS1.M
