nest-simulator icon indicating copy to clipboard operation
nest-simulator copied to clipboard

Incorporate Distance-Dependent Connection Probability in Structural Plasticity Module

Open FinnBurkhardt opened this issue 1 year ago • 1 comments

I would like to add the option to the structural plasticity module that incorporates a distance-dependent connection probability. Nodes that are further apart should have a lower probability of connecting than nodes that are closer together. This feature would use position information determined by the spatial module.

A list of distances (or a proportional probability) could be maintained inside the structural plasticity class.

Since large distances can result in small probabilities, a trivial Bernoulli sampling is not ideal. Instead, the position-dependent probabilities should be scaled or a method like roulette wheel selection should be considered.

I have already worked on a prototype incorporating the following:

Potential new attributes:

  • double sigma The standard derivation for the Gaussian kernel for the calculation of the distance-dependent probability.
  • std::unordered_map<size_t, double> distance_probabilities; stores the distance-dependent probabilities. Since the probability is symmetrical, (id1,id2) and (id2,id1) share the same index. (see get_neuron_pair_index)

Potential new methods:

  • void SPManager::update_probability_list(std::vector< size_t > pre_vacant_id ,std::vector< size_t > post_vacant_id)) checks if the ids of the neurons with vacant elements are already in distance_probabilities.
  • int SPManager::get_neuron_pair_index(int id1, int id2) The custom hash function ensures that (id1, id2) and (id2,id1) are mapped to the same index without any other collisions.
  • double SPManager::gaussianKernel(std::vector pos1,std::vector pos2, double sigma) returns the probability based on the positions and the standard derivation sigma.
  • void SPManager::global_shuffle_spacial(std::vector<size_t>& pre_ids, std::vector<size_t>& post_ids,std::vector<size_t>& pre_ids_results, std::vector<size_t>& post_ids_results) similar to global_shuffle. uses rouletteWheelSelection to choose and store connections to be formed in pre_ids_results and post_ids_results.
  • int rouletteWheelSelection(const std::vector& probabilities, std::mt19937& rng) implements roulette wheel selection with binary search to choose connections.

Further options:

  • Data structures like a Barnes–Hut tree could provide a speedup.
  • Kernels other than the Gaussian Kernel might be intersting to add.

FinnBurkhardt avatar May 22 '24 13:05 FinnBurkhardt

Issue automatically marked stale!

github-actions[bot] avatar Aug 13 '24 08:08 github-actions[bot]