Changing connections between two populations

30 views
Skip to first unread message

José ángel Ochoa Martínez

unread,
Nov 15, 2021, 1:42:29 PM11/15/21
to ANNarchy
Hi everybody,

I have been working with ANNarchy, and I am trying two hypotheses, which at the moment are not working completely. Maybe you can help me with them:

  1. I would like to change the weight of the connection (for example, in an all to all connection) between two populations during a simulation. I don't know exactly how to define it (I have tried to make 'w' a variable that changes in an equation, but It did not work). The results did not vary, so I think the weight can not be changed once it has been compiled. Would there be any way to do it?
  2. The second approach was to use the Structural plasticity module and prune some synapses to reduce the connexion dynamically in a simulation between two populations. It kinda worked, but then I could not access values like the 'firing rate' (the program maintains it as zero). Also, if I check the spike recording of the populations, it does not change, so the pruning might not be affecting...?
Thank you very much,

Best regards,
Angel

julien...@gmail.com

unread,
Nov 15, 2021, 3:44:49 PM11/15/21
to ANNarchy
Hi Angel,

The first item is weird, it should work. Weights can be changed after compilation, and are automatically available as synaptic variables. The following script should work:

---
from ANNarchy import *

inp = Population(1, Neuron(parameters="r=0.0"))
pop = Population(10, Neuron(equations="r=sum(exc)"))

proj = Projection(inp, pop, 'exc')
proj.connect_all_to_all(weights=1.0)

m = Monitor(pop, 'r')

compile()

inp[0].r = 1.0

simulate(100)

proj.w = 2.0 # doubling the weights should double the post-synaptic activity

simulate(100)

data = m.get('r')

print(data)

import matplotlib.pyplot as plt
plt.plot(data[:, 0])
plt.show()
---

If not, please tell me and/or send me a minimal example. I guess the second approach depends  on the first.

Best
Julien

José ángel Ochoa Martínez

unread,
Nov 18, 2021, 5:08:22 AM11/18/21
to ANNarchy
Thank you very much. That was what I wanted to do! 

I did not know that it was possible to call the  "proj.w" outside the compilation

Reply all
Reply to author
Forward
0 new messages