GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement Member List

This is the complete list of members for InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement, including all inherited members.

CalcKernelSizeFunc typedefInitSparseConnectivitySnippet::Base
CalcMaxLengthFunc typedefInitSparseConnectivitySnippet::Base
DECLARE_SNIPPET(InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement, 1)InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
DerivedParamVec typedefSnippet::Base
EGPVec typedefSnippet::Base
getCalcKernelSizeFunc() constInitSparseConnectivitySnippet::Baseinlinevirtual
getCalcMaxColLengthFunc() constInitSparseConnectivitySnippet::Baseinlinevirtual
getCalcMaxRowLengthFunc() constInitSparseConnectivitySnippet::Baseinlinevirtual
getColBuildCode() constInitSparseConnectivitySnippet::Baseinlinevirtual
getColBuildStateVars() constInitSparseConnectivitySnippet::Baseinlinevirtual
getDerivedParams() constSnippet::Baseinlinevirtual
getExtraGlobalParamIndex(const std::string &paramName) constSnippet::Baseinline
getExtraGlobalParams() const overrideInitSparseConnectivitySnippet::FixedNumberTotalWithReplacementinlinevirtual
getHashDigest() constInitSparseConnectivitySnippet::Base
getHostInitCode() constInitSparseConnectivitySnippet::Baseinlinevirtual
getNamedVecIndex(const std::string &name, const std::vector< T > &vec)Snippet::Baseinlineprotectedstatic
getParamNames() const overrideInitSparseConnectivitySnippet::FixedNumberTotalWithReplacementinlinevirtual
getRowBuildCode() constInitSparseConnectivitySnippet::Baseinlinevirtual
getRowBuildStateVars() constInitSparseConnectivitySnippet::Baseinlinevirtual
ParamValVec typedefSnippet::Base
SET_CALC_MAX_COL_LENGTH_FUNC([](unsigned int numPre, unsigned int numPost, const std::vector< double > &pars) { const double quantile=pow(0.9999, 1.0/(double) numPost);return binomialInverseCDF(quantile,(unsigned int) pars[0],(double) numPre/((double) numPre *(double) numPost));})InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
SET_CALC_MAX_ROW_LENGTH_FUNC([](unsigned int numPre, unsigned int numPost, const std::vector< double > &pars) { const double quantile=pow(0.9999, 1.0/(double) numPre);return binomialInverseCDF(quantile,(unsigned int) pars[0],(double) numPost/((double) numPre *(double) numPost));})InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
SET_HOST_INIT_CODE("// Allocate pre-calculated row length array\ "$(allocatepreCalcRowLength, $(num_pre) *$(num_threads));\" "//Calculate row lengths\" "const size_t numPostPerThread=($(num_post)+$(num_threads) - 1)/$(num_threads);\" "const size_t leftOverNeurons=$(num_post) % numPostPerThread;\" "size_t remainingConnections=$(total);\" "size_t matrixSize=(size_t)$(num_pre) *(size_t)$(num_post);\" "uint16_t *subRowLengths=$(preCalcRowLength);\" "//Loop through rows\" "for(size_t i=0;i< $(num_pre);i++) {\" " const bool lastPre=(i==($(num_pre) - 1));\" "//Loop through subrows\" " for(size_t j=0;j< $(num_threads);j++) {\" " const bool lastSubRow=(j==($(num_threads) - 1));\" "//If this isn 't the last sub-row of the matrix\" " if(!lastPre||! lastSubRow) {\" "//Get length of this subrow\" " const unsigned int numSubRowNeurons=(leftOverNeurons !=0 &&lastSubRow) ? leftOverNeurons :numPostPerThread;\" "//Calculate probability\" " const double probability=(double) numSubRowNeurons/(double) matrixSize;\" "//Create distribution to sample row length\" " std::binomial_distribution< size_t > rowLengthDist(remainingConnections, probability);\" "//Sample row length;\" " const size_t subRowLength=rowLengthDist($(rng));\" "//Update counters\" " remainingConnections -=subRowLength;\" " matrixSize -=numSubRowNeurons;\" "//Add row length to array\" " assert(subRowLength< std::numeric_limits< uint16_t >::max());\" " *subRowLengths++=(uint16_t) subRowLength;\" " }\" " }\" "}\" "//Insert remaining connections into last sub-row\" " *subRowLengths=(uint16_t) remainingConnections;\" "//Push populated row length array\" "$(pushpreCalcRowLength, $(num_pre) *$(num_threads));\")InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
SET_ROW_BUILD_CODE("if(c == 0) {\ " $(endRow);\" "}\" "const scalar u=$(gennrand_uniform);\" "x+=(1.0 - x) *(1.0 - pow(u, 1.0/(scalar) c));\" "unsigned int postIdx=(unsigned int)(x *$(num_post));\" "postIdx=(postIdx< $(num_post)) ? postIdx :($(num_post) - 1);\" "$(addSynapse, postIdx+$(id_post_begin));\" "c--;\")InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
SET_ROW_BUILD_STATE_VARS({{"x", "scalar", 0.0},{"c", "unsigned int", "$(preCalcRowLength)[($(id_pre) * $(num_threads)) + $(id_thread)]"}})InitSparseConnectivitySnippet::FixedNumberTotalWithReplacement
StringVec typedefSnippet::Base
updateHash(boost::uuids::detail::sha1 &hash) constSnippet::Baseinlineprotected
validate() constInitSparseConnectivitySnippet::Base
~Base()Snippet::Baseinlinevirtual