fixes
This commit is contained in:
parent
3bb50ce3af
commit
bfb4cef8f9
@ -91,9 +91,9 @@ optimizer_parameters :-
|
||||
optimizer_get_parameter(orthantwise_start,Orthantwise_Start),
|
||||
optimizer_get_parameter(orthantwise_end,Orthantwise_End),
|
||||
|
||||
format('==========================================================================================~n',[]),
|
||||
format('/******************************************************************************************~n',[]),
|
||||
print_param('Name','Value','Description','Type'),
|
||||
format('==========================================================================================~n',[]),
|
||||
format('******************************************************************************************~n',[]),
|
||||
print_param(m,M,'The number of corrections to approximate the inverse hessian matrix.',int),
|
||||
print_param(epsilon,Epsilon,'Epsilon for convergence test.',float),
|
||||
print_param(past,Past,'Distance for delta-based convergence test.',int),
|
||||
@ -109,7 +109,7 @@ optimizer_parameters :-
|
||||
print_param(orthantwise_c,Orthantwise_C,'Coefficient for the L1 norm of variables',float),
|
||||
print_param(orthantwise_start,Orthantwise_Start,'Start index for computing the L1 norm of the variables.',int),
|
||||
print_param(orthantwise_end,Orthantwise_End,'End index for computing the L1 norm of the variables.',int),
|
||||
format('==========================================================================================~n',[]),
|
||||
format('******************************************************************************************/~n',[]),
|
||||
format(' use optimizer_set_paramater(Name,Value) to change parameters~n',[]),
|
||||
format(' use optimizer_get_parameter(Name,Value) to see current parameters~n',[]),
|
||||
format(' use optimizer_parameters to print this overview~2n',[]).
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define OPTIMIZER_STATUS_CB_EVAL 3
|
||||
#define OPTIMIZER_STATUS_CB_PROGRESS 4
|
||||
|
||||
|
||||
void init_lbfgs_predicates( void ) ;
|
||||
|
||||
int optimizer_status=OPTIMIZER_STATUS_NONE; // the internal state
|
||||
int n; // the size of the parameter vector
|
||||
@ -50,6 +50,7 @@ static lbfgsfloatval_t evaluate(
|
||||
)
|
||||
{
|
||||
YAP_Term call;
|
||||
YAP_Term a1;
|
||||
YAP_Bool result;
|
||||
YAP_Int s1;
|
||||
|
||||
@ -75,10 +76,14 @@ static lbfgsfloatval_t evaluate(
|
||||
}
|
||||
|
||||
call = YAP_GetFromSlot( s1 );
|
||||
if (YAP_IsFloatTerm(YAP_ArgOfTerm(1,call))) {
|
||||
return (lbfgsfloatval_t) YAP_FloatOfTerm(YAP_ArgOfTerm(1,call));
|
||||
} else if (YAP_IsIntTerm(YAP_ArgOfTerm(1,call))) {
|
||||
return (lbfgsfloatval_t) YAP_IntOfTerm(YAP_ArgOfTerm(1,call));
|
||||
|
||||
a1 = YAP_ArgOfTerm(1,call);
|
||||
if (YAP_IsFloatTerm(a1)) {
|
||||
YAP_ShutdownGoal( TRUE );
|
||||
return (lbfgsfloatval_t) YAP_FloatOfTerm(a1);
|
||||
} else if (YAP_IsIntTerm(a1)) {
|
||||
YAP_ShutdownGoal( TRUE );
|
||||
return (lbfgsfloatval_t) YAP_IntOfTerm(a1);
|
||||
}
|
||||
|
||||
YAP_ShutdownGoal( TRUE );
|
||||
|
Reference in New Issue
Block a user