void lbann_callback_summary::on_epoch_end(model *m) { prof_region_begin("summary-epoch", prof_colors[0], false); for (const auto& met : m->get_metrics()) { EvalType train_score = met->get_mean_value(m->get_execution_mode()); // Replace spaces with _ for consistency. std::string metric_name = met->name(); std::transform(metric_name.begin(), metric_name.end(), metric_name.begin(), [] (char c) { return c == ' ' ? '_' : c; }); std::string phase = "train_" + metric_name; m_summarizer->reduce_scalar(phase, train_score, m->get_cur_step()); } save_histograms(m); m_summarizer->flush(); prof_region_end("summary-epoch", false); }
/* end of tasks */ int event_exit(){ /* show block number and the analyzing ratio */ fprintf(stderr,"\n"); show_blk_num(1); save_scalers(); /* DST exit tasks */ dst_exit(); if(rootflag == 1) root_exit(); save_histograms(); hb_exit(shmflag); return 0; }
void GA::step() { pop_vector children; children.clear(); children.reserve(m_population_size); // elitism unsigned int elite_size = m_population_size * m_elitism_rate; for (unsigned int i=0; i<elite_size; i++) { children.push_back(m_population[i]->copy()); } // crossover while (children.size() < (m_population_size - elite_size)) { // select parents int p1 = roulette(); int p2 = roulette(); // crossover parents crossover(m_population[p1], m_population[p2], children); } // mutation mutate(children); // update population and save last population update(children); // evaluate fitness and sort evaluate_fitness(); // log, save generation log(); save_histograms(); }
void lbann_callback_summary::on_train_begin(model *m) { save_histograms(m); }