Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate Distance-Dependent Connection Probability in Structural Plasticity Module #3209

Open
FinnBurkhardt opened this issue May 22, 2024 · 1 comment
Assignees
Labels
S: Normal Handle this with default priority stale Automatic marker for inactivity, please have another look here T: Enhancement New functionality, model or documentation

Comments

@FinnBurkhardt
Copy link

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.
@gtrensch gtrensch added T: Enhancement New functionality, model or documentation S: Normal Handle this with default priority I: Behavior changes Introduces changes that produce different results for some users labels Jun 14, 2024
@gtrensch gtrensch removed the I: Behavior changes Introduces changes that produce different results for some users label Jun 14, 2024
Copy link

Issue automatically marked stale!

@github-actions github-actions bot added the stale Automatic marker for inactivity, please have another look here label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: Normal Handle this with default priority stale Automatic marker for inactivity, please have another look here T: Enhancement New functionality, model or documentation
Projects
Status: To do (open issues)
Development

No branches or pull requests

5 participants