SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
Public Member Functions | Static Public Member Functions | List of all members
SNAB::ParameterSweep Class Reference

#include <parameter_sweep.hpp>

Public Member Functions

 ParameterSweep (std::string backend, cypress::Json &config, size_t bench_index=0, size_t threads=1)
 
void execute ()
 
void write_csv ()
 
void backup_simulation_results ()
 
 ~ParameterSweep ()
 

Static Public Member Functions

static std::vector< cypress::Json > generate_sweep_vector (const cypress::Json &source, const cypress::Json &target, std::vector< std::string > &sweep_names)
 

Detailed Description

class for systematic parameter sweeps of single benchmarks

Definition at line 37 of file parameter_sweep.hpp.

Constructor & Destructor Documentation

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
backendthe cypress backend
configjson 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_indexif the benchmark config contains several values like different network sizes, this the entry id to choose
threadsnumber 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

Member Function Documentation

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
targetcontains the original config from the snab
sourceshould 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_nameswill 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: