void FFNet_drawCostHistory (FFNet me, Graphics g, long iFrom, long iTo, double costMin, double costMax, int garnish) { if (my minimizer) { Minimizer_drawHistory (my minimizer.peek(), g, iFrom, iTo, costMin, costMax, 0); } if (garnish) { Graphics_drawInnerBox (g); Graphics_textLeft (g, true, my costFunctionType == FFNet_COST_MSE ? U"Minimum squared error" : U"Minimum cross entropy"); Graphics_marksLeft (g, 2, true, true, false); Graphics_textBottom (g, true, U"Number of epochs"); Graphics_marksBottom (g, 2, true, true, false); } }
static void classMinimizer_afterHook (Minimizer me, Thing /* boss */) { if (my success || ! my gmonitor) { return; } if (my start == 1) { Minimizer_drawHistory (me, my gmonitor, 0, my maxNumOfIterations, 0.0, 1.1 * my history[1], 1); Graphics_textTop (my gmonitor, false, Melder_cat (U"Dimension of search space: ", my nParameters)); } Graphics_setInner (my gmonitor); Graphics_line (my gmonitor, my iteration, my history[my iteration], my iteration, my history[my iteration]); Graphics_unsetInner (my gmonitor); Melder_monitor ((double) (my iteration) / my maxNumOfIterations, U"Iterations: ", my iteration, U", Function calls: ", my funcCalls, U", Cost: ", my minimum); }
static void classMinimizer_after (I, Any aclosure) { iam (Minimizer); (void) aclosure; if (my success || ! my gmonitor) { return; } if (my start == 1) { wchar_t s[35]; Minimizer_drawHistory (me, my gmonitor, 0, my maxNumOfIterations, 0, 1.1 * my history[1], 1); swprintf (s, 35, L"Dimension of search space: %6ld", my nParameters); Graphics_textTop (my gmonitor, 0, s); } Graphics_setInner (my gmonitor); Graphics_line (my gmonitor, my iteration, my history[my iteration], my iteration, my history[my iteration]); Graphics_unsetInner (my gmonitor); Melder_monitor ( (double) (my iteration) / my maxNumOfIterations, L"Iterations: ", Melder_integer (my iteration), L", Function calls: ", Melder_integer (my funcCalls), L", Cost: ", Melder_double (my minimum)); }