int init_modules() { init_cudacomp(); init_AOloopControl(); init_AOloopControl_DM(); init_ZernikePolyn(); init_WFpropagate(); init_image_basic(); init_image_filter(); init_kdtree(); init_image_gen(); init_linopt_imtools(); init_statistic(); init_fft(); init_info(); init_COREMOD_arith(); init_COREMOD_iofits(); init_COREMOD_memory(); init_COREMOD_tools(); init_00CORE(); return 0; }
int main(int argc, const char ** argv) { // print_copyright(); write_copyright(); //* GraphChi initialization will read the command line arguments and the configuration file. */ graphchi_init(argc, argv); /* Metrics object for keeping track of performance counters and other information. Currently required. */ metrics m("sgd-inmemory-factors"); /* Basic arguments for application. NOTE: File will be automatically 'sharded'. */ sgd_lambda = get_option_float("sgd_lambda", 1e-3); sgd_gamma = get_option_float("sgd_gamma", 1e-3); sgd_step_dec = get_option_float("sgd_step_dec", 0.9); int file_format = get_option_int("ff", 3); parse_command_line_args(); parse_implicit_command_line(); /* Preprocess data if needed, or discover preprocess files */ int nshards = convert_matrixmarket<EdgeDataType>(training, 0, 0, file_format, TRAINING, false); init_feature_vectors<std::vector<vertex_data> >(M+N, latent_factors_inmem, !load_factors_from_file); if (validation != ""){ int vshards = convert_matrixmarket<EdgeDataType>(validation, 0, 0, 3, VALIDATION, false); init_validation_rmse_engine<VertexDataType, EdgeDataType>(pvalidation_engine, vshards, &sgd_predict); } /* load initial state from disk (optional) */ if (load_factors_from_file){ load_matrix_market_matrix(training + "_U.mm", 0, D); load_matrix_market_matrix(training + "_V.mm", M, D); } print_config(); /* Run */ SGDVerticesInMemProgram program; graphchi_engine<VertexDataType, EdgeDataType> engine(training, nshards, false, m); set_engine_flags(engine); pengine = &engine; timer train_timer; engine.run(program, niters); // std::cout << "Trn Time for file test: " << std::setw(10) << train_timer.current_time() / niters << std::endl; std::ofstream ofs(result.c_str(), std::ofstream::out | std::ofstream::app); ofs << D << " " << train_timer.current_time() << " "; /* Run TopN program */ n_top = get_option_int("n_int", 10); /*timer test_timer1; ofs << test_timer1.current_time() << " ";*/ //run_general_topn_program(pengine, &latent_factors_inmem, &sgd_predict); timer index_timer; kd_Node* mroot = init_kdtree(&latent_factors_inmem); ofs << index_timer.current_time() << " "; timer test_timer; /* construct kd tree index */ // ofs << "constructing index: " << test_timer.current_time() << " "; run_kd_topn_program(pengine, &latent_factors_inmem, mroot); // std::coua << "Tst Time: " << std::setw(10) << test_timer.current_time() << std::endl; ofs << test_timer.current_time() << std::endl; ofs.close(); /* Output latent factor matrices in matrix-market format */ output_sgd_result(training); test_predictions(&sgd_predict); /* Report execution metrics */ if (!quiet) metrics_report(m); return 0; }