Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a6e14650 authored by hhakim's avatar hhakim
Browse files

Make available the grad_calc_opt_mode option in...

Make available the grad_calc_opt_mode option in matfaust.factparams.ParamsFact. This option has been added in C++ core by 28f1510f.

By the way fix missing (minor) params in the call of cpp palm4msa from the mex code or in matfaust code (is_verbose for example).
parent 5b3a6727
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,6 @@
%> @b Example
%>
%> @code
%> import matfaust.*
%> import matfaust.factparams.*
%> import matfaust.fact.palm4msa
%> M = rand(500, 32);
......@@ -49,7 +48,7 @@ function [F,lambda] = palm4msa(M, p)
error('M''s number of columns must be consistent with the last residuum constraint defined in p. Likewise its number of rows must be consistent with the first factor constraint defined in p.')
end
% put mex_constraints in a cell array again because mex eats one level of array
mex_params = struct('data', M, 'nfacts', p.num_facts, 'cons', {mex_constraints}, 'init_facts', {p.init_facts}, 'niter', p.stop_crit.num_its, 'sc_is_criterion_error', p.stop_crit.is_criterion_error, 'sc_error_treshold', p.stop_crit.error_treshold, 'sc_max_num_its', p.stop_crit.max_num_its, 'update_way', p.is_update_way_R2L);
mex_params = struct('data', M, 'nfacts', p.num_facts, 'cons', {mex_constraints}, 'init_facts', {p.init_facts}, 'niter', p.stop_crit.num_its, 'sc_is_criterion_error', p.stop_crit.is_criterion_error, 'sc_error_treshold', p.stop_crit.error_treshold, 'sc_max_num_its', p.stop_crit.max_num_its, 'update_way', p.is_update_way_R2L, 'grad_calc_opt_mode', p.grad_calc_opt_mode, 'constant_step_size', p.constant_step_size, 'step_size', p.step_size, 'verbose', p.is_verbose);
if(isreal(M))
[lambda, core_obj] = mexPalm4MSAReal(mex_params);
else
......
......@@ -12,6 +12,7 @@ classdef (Abstract) ParamsFact
constant_step_size
constraints
is_verbose
grad_calc_opt_mode
end
properties (Constant, SetAccess = protected, Hidden)
DEFAULT_STEP_SIZE = 10^-16
......@@ -25,8 +26,14 @@ classdef (Abstract) ParamsFact
IDX_STEP_SIZE = 3
IDX_CONSTANT_STEP_SIZE = 4
IDX_VERBOSITY = 5
IDX_GRAD_CALC_OPT_MODE = 6
% flags to control the optimization of the multiplication L'(LSR)R' in PALM4MSA
DISABLED_OPT = 0
INTERNAL_OPT = 1
EXTERNAL_OPT = 2
DEFAULT_OPT = 2
% the order of names matters and must respect the indices above
OPT_ARG_NAMES = {'is_update_way_R2L', 'init_lambda', 'step_size', 'constant_step_size', 'is_verbose'}
OPT_ARG_NAMES = {'is_update_way_R2L', 'init_lambda', 'step_size', 'constant_step_size', 'is_verbose', 'grad_calc_opt_mode'}
end
methods
function p = ParamsFact(num_facts, constraints, varargin)
......@@ -37,6 +44,7 @@ classdef (Abstract) ParamsFact
step_size = ParamsFact.DEFAULT_STEP_SIZE;
is_verbose = ParamsFact.DEFAULT_VERBOSITY;
constant_step_size = ParamsFact.DEFAULT_CONSTANT_STEP_SIZE;
grad_calc_opt_mode = ParamsFact.DEFAULT_OPT;
% check mandatory arguments
if(~ isscalar(num_facts) || ~ isreal(num_facts))
error('matfaust.factparams.ParamsFact num_facts argument must be an integer.')
......@@ -74,7 +82,9 @@ classdef (Abstract) ParamsFact
if(opt_arg_map.isKey(ParamsFact.OPT_ARG_NAMES{ParamsFact.IDX_VERBOSITY}))
is_verbose = opt_arg_map(ParamsFact.OPT_ARG_NAMES{ParamsFact.IDX_VERBOSITY});
end
if(opt_arg_map.isKey(ParamsFact.OPT_ARG_NAMES{ParamsFact.IDX_GRAD_CALC_OPT_MODE}))
grad_calc_opt_mode = opt_arg_map(ParamsFact.OPT_ARG_NAMES{ParamsFact.IDX_GRAD_CALC_OPT_MODE});
end
% then check validity of opt args (it's useless for default values but it's not too costfull)
if(~ islogical(is_update_way_R2L))
error(['matfaust.factparams.ParamsFact ', p.OPT_ARG_NAMES{ParamsFact.IDX_IS_UPDATE_WAY_R2L} ,' argument (is_update_way_R2L) must be logical.'])
......@@ -92,6 +102,9 @@ classdef (Abstract) ParamsFact
if(~ islogical(is_verbose))
error(['matfaust.factparams.ParamsFact ', p.OPT_ARG_NAMES{ParamsFact.IDX_VERBOSITY},' argument (is_verbose) must be logical.'])
end
if(~ isscalar(grad_calc_opt_mode) && (grad_calc_opt_mode == ParamsFact.INTERNAL_OPT || grad_calc_opt_mode == ParamsFact.EXTERNAL_OPT || grad_calc_opt_mode == ParamsFact.DISABLED_OPT))
error(['matfaust.factparams.ParamsFact ', p.OPT_ARG_NAMES{ParamsFact.IDX_GRAD_CALC_OPT_MODE},' argument (grad_calc_opt_mode) must be an integer equal to ParamsFact.INTERNAL_OPT, ParamsFact.EXTERNAL_OPT, or ParamsFact.DISABLED_OPT.'])
end
p.num_facts = num_facts;
p.is_update_way_R2L = is_update_way_R2L;
p.init_lambda = init_lambda;
......@@ -99,6 +112,7 @@ classdef (Abstract) ParamsFact
p.step_size = step_size;
p.is_verbose = is_verbose;
p.constant_step_size = constant_step_size;
p.grad_calc_opt_mode = grad_calc_opt_mode;
end
function bool = is_mat_consistent(this, M)
......
......@@ -60,129 +60,129 @@ typedef @FACT_FPP@ FPP2;
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
#ifdef FAUST_VERBOSE
if (typeid(SCALAR) == typeid(float))
#ifdef FAUST_VERBOSE
if (typeid(SCALAR) == typeid(float))
{
std::cout<<"SCALAR == float"<<std::endl;
}
if (typeid(SCALAR) == typeid(double))
{
std::cout<<"SCALAR == double"<<std::endl;
}
system("sleep 7");
#endif
if (nrhs != 1)
{
mexErrMsgTxt("Bad Number of inputs arguments");
}
if(!mxIsStruct(prhs[0]))
{
mexErrMsgTxt("Input must be a structure.");
}
std::vector<bool> presentFields;
testCoherencePalm4MSA(prhs[0],presentFields);
// mexPrintf(" NUMBER FIELDS %d\n",presentFields.size());
mxArray *mxCurrentField,*mxCurrentCons;
// data initialisation
Faust::MatDense<SCALAR,Cpu> data;
if (presentFields[0])
{
mxCurrentField = mxGetField(prhs[0],0,"data");
mxArray2FaustMat( mxCurrentField,data ) ;
/*mexPrintf("DATA");
for (int i = 0;i<data.getNbRow();i++)
{
for (int j = 0;j<data.getNbCol();j++)
{
//bidon = std::snprintf(coeff,10,"%d",A(i,j));
mexPrintf("%f ",data(i,j));
}
mexPrintf("\n")
};*/
}else
{
mexErrMsgTxt("params.data must be specified");
}
//nbFact initialisation
int nbFact=0;
if (presentFields[1])
{
mxCurrentField = mxGetField(prhs[0],0,"nfacts");
nbFact =(int) mxGetScalar(mxCurrentField);
// mexPrintf("NB FACT : %d\n",nbFact);
}else
{
mexErrMsgTxt("params.nfacts must be specified");
}
//constraints
std::vector<const Faust::ConstraintGeneric*> consS;
if (presentFields[2])
{
mwSize nbRowCons,nbColCons;
mxCurrentField = mxGetField(prhs[0],0,"cons");
if(!mxIsCell(mxCurrentField))
{
std::cout<<"SCALAR == float"<<std::endl;
mexErrMsgTxt("cons must be a cell-array");
}
nbRowCons = mxGetM(mxCurrentField);
nbColCons = mxGetN(mxCurrentField);
if (typeid(SCALAR) == typeid(double))
if(nbRowCons !=1)
{
mexErrMsgTxt("cons must have 1 rows");
}
// mexPrintf("cons nbColCons=%d\n", nbColCons);
if(nbColCons != (nbFact))
{
std::cout<<"SCALAR == double"<<std::endl;
//mexPrintf("\n cons has %d cols and nbFact = %d\n",nbColCons,nbFact);
//mexErrMsgTxt("incoherence between the number of columns of cons and nfacts ");
}
system("sleep 7");
#endif
//mexPrintf("\n cons has %d rows and %d cols \n",nbRowCons,nbColCons);
//Faust::ConstraintGeneric * consToAdd;
if (nrhs != 1)
for (mwSize j=0;j<nbColCons;j++)
{
// mexPrintf("cons(%d)\n",j);
mxCurrentCons=mxGetCell(mxCurrentField,j);
getConstraint<SCALAR,FPP2>(consS,mxCurrentCons);
//consS.push_back(consToAdd);
}
}else
{
mexErrMsgTxt("Bad Number of inputs arguments");
mexErrMsgTxt("params.cons must be specified");
}
if(!mxIsStruct(prhs[0]))
{
mexErrMsgTxt("Input must be a structure.");
}
std::vector<bool> presentFields;
testCoherencePalm4MSA(prhs[0],presentFields);
// mexPrintf(" NUMBER FIELDS %d\n",presentFields.size());
mxArray *mxCurrentField,*mxCurrentCons;
// data initialisation
Faust::MatDense<SCALAR,Cpu> data;
if (presentFields[0])
{
mxCurrentField = mxGetField(prhs[0],0,"data");
mxArray2FaustMat( mxCurrentField,data ) ;
/*mexPrintf("DATA");
for (int i = 0;i<data.getNbRow();i++)
{
for (int j = 0;j<data.getNbCol();j++)
{
//bidon = std::snprintf(coeff,10,"%d",A(i,j));
mexPrintf("%f ",data(i,j));
}
mexPrintf("\n")
};*/
}else
{
mexErrMsgTxt("params.data must be specified");
}
//nbFact initialisation
int nbFact=0;
if (presentFields[1])
{
mxCurrentField = mxGetField(prhs[0],0,"nfacts");
nbFact =(int) mxGetScalar(mxCurrentField);
// mexPrintf("NB FACT : %d\n",nbFact);
}else
{
mexErrMsgTxt("params.nfacts must be specified");
}
//constraints
std::vector<const Faust::ConstraintGeneric*> consS;
if (presentFields[2])
{
mwSize nbRowCons,nbColCons;
mxCurrentField = mxGetField(prhs[0],0,"cons");
if(!mxIsCell(mxCurrentField))
{
mexErrMsgTxt("cons must be a cell-array");
}
nbRowCons = mxGetM(mxCurrentField);
nbColCons = mxGetN(mxCurrentField);
if(nbRowCons !=1)
{
mexErrMsgTxt("cons must have 1 rows");
}
// mexPrintf("cons nbColCons=%d\n", nbColCons);
if(nbColCons != (nbFact))
{
//mexPrintf("\n cons has %d cols and nbFact = %d\n",nbColCons,nbFact);
//mexErrMsgTxt("incoherence between the number of columns of cons and nfacts ");
}
//mexPrintf("\n cons has %d rows and %d cols \n",nbRowCons,nbColCons);
//Faust::ConstraintGeneric * consToAdd;
for (mwSize j=0;j<nbColCons;j++)
{
// mexPrintf("cons(%d)\n",j);
mxCurrentCons=mxGetCell(mxCurrentField,j);
getConstraint<SCALAR,FPP2>(consS,mxCurrentCons);
//consS.push_back(consToAdd);
}
}else
{
mexErrMsgTxt("params.cons must be specified");
}
// std::cout<<"FINI_CONS"<<std::endl;
//niter1
// Faust::StoppingCriterion<SCALAR> crit1;
// if (presentFields[3])
// {
// mxCurrentField = mxGetField(prhs[0],0,"niter");
// int nb_iter1 =(int) mxGetScalar(mxCurrentField);
// Faust::StoppingCriterion<SCALAR> newCrit1(nb_iter1);
// crit1 = newCrit1;
// }
// mexPrintf("\n crit1 nb_it = %d\n",crit1.get_crit());
// std::cout<<"FINI_CONS"<<std::endl;
//niter1
// Faust::StoppingCriterion<SCALAR> crit1;
// if (presentFields[3])
// {
// mxCurrentField = mxGetField(prhs[0],0,"niter");
// int nb_iter1 =(int) mxGetScalar(mxCurrentField);
// Faust::StoppingCriterion<SCALAR> newCrit1(nb_iter1);
// crit1 = newCrit1;
// }
// mexPrintf("\n crit1 nb_it = %d\n",crit1.get_crit());
//TODO: replace by default values as constants from StoppingCriterion class
bool is_criterion_error = false;
......@@ -209,60 +209,80 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
max_num_its = (int) mxGetScalar(mxCurrentField);
}
Faust::StoppingCriterion<FPP2> crit1(num_its, is_criterion_error, error_treshold, max_num_its);
// crit1.Display();
//init_facts
std::vector<Faust::MatDense<SCALAR,Cpu> > init_facts;
if (presentFields[4])
{
mxCurrentField = mxGetField(prhs[0],0,"init_facts");
// std::cout<<"PASSERbeforeInitFact"<<std::endl;
setVectorFaustMat(init_facts,mxCurrentField);
// std::cout<<"PASSERafterInitFact"<<std::endl;
}else
// crit1.Display();
//init_facts
std::vector<Faust::MatDense<SCALAR,Cpu> > init_facts;
if (presentFields[4])
{
mxCurrentField = mxGetField(prhs[0],0,"init_facts");
// std::cout<<"PASSERbeforeInitFact"<<std::endl;
setVectorFaustMat(init_facts,mxCurrentField);
// std::cout<<"PASSERafterInitFact"<<std::endl;
}else
{
mexErrMsgTxt("init_facts must be must be specified");
}
// std::cout<<"PASSER1"<<std::endl;
//verbosity
bool isVerbose = false;
if (presentFields[5])
{
mxCurrentField = mxGetField(prhs[0],0,"verbose");
isVerbose =(bool) mxGetScalar(mxCurrentField);
}
//update_way
bool updateway = false;
if (presentFields[7])
{
mxCurrentField = mxGetField(prhs[0],0,"update_way");
updateway =(bool) mxGetScalar(mxCurrentField);
}
//init_lambda
FPP2 init_lambda = 1.0;
if (presentFields[6])
{
mxCurrentField = mxGetField(prhs[0],0,"init_lambda");
FPP2* tmp_ptr = &init_lambda;
// it works whatever mxCurrentField class is (complex or not)
mxArray2Ptr<FPP2>(const_cast<const mxArray*>(mxCurrentField),tmp_ptr);
// init_lambda = (SCALAR) mxGetScalar(mxCurrentField);
}
//compute_lambda
// bool compute_lambda = true;
// if (presentFields[8])
// {
// mxCurrentField = mxGetField(prhs[0],0,"compute_lambda");
// compute_lambda = (bool) mxGetScalar(mxCurrentField);
// }
///////////// HIERARCHICAL LAUNCH ///////////////
// creation des parametres
// std::cout<<"PASSER1"<<std::endl;
//verbosity
bool isVerbose = false;
if (presentFields[5])
{
mxCurrentField = mxGetField(prhs[0],0,"verbose");
isVerbose =(bool) mxGetScalar(mxCurrentField);
std::cout << "isVerbose: " << isVerbose << std::endl;
}
//update_way
bool updateway = false;
if (presentFields[7])
{
mxCurrentField = mxGetField(prhs[0],0,"update_way");
updateway =(bool) mxGetScalar(mxCurrentField);
}
//init_lambda
FPP2 init_lambda = 1.0;
if (presentFields[6])
{
mxCurrentField = mxGetField(prhs[0],0,"init_lambda");
FPP2* tmp_ptr = &init_lambda;
// it works whatever mxCurrentField class is (complex or not)
mxArray2Ptr<FPP2>(const_cast<const mxArray*>(mxCurrentField),tmp_ptr);
// init_lambda = (SCALAR) mxGetScalar(mxCurrentField);
}
GradientCalcOptMode grad_calc_opt_mode = Params<SCALAR,Cpu, FPP2>::defaultGradCalcOptMode;
if(presentFields[11])
{
mxCurrentField = mxGetField(prhs[0],0,"grad_calc_opt_mode");
grad_calc_opt_mode = static_cast<GradientCalcOptMode>((int)mxGetScalar(mxCurrentField));
}
bool constant_step_size = false;
if (presentFields[12])
{
mxCurrentField = mxGetField(prhs[0],0,"constant_step_size");
constant_step_size =(bool) mxGetScalar(mxCurrentField);
}
FPP2 step_size = Params<SCALAR,Cpu, FPP2>::defaultStepSize;
if(presentFields[13])
{
mxCurrentField = mxGetField(prhs[0], 0, "step_size");
step_size = (FPP2) mxGetScalar(mxCurrentField);
}
//compute_lambda
// bool compute_lambda = true;
// if (presentFields[8])
// {
// mxCurrentField = mxGetField(prhs[0],0,"compute_lambda");
// compute_lambda = (bool) mxGetScalar(mxCurrentField);
// }
///////////// HIERARCHICAL LAUNCH ///////////////
// creation des parametres
try{
......@@ -270,42 +290,42 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
//creation de hierarchical fact
Faust::ParamsPalm<SCALAR,Cpu, FPP2> params(data,nbFact,consS,init_facts,crit1,isVerbose,updateway,init_lambda);
// params.Display();
Faust::BlasHandle<Cpu> blas_handle;
Faust::Palm4MSA<SCALAR,Cpu, FPP2> palm(params,blas_handle,false);
palm.compute_facts();
//creation de hierarchical fact
Faust::ParamsPalm<SCALAR,Cpu, FPP2> params(data,nbFact,consS,init_facts,crit1,isVerbose,updateway,init_lambda, constant_step_size, step_size, grad_calc_opt_mode);
if(params.isVerbose) params.Display();
Faust::BlasHandle<Cpu> blas_handle;
Faust::Palm4MSA<SCALAR,Cpu, FPP2> palm(params,blas_handle,false);
palm.compute_facts();
//extraction des resultats
FPP2 lambda = palm.get_lambda();
//extraction des resultats
FPP2 lambda = palm.get_lambda();
// if(typeid(SCALAR) == typeid(complex<FPP2>)) {
Faust::MatDense<FPP2,Cpu> mat1x1Lambda = Faust::MatDense<FPP2, Cpu>(&lambda, 1, 1);
plhs[0] = FaustMat2mxArray(mat1x1Lambda);
// }
// else
// plhs[0]=mxCreateDoubleScalar((FPP2) complex<FPP2>(lambda).real()); //trick to handle compilation with templates
//
std::vector<Faust::MatDense<SCALAR,Cpu> > facts;
std::vector<Faust::MatGeneric<SCALAR, Cpu>*> sp_facts;
facts=palm.get_facts();
// if(typeid(SCALAR) == typeid(complex<FPP2>)) {
Faust::MatDense<FPP2,Cpu> mat1x1Lambda = Faust::MatDense<FPP2, Cpu>(&lambda, 1, 1);
plhs[0] = FaustMat2mxArray(mat1x1Lambda);
// }
// else
// plhs[0]=mxCreateDoubleScalar((FPP2) complex<FPP2>(lambda).real()); //trick to handle compilation with templates
//
std::vector<Faust::MatDense<SCALAR,Cpu> > facts;
std::vector<Faust::MatGeneric<SCALAR, Cpu>*> sp_facts;
facts=palm.get_facts();
for(typename std::vector<Faust::MatDense<SCALAR, Cpu>>::iterator it = facts.begin(); it != facts.end(); it++)
{
Faust::MatSparse<SCALAR, Cpu> * M = new Faust::MatSparse<SCALAR, Cpu>(*it);
sp_facts.push_back(M);
}
for(typename std::vector<Faust::MatDense<SCALAR, Cpu>>::iterator it = facts.begin(); it != facts.end(); it++)
{
Faust::MatSparse<SCALAR, Cpu> * M = new Faust::MatSparse<SCALAR, Cpu>(*it);
sp_facts.push_back(M);
}
TransformHelper<SCALAR, Cpu> *F = new TransformHelper<SCALAR, Cpu>(sp_facts, SCALAR(lambda), false, true, /* internal call */ true);
plhs[1] = convertPtr2Mat<Faust::TransformHelper<SCALAR, Cpu>>(F);
TransformHelper<SCALAR, Cpu> *F = new TransformHelper<SCALAR, Cpu>(sp_facts, SCALAR(lambda), false, true, /* internal call */ true);
plhs[1] = convertPtr2Mat<Faust::TransformHelper<SCALAR, Cpu>>(F);
for(typename std::vector<Faust::MatGeneric<SCALAR,Cpu>*>::iterator it = sp_facts.begin(); it != sp_facts.end(); it++)
{
delete *it;
}
for(typename std::vector<Faust::MatGeneric<SCALAR,Cpu>*>::iterator it = sp_facts.begin(); it != sp_facts.end(); it++)
{
delete *it;
}
}
catch (const std::exception& e)
{
......@@ -326,39 +346,39 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
void testCoherencePalm4MSA(const mxArray* params,std::vector<bool> & presentFields)
{
////TODO: this function should be modified to be more reliable/simple as the function testCoherence() in mx2Faust.cpp has been modified
int nbr_field=mxGetNumberOfFields(params);
presentFields.resize(8);
presentFields.assign(8,false);
if(nbr_field < 3)
{
mexErrMsgTxt("The number of field of params must be at least 3 ");
}
for (int i=0;i<nbr_field;i++)
{
const char * fieldName;
fieldName = mxGetFieldNameByNumber(params,i);
// mexPrintf("fieldname %d : %s\n",i,fieldName);
if (strcmp(fieldName,"data") == 0)
{
presentFields[0] = true;
}
else if (strcmp(fieldName,"nfacts") == 0)
{
presentFields[1] = true;
}
else if (strcmp(fieldName,"cons") == 0)
{
presentFields[2] = true;
}
else if (strcmp(fieldName,"niter") == 0)
{
presentFields[3] = true;
}
////TODO: this function should be modified to be more reliable/simple as the function testCoherence() in mx2Faust.cpp has been modified
int nbr_field=mxGetNumberOfFields(params);
presentFields.resize(14);
presentFields.assign(14,false);
if(nbr_field < 3)
{
mexErrMsgTxt("The number of field of params must be at least 3 ");
}
for (int i=0;i<nbr_field;i++)
{
const char * fieldName;
fieldName = mxGetFieldNameByNumber(params,i);
// mexPrintf("fieldname %d : %s\n",i,fieldName);
if (strcmp(fieldName,"data") == 0)
{
presentFields[0] = true;
}
else if (strcmp(fieldName,"nfacts") == 0)
{
presentFields[1] = true;
}
else if (strcmp(fieldName,"cons") == 0)
{
presentFields[2] = true;
}
else if (strcmp(fieldName,"niter") == 0)
{
presentFields[3] = true;
}
//sc stands for StoppingCriterion
else if(!strcmp(fieldName, "sc_is_criterion_error"))
{
......@@ -368,28 +388,39 @@ void testCoherencePalm4MSA(const mxArray* params,std::vector<bool> & presentFiel
{
presentFields[9] = true;
}
else if(!strcmp(fieldName, "sc_max_num_its"))
else if(!strcmp(fieldName, "sc_max_num_its"))
{
presentFields[10] = true;
}
else if (strcmp(fieldName,"init_facts") == 0)
{
presentFields[4] = true;
}
else if (strcmp(fieldName,"verbose") == 0)
{
presentFields[5] = true;
}
else if (strcmp(fieldName,"init_lambda") == 0)
{
presentFields[6] = true;
}
else if (strcmp(fieldName,"update_way") == 0)
{
presentFields[7] = true;
}
}
{
presentFields[4] = true;
}
else if (strcmp(fieldName,"verbose") == 0)
{
presentFields[5] = true;
}
else if (strcmp(fieldName,"init_lambda") == 0)
{
presentFields[6] = true;
}
else if (strcmp(fieldName,"update_way") == 0)
{
presentFields[7] = true;
}
else if(strcmp(fieldName, "grad_calc_opt_mode") == 0)
{
presentFields[11] = true;
}
else if(strcmp(fieldName, "constant_step_size") == 0)
{
presentFields[12] = true;
}
else if(strcmp(fieldName, "step_size") == 0)
{
presentFields[13] = true;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment