本文整理汇总了C++中TheMatrix::NormInf方法的典型用法代码示例。如果您正苦于以下问题:C++ TheMatrix::NormInf方法的具体用法?C++ TheMatrix::NormInf怎么用?C++ TheMatrix::NormInf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TheMatrix
的用法示例。
在下文中一共展示了TheMatrix::NormInf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DisplayAfterTrainingInfo
void CBMRM::DisplayAfterTrainingInfo(unsigned int iter, double finalExactObjVal,
double approxObjVal, double loss,
TheMatrix& w_best, CTimer& lossAndGradientTime,
CTimer& innerSolverTime, CTimer& totalTime)
{
// legends
if(verbosity >= 1)
{
printf("\n[Legends]\n");
if(verbosity > 1)
printf("pobj: primal objective function value"
"\naobj: approximate objective function value\n");
printf("gam: gamma (approximation error) "
"\neps: lower bound on gam "
"\nloss: loss function value "
"\nreg: regularizer value\n");
}
double norm1 = 0, norm2 = 0, norminf = 0;
w_best.Norm1(norm1);
w_best.Norm2(norm2);
w_best.NormInf(norminf);
printf("\nNote: the final w is the w_t where J(w_t) is the smallest.\n");
printf("No. of iterations: %d\n",iter);
printf("Primal obj. val.: %.6e\n",finalExactObjVal);
printf("Approx obj. val.: %.6e\n",approxObjVal);
printf("Primal - Approx.: %.6e\n",finalExactObjVal-approxObjVal);
printf("Loss: %.6e\n",loss);
printf("|w|_1: %.6e\n",norm1);
printf("|w|_2: %.6e\n",norm2);
printf("|w|_oo: %.6e\n",norminf);
// display timing profile
printf("\nCPU seconds in:\n");
printf("1. loss and gradient: %8.2f\n", lossAndGradientTime.CPUTotal());
printf("2. solver: %8.2f\n", innerSolverTime.CPUTotal());
printf(" Total: %8.2f\n", totalTime.CPUTotal());
printf("Wall-clock total: %8.2f\n", totalTime.WallclockTotal());
}