Skip to content

Commit

Permalink
Update pynest/examples/wang_decision_making.py
Browse files Browse the repository at this point in the history
Co-authored-by: Hans Ekkehard Plesser <[email protected]>
  • Loading branch information
janskaar and heplesser authored Jun 21, 2024
1 parent fb5b716 commit 21c5568
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pynest/examples/wang_decision_making.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ def run_sim(coherence, seed=123):
num_updates = int(signal_duration / signal_update_interval)
update_times = np.arange(0, signal_duration, signal_update_interval)
update_times[0] = 0.1
rates_a = np.random.normal(mu_a, sigma, size=num_updates)
rates_b = np.random.normal(mu_b, sigma, size=num_updates)
# for p ... below allows us to create a local variable in the iterator which is created once
rates = lambda mu, sig, n: np.fromiter((p.GetValue() for _ in range(n)
for p in [nest.CreateParameter('normal', {'mean': mu, 'std': sig})]), float)
rates_a = rates(mu_a, sigma, n)
rates_b = rates(mu_b, sigma, n)

# synaptic weights
w_plus = 1.7 # strong connections in selective populations
Expand Down

0 comments on commit 21c5568

Please sign in to comment.