Brett 2024-08-06 13:03:23 -04:00
parent 44fb94a73f
commit 2a8e334d43
7 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(image-gp-6 VERSION 0.0.19) project(image-gp-6 VERSION 0.0.20)
include(FetchContent) include(FetchContent)

View File

@ -24,8 +24,8 @@ inline constexpr size_t log2(size_t n) // NOLINT
return ((n < 2) ? 1 : 1 + log2(n / 2)); return ((n < 2) ? 1 : 1 + log2(n / 2));
} }
inline const blt::u64 SEED = std::random_device()(); //inline const blt::u64 SEED = std::random_device()();
//inline const blt::u64 SEED = 553372510; inline const blt::u64 SEED = 553372510;
inline constexpr blt::size_t IMAGE_SIZE = 128; inline constexpr blt::size_t IMAGE_SIZE = 128;
inline constexpr blt::size_t IMAGE_PADDING = 16; inline constexpr blt::size_t IMAGE_PADDING = 16;
inline constexpr blt::size_t POP_SIZE = 64; inline constexpr blt::size_t POP_SIZE = 64;
@ -35,6 +35,7 @@ inline constexpr blt::size_t DATA_CHANNELS_SIZE = DATA_SIZE * CHANNELS;
inline constexpr blt::size_t BOX_COUNT = static_cast<blt::size_t>(log2(IMAGE_SIZE / 2)); inline constexpr blt::size_t BOX_COUNT = static_cast<blt::size_t>(log2(IMAGE_SIZE / 2));
inline constexpr float THRESHOLD = 0.3; inline constexpr float THRESHOLD = 0.3;
inline constexpr auto load_image = "../GSab4SWWcAA1TNR.png"; inline constexpr auto load_image = "../GSab4SWWcAA1TNR.png";
//inline constexpr auto load_image = "../miles.png";
inline blt::gp::prog_config_t config = blt::gp::prog_config_t() inline blt::gp::prog_config_t config = blt::gp::prog_config_t()
.set_initial_min_tree_size(4) .set_initial_min_tree_size(4)

View File

@ -42,10 +42,10 @@ inline blt::gp::operation_t f_literal([]() {
template<typename context> template<typename context>
void create_float_operations(blt::gp::operator_builder<context>& builder) void create_float_operations(blt::gp::operator_builder<context>& builder)
{ {
builder.add_operator(f_add); // builder.add_operator(f_add);
builder.add_operator(f_sub); // builder.add_operator(f_sub);
builder.add_operator(f_mul); // builder.add_operator(f_mul);
builder.add_operator(f_pro_div); // builder.add_operator(f_pro_div);
builder.add_operator(f_literal, true); builder.add_operator(f_literal, true);
} }

@ -1 +1 @@
Subproject commit 29521703d31121460750815727d5f8ecde34db25 Subproject commit 593e02b6ffd36cfabda85e9dcfd88ec60b8a8741

@ -1 +1 @@
Subproject commit 4e34161bcb3f7e12879c519a2fda10f223bdea63 Subproject commit c01cb757a1d19fa8e06292dcb61a5b5769979f11

BIN
miles.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

View File

@ -350,7 +350,7 @@ void update(const blt::gfx::window_data& data)
{ {
run_generation = true; run_generation = true;
} }
ImGui::InputInt("Time Between Runs", &time_between_runs); ImGui::InputInt("Time Between Runs", &time_between_runs, 16);
ImGui::Checkbox("Run", &is_running); ImGui::Checkbox("Run", &is_running);
auto& stats = program.get_population_stats(); auto& stats = program.get_population_stats();
ImGui::Text("Stats:"); ImGui::Text("Stats:");
@ -451,6 +451,7 @@ int main()
BLT_INFO("Base image values per channel: %lf", v.total); BLT_INFO("Base image values per channel: %lf", v.total);
BLT_PRINT_PROFILE("Image Test", blt::PRINT_CYCLES | blt::PRINT_THREAD | blt::PRINT_WALL); BLT_PRINT_PROFILE("Image Test", blt::PRINT_CYCLES | blt::PRINT_THREAD | blt::PRINT_WALL);
BLT_PRINT_PROFILE("Mutation", blt::PRINT_CYCLES | blt::PRINT_THREAD | blt::PRINT_WALL | blt::AVERAGE_HISTORY);
is_running = false; is_running = false;
program.kill(); program.kill();