File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -495,14 +495,6 @@ operator() (const Loss& loss) {
495
495
}
496
496
*/
497
497
498
- {
499
- history_.addEmpty ();
500
- auto & p = history_.lastEntry ();
501
- p.iteration = e+1 ;
502
- p.residual = fest;
503
- p.cum_time = t1 - start_time;
504
- }
505
-
506
498
if (passed_epoch) {
507
499
stepper->setPassed ();
508
500
meta_stepper->setPassed ();
@@ -522,6 +514,14 @@ operator() (const Loss& loss) {
522
514
++nfails;
523
515
}
524
516
517
+ {
518
+ history_.addEmpty ();
519
+ auto & p = history_.lastEntry ();
520
+ p.iteration = e+1 ;
521
+ p.residual = fest;
522
+ p.cum_time = t1 - start_time;
523
+ }
524
+
525
525
if (nfails > max_fails || fest < tol*fest_init)
526
526
break ;
527
527
}
Original file line number Diff line number Diff line change @@ -352,16 +352,6 @@ namespace Genten {
352
352
out << std::endl;
353
353
}
354
354
355
- {
356
- perfInfo.addEmpty ();
357
- auto & p = perfInfo.lastEntry ();
358
- p.iteration = numEpochs+1 ;
359
- p.residual = fest;
360
- if (compute_fit)
361
- p.fit = fit;
362
- p.cum_time = timer.getTotalTime (timer_sgd);
363
- }
364
-
365
355
if (failed_epoch) {
366
356
// restart from last epoch
367
357
u.set (u_prev);
@@ -379,6 +369,16 @@ namespace Genten {
379
369
annealer->success ();
380
370
}
381
371
372
+ {
373
+ perfInfo.addEmpty ();
374
+ auto & p = perfInfo.lastEntry ();
375
+ p.iteration = numEpochs+1 ;
376
+ p.residual = fest;
377
+ if (compute_fit)
378
+ p.fit = fit;
379
+ p.cum_time = timer.getTotalTime (timer_sgd);
380
+ }
381
+
382
382
if (nfails > max_fails || fest < tol)
383
383
break ;
384
384
}
You can’t perform that action at this time.
0 commit comments