Skip to content

Waffle is a very simple c++17 library for performing grid search over a set of parameters.

Notifications You must be signed in to change notification settings

martinmeinke/waffle-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waffle-cpp

Build Status

Waffle is a very simple c++17 library for performing grid search over a set of parameters.

Example usage

// set up some parameters and corresponding value ranges
std::vector<int> length_vals{1, 2, 3, 4, 5};
waffle::ParameterRange p_length{"length", length_vals.begin(),
                                length_vals.end()};

std::vector<float> width_vals{1.0, 2.0, 3.0, 4.0, 5.0};
waffle::ParameterRange p_width{"width", width_vals.begin(), width_vals.end()};

// define scoring function
auto target = [](int a, float b){return a * b;};
waffle::GridSearch gs{p_length, p_width};

// run grid search
auto params = gs.argmax(target);
EXPECT_EQ(std::get<0>(params), 5);
EXPECT_EQ(std::get<1>(params), 5.0);

About

Waffle is a very simple c++17 library for performing grid search over a set of parameters.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published