finish symbolic regression example

thread
Brett 2024-07-22 21:59:05 -04:00
parent 9a43cd7e81
commit 6972a30696
3 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.0.101) project(blt-gp VERSION 0.0.103)
include(CTest) include(CTest)

View File

@ -34,7 +34,7 @@ std::array<context, 200> fitness_cases;
blt::gp::prog_config_t config = blt::gp::prog_config_t() blt::gp::prog_config_t config = blt::gp::prog_config_t()
.set_initial_min_tree_size(2) .set_initial_min_tree_size(2)
.set_initial_max_tree_size(6) .set_initial_max_tree_size(6)
.set_elite_count(10) .set_elite_count(2)
.set_crossover_chance(0.9) .set_crossover_chance(0.9)
.set_mutation_chance(0.1) .set_mutation_chance(0.1)
.set_reproduction_chance(0.1) .set_reproduction_chance(0.1)
@ -106,10 +106,10 @@ int main()
builder.add_operator(sub); builder.add_operator(sub);
builder.add_operator(mul); builder.add_operator(mul);
builder.add_operator(pro_div); builder.add_operator(pro_div);
//builder.add_operator(op_sin); builder.add_operator(op_sin);
//builder.add_operator(op_cos); builder.add_operator(op_cos);
//builder.add_operator(op_exp); builder.add_operator(op_exp);
//builder.add_operator(op_log); builder.add_operator(op_log);
builder.add_operator(lit, true); builder.add_operator(lit, true);
builder.add_operator(op_x); builder.add_operator(op_x);
@ -124,7 +124,8 @@ int main()
{ {
BLT_TRACE("------------{Begin Generation %ld}------------", program.get_current_generation()); BLT_TRACE("------------{Begin Generation %ld}------------", program.get_current_generation());
BLT_START_INTERVAL("Symbolic Regression", "Gen"); BLT_START_INTERVAL("Symbolic Regression", "Gen");
program.create_next_generation(blt::gp::select_fitness_proportionate_t{}, blt::gp::select_fitness_proportionate_t{}, blt::gp::select_fitness_proportionate_t{}); auto sel = blt::gp::select_fitness_proportionate_t{};
program.create_next_generation(sel, sel, sel);
BLT_END_INTERVAL("Symbolic Regression", "Gen"); BLT_END_INTERVAL("Symbolic Regression", "Gen");
BLT_TRACE("Move to next generation"); BLT_TRACE("Move to next generation");
BLT_START_INTERVAL("Symbolic Regression", "Fitness"); BLT_START_INTERVAL("Symbolic Regression", "Fitness");

View File

@ -1 +1 @@
perf stat -d -d -d -r 30 -e branches,branch-misses,cache-misses,cache-references,cycles,instructions,alignment-faults,cgroup-switches,faults,duration_time,user_time,system_time,L1-dcache-loads,L1-dcache-load-misses,L1-dcache-prefetches,L1-icache-loads,L1-icache-load-misses,dTLB-loads,dTLB-load-misses,iTLB-loads,iTLB-load-misses,l2_request_g1.all_no_prefetch,page-faults,page-faults:u,page-faults:k ./cmake-build-release/blt-SR-playground-example perf stat -d -d -d -r 30 -e branches,branch-misses,cache-misses,cache-references,cycles,instructions,alignment-faults,cgroup-switches,faults,duration_time,user_time,system_time,L1-dcache-loads,L1-dcache-load-misses,L1-dcache-prefetches,L1-icache-loads,L1-icache-load-misses,dTLB-loads,dTLB-load-misses,iTLB-loads,iTLB-load-misses,l2_request_g1.all_no_prefetch,page-faults,page-faults:u,page-faults:k ./cmake-build-release/blt-symbolic-regression-example