auto make_mnist_ae_generator_test(const std::string& folder, size_t start, size_t limit, Parameters&&... /*parameters*/){ // Create examples for the caches etl::fast_dyn_matrix<float, 1, 28, 28> input; size_t n = 10000 - start; size_t m = 0; if(limit > 0 && limit < n){ n = limit; m = limit; } // Prepare the empty generator auto generator = prepare_generator(input, input, n, 10, dll::inmemory_data_generator_desc<Parameters..., dll::autoencoder>{}); // Read all the necessary images if(!mnist::read_mnist_image_file_flat(generator->input_cache, folder + "/t10k-images-idx3-ubyte", m, start)){ std::cerr << "Something went wrong, impossible to load MNIST test images" << std::endl; return generator; } generator->label_cache = generator->input_cache; // Apply the transformations on the input generator->finalize_prepared_data(); return generator; }
void arc_generator::init(finite_field *F, const BYTE *input_prefix, const BYTE *base_fname, INT starter_size, int argc, const char **argv, INT verbose_level) { INT f_v = (verbose_level >= 1); if (f_v) { cout << "arc_generator::init" << endl; } arc_generator::F = F; arc_generator::argc = argc; arc_generator::argv = argv; strcpy(starter_directory_name, input_prefix); strcpy(prefix, base_fname); sprintf(prefix_with_directory, "%s%s", starter_directory_name, base_fname); if (f_v) { cout << "arc_generator::init prefix_with_directory=" << prefix_with_directory << endl; } arc_generator::starter_size = starter_size; A = new action; A_on_lines = new action; AG = new action_on_grassmannian; f_semilinear = TRUE; if (f_v) { cout << "arc_generator::init" << endl; } nb_points_total = q * q + q + 1; if (is_prime(q)) { f_semilinear = FALSE; } INT f_basis = TRUE; if (f_v) { cout << "arc_generator::init calling init_matrix_group" << endl; } A->init_projective_group(3, F, f_semilinear, f_basis, 0 /*verbose_level*/); if (f_v) { cout << "arc_generator::init after init_projective_group" << endl; } if (f_v) { cout << "arc_generator::init creating action on lines" << endl; } Grass = new grassmann; Grass->init(3 /*n*/, 2 /*k*/, F, verbose_level - 2); AG->init(*A, Grass, verbose_level - 2); A_on_lines->induced_action_on_grassmannian(A, AG, FALSE /*f_induce_action*/, NULL /*sims *old_G */, MINIMUM(verbose_level - 2, 2)); if (f_v) { cout << "action A_on_lines created: "; A_on_lines->print_info(); } if (f_v) { cout << "arc_generator::init before rc.init" << endl; } rc.init(F, 3, target_size, 4 /* d */); if (f_v) { cout << "arc_generator::init after rc.init" << endl; } if (f_v) { cout << "arc_generator::init creating projective plane" << endl; } P2 = new projective_space; P2->init(2, F, TRUE /* f_init_incidence_structure */, 0 /*verbose_level - 2*/); if (f_v) { cout << "arc_generator::init after P2->init" << endl; } prepare_generator(verbose_level); IA->init(A, A, gen, target_size, prefix_with_directory, ECA, callback_arc_report, NULL /* callback_subset_orbits */, this, verbose_level); Data1 = NEW_INT(P2->N_points * 3); Data2 = NEW_INT(P2->N_points * 3); Data3 = NEW_INT(3 * 3); if (f_v) { cout << "arc_generator::init done" << endl; } }