#include <parameter_sweep.hpp>
|
static std::vector< cypress::Json > | generate_sweep_vector (const cypress::Json &source, const cypress::Json &target, std::vector< std::string > &sweep_names) |
|
class for systematic parameter sweeps of single benchmarks
Definition at line 37 of file parameter_sweep.hpp.
SNAB::ParameterSweep::ParameterSweep |
( |
std::string |
backend, |
|
|
cypress::Json & |
config, |
|
|
size_t |
bench_index = 0 , |
|
|
size_t |
threads = 1 |
|
) |
| |
Constructor choses the appropriate SNAB. sets the most general structures above and generate the vector containing configurations for all sweeps. Sweep indices are shuffeld
- Parameters
-
backend | the cypress backend |
config | json structure which looks similar to the json-files in config/ thus containing backend specific instructions. This json structure should have arrays like [a,b,c] instead of a parameter value to sweep from a to b in c steps. |
bench_index | if the benchmark config contains several values like different network sizes, this the entry id to choose |
threads | number of threads for parallel execution. Note: not every backend is threadsafe! |
SNAB::ParameterSweep::~ParameterSweep |
( |
| ) |
|
When the sweep is exited normally (not by signal failure) make sure to delete the backup
void SNAB::ParameterSweep::backup_simulation_results |
( |
| ) |
|
Function for backing up an old simulation. Note: Make sure the same sweep config is used. This is currently not checked against! TODO!
void SNAB::ParameterSweep::execute |
( |
| ) |
|
Execution of the sweep simulations. Results are stored in m_results
static std::vector<cypress::Json> SNAB::ParameterSweep::generate_sweep_vector |
( |
const cypress::Json & |
source, |
|
|
const cypress::Json & |
target, |
|
|
std::vector< std::string > & |
sweep_names |
|
) |
| |
|
static |
Generates the m_sweep_vector.
- Parameters
-
target | contains the original config from the snab |
source | should contain single values which will overwrite those from in all simulations and json values like [a,b,c] which will generate vectors of config files, in which the parameter is varied from a to b in c steps. |
sweep_names | will contain the flattened keys for all parameters swept over |
void SNAB::ParameterSweep::write_csv |
( |
| ) |
|
Results are converted to comma seperated values and written to sweep_parameters_*backend*_.csv
The documentation for this class was generated from the following file: