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.1 $  $Date: 2003/07/24 10:55 $

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

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

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

% std.dev. of the additive noise of the representation units, dflt=0.10
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.rep_noise ;' ;
%v2p_templ{k} = 'PARAMS.rep_noise = VAL ;' ;
%lb(k) = 0 ; ub(k) = 0.50 ;

% 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.05 ; ub(k) = 0.40 ;

% gain of the sigmoid function of the representation units, default=0.80
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
k = k+1 ;
p2v_templ{k} = 'VAL = PARAMS.criterion ;' ;
v2p_templ{k} = 'PARAMS.criterion = VAL ;' ;
lb(k) = 1 ; ub(k) = 5 ;

% feedback fraction, 1=fullfeedback=default, 0=nofeedback
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.fdbk_fract ;' ;
%v2p_templ{k} = 'PARAMS.fdbk_fract = VAL ;' ;
%lb(k) = 0 ; ub(k) = 1 ;

% trigger, default=0      (optimal 3.3)
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.trigger ;' ;
%v2p_templ{k} = 'PARAMS.trigger = VAL ;' ;
%lb(k) = 1 ; ub(k) = 7 ;

% runav_rate, default=0.020
%k = k+1 ;
%p2v_templ{k} = 'VAL = PARAMS.runav_rate *10 ;' ;
%v2p_templ{k} = 'PARAMS.runav_rate = VAL /10 ;' ;
%lb(k) = 0.010 *10 ; ub(k) = 0.100 *10 ;

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