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()); }