function  [p2v_templ,v2p_templ,lb,ub] = PLM_template

%PLM_TEMPLATE -- Templates for converting PLM params to vector format.
%   
%  [p2v_templ,v2p_templ,lb,ub] = PLM_template
%
%  This function produces two templates specifying conversions b/n
%  vectors and parameter structures as produced by PLM_PARAMS.
%  P2V_TEMPL is to be used with the function PARAMS2VECTOR and
%  V2P_TEMPL with VECTOR2PARAMS, respectively.
%  LB and UB are the lower and upper bounds for each parameter.
%  See FMINCON and PARAMSEARCH for details.
%
%   Example:
%     [p2v_templ,v2p_templ,lb,ub] = PLM_template ;
%     p2v_templ' , v2p_templ', [lb' ub']
%     Mparams0 = PLM_params ; x0 = params2vector(Mparams0,p2v_templ) ;
%
%  See also PLM_PARAMS, PLM_SEARCH_PARAMS, PARAMS2VECTOR.

%  Original coding by Alexander Petrov, UC Irvine.
%  $Revision: 3.2 $  $Date: 2005/06/23 19:55 $

N = 2 ;
p2v_templ = cell(1,N) ; v2p_templ = cell(1,N) ;
lb = zeros(1,N) ; ub = zeros(1,N) ; k = 0 ;

%- learning rate, default=0.0016
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.learn_rate *100 ;' ;
%v2p_templ{k} = 'PARAMS.learn_rate = VAL /100 ;' ;
%lb(k) = 0.0010 *100 ; ub(k) = 0.0050 *100 ;

% std.dev. of the additive noise of the output unit, default=0.16
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.out_noise ;' ;
%v2p_templ{k} = 'PARAMS.out_noise = VAL ;' ;
%lb(k) = 0.10 ; ub(k) = 0.30 ;

% initial weight magnitude, the pattern is in W0_seed, default=0.17
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.W_init ;' ;
%v2p_templ{k} = 'PARAMS.W_init = VAL ;' ;
%lb(k) = 0.10 ; ub(k) = 0.30 ;

% gain of the sigmoid function of the decision unit, default=5
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.out_gain /10 ;' ;
%v2p_templ{k} = 'PARAMS.out_gain = VAL *10;' ;
%lb(k) = 1 /10 ; ub(k) = 15 /10 ;

% gain of the sigmoid function of the representation units, default=0.80
% [This is stable now, but it was a big deal when we fitted PLExp1.]
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.rep_gain ;' ;
%v2p_templ{k} = 'PARAMS.rep_gain = VAL ;' ;
%lb(k) = 0.3 ; ub(k) = 1.0 ;

% criterion, default=2.2 for PLExp1, 1.0 for PLExp2
k = k+1 ;
p2v_templ{k} = 'VAL = PARAMS.criterion ;' ;
v2p_templ{k} = 'PARAMS.criterion = VAL ;' ;
lb(k) = .5 ; ub(k) = 3 ;

% feedback weight, default=?
k = k+1 ;
p2v_templ{k} = 'VAL = PARAMS.fdbk_wgt ;' ;
v2p_templ{k} = 'PARAMS.fdbk_wgt = VAL ;' ;
lb(k) = 0 ; ub(k) = 5 ;


%% Return P2V_TEMPL, V2P_TEMPL, LB, and UB.
%%%%% End of file PLM_TEMPLATE.M
