Skip to content

tsodyks(2)_synapse strange behavior in paired-pulse simulations #3634

@HDictus

Description

@HDictus

Describe the bug
The paired-pulse behavior of both tsodyks_synapse and tsodyks2_synapse is highly unpredictable. While the same parameters, simulation settings, and interval lead to the same strength (it is deterministic), the difference between intervals with a given parameterization is fully chaotic. When I do trains of multiple spikes at 10Hz the behavior of the synapse is reasonable, but paired-pulse simulations specifically seem to have a problem.

Image

To Reproduce
recreate_bug.py :

import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
import numpy as np
import nest


plots_dir = Path('intervalplots')
plots_dir.mkdir(exist_ok=True)

times_run = [0]
def sim(interval, nmodel, modparams, receptor_type):
    nest.ResetKernel()
    times_run[0] += 1
    nest.rng_seed = times_run[0]
    src = nest.Create('spike_train_injector')
    src.spike_times = [1., 1.+interval]
    tgt = nest.Create(nmodel, modparams)
    synapse_model = {
        'synapse_model': 'tsodyks2_synapse',
        'u': 0.5,
        'U': 0.5,
        'receptor_type': receptor_type,
        'tau_fac': 0.0,
        'tau_rec': 1600
    }
    syn = nest.Connect(src, tgt, 'one_to_one', synapse_model, return_synapsecollection=True)
    mm = nest.Create('multimeter', params={'interval': 0.25, 'record_from': ['g_1', 'V_m']})
    nest.Connect(mm, tgt, 'one_to_one')
    nest.Simulate(interval + 50)
    df = pd.DataFrame(mm.get()['events'])
    plt.clf()
    plt.plot(df['times'], df['g_1'])
    plt.savefig(plots_dir / f'{nmodel}-{interval}.png')
    return df

stds = {}
peaks = {}
for interval in (5, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 75, 100, 150, 200, 300, 400, 600, 800):
    pks = []
    for _ in range(10):
        df = sim(interval, 'glif_cond', {'tau_syn': [0.1, 0.1]}, 1)
        pks.append(df['g_1'][df['times'] > interval].max())

    stds[interval] = np.std(pks)
    peaks[interval] = np.mean(pks)

plt.clf()
plt.plot(peaks.keys(), peaks.values())
plt.ylabel('second peak amp')
plt.xlabel('interval')
plt.savefig(plots_dir / 'peaks.png')

for interval in (5, 10, 15, 20, 30, 40, 50, 75, 100, 150, 200):
    sim(interval, 'aeif_cond_alpha_multisynapse', {'tau_syn': [0.1]}, 1)

print(stds)

This script checks that the problem occurs for more than one neuron model.

run python recreate_bug.py and check the figures in 'intervalplots'

You can play with the parameters. I found this behavior to persist regardless of parameters, so long as tau_syn << interval, and it was also there with tsodyks_synapse, and persisted after I reinstalled NEST.

Expected behavior
Given that facilitation is disabled, the amplitude of the second pulse should be most strongly reduced at small intervals, and exponentially decay back to baseline with longer intervals.

Desktop/Environment (please complete the following information):

  • OS: Red Hat Enterprise Linux 9.4 (Plow)
  • Shell: bash
  • Python-Version: 3.11.7
  • NEST version 3.8.0-post0.dev0
  • Installation: built from source, no summary was shown at the end. regular install instructions did not work on the cluster, enlisted help from IT staff, installed using the commands:
module load gcc openmpi python cmake gsl boost hdf5/1.14.3-mpi py-mpi4py py-cython
python3 -m venv --system-site-packages venv
source venv/bin/activate
cmake -B build -Dwith-mpi=ON -Dwith-hdf5=ON
srun -c 18 -q debug --pty cmake --build build -j18
cmake --install build

Where in the outputs can I find the neccessary information about the install?

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: NormalHandle this with default priorityT: DiscussionStill searching for the right way to proceed / suggestions welcome

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions