Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Static Public Member Functions | List of all members
cypress::Transformations Class Reference

#include <transformation.hpp>

Static Public Member Functions

static std::vector< TransformationCtorconstruct_neuron_type_transformation_chain (const std::vector< const NeuronType * > &unsupported_types, const std::unordered_set< const NeuronType * > &supported_types, const std::vector< std::tuple< TransformationCtor, const NeuronType *, const NeuronType * >> &transformations, bool use_lossy)
 
static void run (const Backend &backend, NetworkBase network, const TransformationAuxData &aux, std::unordered_set< std::string > disabled_trafo_ids=std::unordered_set< std::string >(), bool use_lossy=true)
 
static RegisteredTransformation register_general_transformation (TransformationCtor ctor, TransformationTest test)
 
static RegisteredTransformation register_neuron_type_transformation (TransformationCtor ctor, const NeuronType &src, const NeuronType &tar)
 
template<typename SourceType , typename TargetType >
static RegisteredTransformation register_neuron_type_transformation (TransformationCtor ctor)
 

Detailed Description

The Transformations class is responsible for holding a list of currently supported transformations and to apply transformations in such a way that the network can be executed on the given backend.

Member Function Documentation

static std::vector<TransformationCtor> cypress::Transformations::construct_neuron_type_transformation_chain ( const std::vector< const NeuronType * > &  unsupported_types,
const std::unordered_set< const NeuronType * > &  supported_types,
const std::vector< std::tuple< TransformationCtor, const NeuronType *, const NeuronType * >> &  transformations,
bool  use_lossy 
)
static

Function used to find a series of transfomations which unsupported neuron types into supported neuron types. Throws an exception if no path is found.

static RegisteredTransformation cypress::Transformations::register_general_transformation ( TransformationCtor  ctor,
TransformationTest  test 
)
static

Registers a general transformation which should be executed if an arbitrary test condition regarding the backend and the network is fulfilled.

Parameters
ctoris the constructor that should be called in order to create a new instance of the transformation in question.
testis a callback function which is called whenever the Transformations::execute() function is called. The test function must check whether it is relevant for the given backend and network in question. If yes, it should return true and false if the transformation should not be used.
Returns
RegisteredTransformation, an integer specifying how many transformations have already been registered. This is mostly done to allow register transformations as part of a value initialization once the program is loaded.
static RegisteredTransformation cypress::Transformations::register_neuron_type_transformation ( TransformationCtor  ctor,
const NeuronType src,
const NeuronType tar 
)
static

Registers a new transformation which transforms from one neuron type to another neuron type.

Parameters
ctoris the constructor that should be called in order to create a new instance of the transformation in question.
srcis the source neuron type the transformation allows to transform form.
taris the target neuron type the transformation transforms to.
template<typename SourceType , typename TargetType >
static RegisteredTransformation cypress::Transformations::register_neuron_type_transformation ( TransformationCtor  ctor)
inlinestatic
static void cypress::Transformations::run ( const Backend backend,
NetworkBase  network,
const TransformationAuxData aux,
std::unordered_set< std::string >  disabled_trafo_ids = std::unordered_set< std::string >(),
bool  use_lossy = true 
)
static

Method which transforms the given network in such a way, that it can be executed by the given backend.

Parameters
networkis the network instance that is the subject of the transformation.
backendis the backend on which the network should be executed.
auxis auxiliary data that should be passed to the run() method of the backend, such as the network execution time.
disabled_trafo_idsis a set of transformation identifiers specifying transformations which should not be executed.
use_lossyif true allows the use of so called "lossy" transformations. These transformations may result in a network which is not equivalent to the network the user described.

The documentation for this class was generated from the following file: