Reproducing Burman et al. (2023): the network model (Figures 4E to 4H, S7)¶

Paper. Burman RJ, Brodersen PJN, Raimondo JV, Sen A, Akerman CJ (2023). Active cortical networks promote shunting fast synaptic inhibition in vivo. Neuron 111, 3531-3540. doi:10.1016/j.neuron.2023.08.005

Data. These claims are data: elsewhere: their data are generated by the paper's simulation code, gist.github.com/paulbrodersen/2ce61e4e57c7659b727d30e3e1e0128f at revision f6a05661c10051560aa381e334099efd8521617b, transcribed in network.py (its docstring lists the differences, none of which changes the model). They use nothing from DANDI:000458 (version 0.230317.0039, read in reproduce_burman_2023.ipynb; the version constant is npx.VERSION).

Text the claims were written from. The version of record (PMC11913778) with STAR Methods; the supplement (Figure S7) was not available.

Claim Here
fig4f-model-hyperpolarizing-less-activity tested
fig4h-model-synchrony tested
fig4h-model-entropy tested
figs7-model-decoding tested

Method (every claim's criterion): the gist at its defaults (100 patterns, 100 repeats per condition, 800 excitatory and 200 inhibitory neurons, E_GABA -60 mV then -80 mV in the excitatory neurons), run 20 times (Methods, "Each simulation was repeated 20 times"); per run and condition, the gist's entropy, synchrony and peri-stimulus rate of each excitatory neuron from spikes 0 to 12 ms after each input of the first stimulus set, and its decoding accuracy; the 20 runs pooled (16,000 neurons). Seeds are fixed here, 1 to 20, one per run (the gist sets none).

In [1]:
import os
os.environ.setdefault("OMP_NUM_THREADS", "1")
os.environ.setdefault("OPENBLAS_NUM_THREADS", "1")
import time, resource
from multiprocessing import Pool
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import network, npx

pd.set_option("display.width", 200)
T0 = time.time()
SEEDS = list(range(1, 21))
print("dataset named for the record:", npx.DANDISET, npx.VERSION, "(not used by this notebook)")
dataset named for the record: 000458 0.230317.0039 (not used by this notebook)

Data check¶

The model's data are its simulated spikes. First a check that the stimulus held as one periodic set (network.py) gives the same spikes as the gist's whole-run array, on a small network run (10 patterns, 5 repeats) with one seed.

In [2]:
a = network.simulate(7, stimuli=10, repeats=5, periodic=True, spikes=True)
b = network.simulate(7, stimuli=10, repeats=5, periodic=False, spikes=True)
(ta, ia), (tb, ib) = a["spikes"], b["spikes"]
print("spikes, periodic stimulus:", len(ta), "| gist's whole-run array:", len(tb))
print("identical spike trains:", len(ta) == len(tb) and np.array_equal(ia, ib) and np.allclose(ta, tb))
print("inhibitory-to-excitatory summed weight (nS): start %.0f, after balancing %.1f, after test %.1f"
      % tuple(a["w_sums"]))
spikes, periodic stimulus: 19093 | gist's whole-run array: 19093
identical spike trains: True
inhibitory-to-excitatory summed weight (nS): start 15905, after balancing 16646.9, after test 16646.9

Then a check that network.py transcribes the gist: the gist itself, fetched at its revision and run unmodified with the same small options and seed (network.run_gist; its docstring lists what is changed around it: a stand-in for umap, CSR in place of COO for the installed scipy).

In [3]:
# The paper's simulation gist, run unmodified (network.run_gist) on the same small network run
# and seed as `a` above, against network.simulate spike for spike, and per neuron for the last
# condition the gist analyses (hyperpolarizing, -80 mV), whose arrays its namespace keeps.
g = network.run_gist(7, stimuli=10, repeats=5)
tg = np.asarray(g["spike_monitor"]["exc"].t / network.b2.ms)
ig = np.asarray(g["spike_monitor"]["exc"].i)
print("excitatory spikes, gist:", len(tg), "| network.simulate:", len(ta))
print("identical spike trains:", len(ta) == len(tg) and np.array_equal(ia, ig) and np.allclose(ta, tg))
for theirs, ours in (("spike_counts", "spike_count"), ("firing_rates", "firing_rate"), ("entropy", "entropy"), ("synchrony", "synchrony")):
    x, y = np.asarray(g[theirs], float), a[-80][ours]
    print(f"{theirs} (-80 mV): equal in {int(np.isclose(x, y, rtol=1e-12, atol=0, equal_nan=True).sum())} of {len(y)} neurons")
Time elapsed: 11.27 seconds.
Time elapsed: 1.41 seconds.
excitatory spikes, gist: 19093 | network.simulate: 19093
identical spike trains: True
spike_counts (-80 mV): equal in 800 of 800 neurons
firing_rates (-80 mV): equal in 800 of 800 neurons
entropy (-80 mV): equal in 800 of 800 neurons
synchrony (-80 mV): equal in 800 of 800 neurons
In [4]:
t = time.time()
with Pool(4) as pool:
    runs = pool.map(network.run, SEEDS)
print(f"20 runs in {(time.time() - t) / 60:.1f} min (4 processes); peak memory of this process "
      f"{resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1e6:.2f} GB, of a child "
      f"{resource.getrusage(resource.RUSAGE_CHILDREN).ru_maxrss / 1e6:.2f} GB")
rows = []
for seed, r in zip(SEEDS, runs):
    for eg, cond in zip(network.EGABA, ("shunting", "hyperpolarizing")):
        d = r[eg]
        rows.append(dict(seed=seed, condition=cond, E_GABA=eg, spikes_in_condition=d["total_spikes"],
                         neurons_with_spikes=int((d["spike_count"] > 0).sum()),
                         rate_mean=d["firing_rate"].mean(), entropy_mean=np.nanmean(d["entropy"]),
                         synchrony_mean=np.nanmean(d["synchrony"]), accuracy=d["accuracy"],
                         tied_share=d["tied_share"]))
per_run = pd.DataFrame(rows)
print(per_run.round(4).to_string())
print("\nweights after balancing equal weights after the test in every run:",
      all(abs(r["w_sums"][1] - r["w_sums"][2]) < 1e-6 for r in runs))
print("eta in the plastic synapses' compiled code (pre, post), balancing run / test run:",
      sorted({str(r["eta_used"]) for r in runs}))
20 runs in 28.2 min (4 processes); peak memory of this process 0.68 GB, of a child 2.30 GB
    seed        condition  E_GABA  spikes_in_condition  neurons_with_spikes  rate_mean  entropy_mean  synchrony_mean  accuracy  tied_share
0      1         shunting     -60              2119560                  800    19.5021        0.4647          0.7782    0.9840      0.8098
1      1  hyperpolarizing     -80               927971                  800     8.6719        0.1798          0.8909    0.9424      0.9155
2      2         shunting     -60              2107732                  800    19.3281        0.4527          0.7828    0.9780      0.8138
3      2  hyperpolarizing     -80               927676                  800     8.7865        0.2042          0.8767    0.9341      0.9051
4      3         shunting     -60              2118960                  800    19.3958        0.4598          0.7791    0.9867      0.8094
5      3  hyperpolarizing     -80               942619                  800     8.9146        0.1986          0.8813    0.9241      0.9040
6      4         shunting     -60              2110248                  800    19.3885        0.4475          0.7842    0.9898      0.8130
7      4  hyperpolarizing     -80               913382                  800     8.6448        0.1955          0.8825    0.9516      0.9056
8      5         shunting     -60              2126850                  800    19.4938        0.4446          0.7869    0.9921      0.8034
9      5  hyperpolarizing     -80               926675                  800     8.9354        0.1932          0.8840    0.9401      0.9084
10     6         shunting     -60              2101502                  800    19.3823        0.4446          0.7849    0.9858      0.8005
11     6  hyperpolarizing     -80               915946                  800     8.7885        0.1998          0.8800    0.9150      0.9004
12     7         shunting     -60              2102627                  800    19.3354        0.4418          0.7867    0.9814      0.8072
13     7  hyperpolarizing     -80               915534                  800     8.6844        0.2217          0.8661    0.9107      0.8975
14     8         shunting     -60              2124130                  800    19.5615        0.4509          0.7838    0.9839      0.8145
15     8  hyperpolarizing     -80               932060                  800     8.8427        0.2014          0.8791    0.9302      0.9146
16     9         shunting     -60              2111375                  800    19.4979        0.4569          0.7802    0.9810      0.8100
17     9  hyperpolarizing     -80               916273                  800     8.6990        0.1982          0.8804    0.9246      0.9086
18    10         shunting     -60              2106731                  800    19.4406        0.4532          0.7816    0.9824      0.8144
19    10  hyperpolarizing     -80               918057                  800     8.7604        0.2091          0.8740    0.9411      0.9118
20    11         shunting     -60              2122344                  800    19.3906        0.4513          0.7833    0.9883      0.8139
21    11  hyperpolarizing     -80               925992                  800     8.9094        0.2147          0.8721    0.9361      0.9124
22    12         shunting     -60              2102812                  800    19.4031        0.4476          0.7852    0.9857      0.8133
23    12  hyperpolarizing     -80               923217                  800     8.7615        0.2012          0.8777    0.9466      0.8991
24    13         shunting     -60              2132477                  800    19.6771        0.4409          0.7882    0.9829      0.8041
25    13  hyperpolarizing     -80               927808                  800     8.7719        0.1945          0.8817    0.9326      0.9123
26    14         shunting     -60              2110910                  800    19.4427        0.4553          0.7810    0.9815      0.7987
27    14  hyperpolarizing     -80               924724                  800     8.7510        0.1962          0.8817    0.9464      0.9122
28    15         shunting     -60              2122543                  800    19.5927        0.4588          0.7807    0.9891      0.8093
29    15  hyperpolarizing     -80               930883                  800     8.8552        0.2200          0.8690    0.9369      0.9073
30    16         shunting     -60              2117918                  800    19.5656        0.4551          0.7823    0.9860      0.8072
31    16  hyperpolarizing     -80               912095                  800     8.7510        0.2033          0.8781    0.9286      0.9105
32    17         shunting     -60              2113012                  800    19.5010        0.4506          0.7841    0.9824      0.8057
33    17  hyperpolarizing     -80               919978                  800     8.7656        0.2072          0.8749    0.8930      0.9037
34    18         shunting     -60              2118186                  800    19.3885        0.4500          0.7847    0.9906      0.8083
35    18  hyperpolarizing     -80               921568                  800     8.7740        0.1952          0.8833    0.9458      0.9027
36    19         shunting     -60              2101747                  800    19.3938        0.4533          0.7837    0.9829      0.8015
37    19  hyperpolarizing     -80               913797                  800     8.6385        0.1883          0.8864    0.9450      0.8998
38    20         shunting     -60              2128902                  800    19.6688        0.4517          0.7835    0.9817      0.8067
39    20  hyperpolarizing     -80               938168                  800     9.0031        0.2050          0.8781    0.9055      0.9097

weights after balancing equal weights after the test in every run: True
eta in the plastic synapses' compiled code (pre, post), balancing run / test run: ['[[0.1, 0.1], [0.0, 0.0]]']

The gist run unmodified gives the same 19,093 excitatory spikes as network.simulate on the small run, and the same spike count, rate, entropy and synchrony for all 800 excitatory neurons of its hyperpolarizing condition. In all 20 full runs every excitatory neuron spikes in both conditions, the summed inhibitory weight is the same after the test as after balancing, and the compiled code of the plastic synapses used eta = 0.1 during balancing and eta = 0 during the test, as the gist's loop sets it.

In [5]:
def pooled(key):
    sh = np.concatenate([r[-60][key] for r in runs])
    hy = np.concatenate([r[-80][key] for r in runs])
    return sh, hy
def paired_report(key, label):
    sh, hy = pooled(key)
    ok = ~np.isnan(sh) & ~np.isnan(hy)
    t = stats.ttest_rel(sh[ok], hy[ok])
    print(f"{label}: neurons {len(sh)}, defined in both conditions {ok.sum()} (dropped {(~ok).sum()})")
    print(f"  shunting {sh[ok].mean():.4f} +- {stats.sem(sh[ok]):.4f} (SEM), hyperpolarizing {hy[ok].mean():.4f} +- {stats.sem(hy[ok]):.4f}")
    print(f"  paired t test t = {t.statistic:.2f}, p = {t.pvalue:.2e}")
    print(f"  range shunting {np.nanmin(sh):.3f} to {np.nanmax(sh):.3f}, hyperpolarizing {np.nanmin(hy):.3f} to {np.nanmax(hy):.3f}")
    return sh[ok].mean(), hy[ok].mean(), t

fig4h-model-synchrony¶

Model pyramidal neurons are less synchronous with shunting than with hyperpolarizing E_GABAAR (0.784 against 0.881).

In [6]:
syn_sh, syn_hy, syn_t = paired_report("synchrony", "synchrony")
print("expected shunting 0.784 +- 0.001, hyperpolarizing 0.881 +- 0.001")
pr = per_run.pivot(index="seed", columns="condition", values="synchrony_mean")
print("runs with lower mean synchrony under shunting: %d of %d; per-run means shunting %.4f to %.4f, hyperpolarizing %.4f to %.4f"
      % ((pr.shunting < pr.hyperpolarizing).sum(), len(pr), pr.shunting.min(), pr.shunting.max(), pr.hyperpolarizing.min(), pr.hyperpolarizing.max()))
# the spread between seeds: standard error of the 20-run mean (SD of the per-run means / sqrt(20)),
# and the distance of each pooled mean from the paper's value in units of it
for cond, mean, paper in (("shunting", syn_sh, 0.784), ("hyperpolarizing", syn_hy, 0.881)):
    se = pr[cond].std(ddof=1) / np.sqrt(len(pr))
    print(f"{cond}: run-to-run SE of the mean {se:.4f}; pooled mean {mean:.4f} is {abs(mean - paper) / se:.1f} SE from {paper}")
synchrony: neurons 16000, defined in both conditions 16000 (dropped 0)
  shunting 0.7833 +- 0.0005 (SEM), hyperpolarizing 0.8789 +- 0.0006
  paired t test t = -134.60, p = 0.00e+00
  range shunting 0.432 to 0.898, hyperpolarizing 0.283 to 0.974
expected shunting 0.784 +- 0.001, hyperpolarizing 0.881 +- 0.001
runs with lower mean synchrony under shunting: 20 of 20; per-run means shunting 0.7782 to 0.7882, hyperpolarizing 0.8661 to 0.8909
shunting: run-to-run SE of the mean 0.0006; pooled mean 0.7833 is 1.3 SE from 0.784
hyperpolarizing: run-to-run SE of the mean 0.0013; pooled mean 0.8789 is 1.6 SE from 0.881

Result: partially reproduced. Over the 16,000 pooled neurons synchrony is lower with shunting E_GABA, 0.7833 against 0.8789 (paired t = -134.60; p underflows to 0, below 0.001), and lower in all 20 runs. The shunting mean is within 0.784 +- 0.001; the hyperpolarizing mean is 0.0011 below the lower bound of 0.881 +- 0.001. The per-run hyperpolarizing means span 0.8661 to 0.8909, and the standard error of a 20-run mean from that spread is 0.0013, so the tolerance, the paper's SEM over pooled neurons, is narrower than the spread between runs with other seeds: the hyperpolarizing mean is 1.6 of these SEs from 0.881, the shunting mean 1.3 from 0.784.

fig4h-model-entropy¶

Model pyramidal neurons have higher peri-stimulus entropy with shunting than with hyperpolarizing E_GABAAR (0.451 against 0.197 nats).

In [7]:
ent_sh, ent_hy, ent_t = paired_report("entropy", "entropy (nats)")
print("expected shunting 0.451 +- 0.002, hyperpolarizing 0.197 +- 0.002")
pr = per_run.pivot(index="seed", columns="condition", values="entropy_mean")
print("runs with higher mean entropy under shunting: %d of %d; per-run means shunting %.4f to %.4f, hyperpolarizing %.4f to %.4f"
      % ((pr.shunting > pr.hyperpolarizing).sum(), len(pr), pr.shunting.min(), pr.shunting.max(), pr.hyperpolarizing.min(), pr.hyperpolarizing.max()))
# the spread between seeds: standard error of the 20-run mean (SD of the per-run means / sqrt(20)),
# and the distance of each pooled mean from the paper's value in units of it
for cond, mean, paper in (("shunting", ent_sh, 0.451), ("hyperpolarizing", ent_hy, 0.197)):
    se = pr[cond].std(ddof=1) / np.sqrt(len(pr))
    print(f"{cond}: run-to-run SE of the mean {se:.4f}; pooled mean {mean:.4f} is {abs(mean - paper) / se:.1f} SE from {paper}")
rng = np.random.default_rng(4)  # this section's generator: the 1,000 neurons plotted, as in Figure 4G
fig, axes = plt.subplots(1, 2, figsize=(8, 4))
for ax, key, lab in zip(axes, ("synchrony", "entropy"), ("Synchrony", "Entropy (nats)")):
    sh, hy = pooled(key)
    ok = np.flatnonzero(~np.isnan(sh) & ~np.isnan(hy))
    pick = rng.choice(ok, 1000, replace=False)
    ax.scatter(hy[pick], sh[pick], s=3)
    lim = [min(sh[pick].min(), hy[pick].min()), max(sh[pick].max(), hy[pick].max())]
    ax.plot(lim, lim, "k--", lw=1); ax.set_xlabel(lab + ", hyperpolarizing"); ax.set_ylabel(lab + ", shunting")
    print(f"{key}: plotted 1,000 of {len(ok)} neurons, range {lim[0]:.3f} to {lim[1]:.3f}, none outside the axes")
fig.tight_layout(); plt.show()
entropy (nats): neurons 16000, defined in both conditions 16000 (dropped 0)
  shunting 0.4516 +- 0.0020 (SEM), hyperpolarizing 0.2014 +- 0.0019
  paired t test t = 93.09, p = 0.00e+00
  range shunting 0.000 to 1.462, hyperpolarizing 0.000 to 1.386
expected shunting 0.451 +- 0.002, hyperpolarizing 0.197 +- 0.002
runs with higher mean entropy under shunting: 20 of 20; per-run means shunting 0.4409 to 0.4647, hyperpolarizing 0.1798 to 0.2217
shunting: run-to-run SE of the mean 0.0014; pooled mean 0.4516 is 0.4 SE from 0.451
hyperpolarizing: run-to-run SE of the mean 0.0023; pooled mean 0.2014 is 1.9 SE from 0.197
synchrony: plotted 1,000 of 16000 neurons, range 0.527 to 0.964, none outside the axes
entropy: plotted 1,000 of 16000 neurons, range 0.000 to 1.335, none outside the axes
No description has been provided for this image

Result: partially reproduced. Entropy is higher with shunting E_GABA, 0.4516 against 0.2014 nats (paired t = 93.09; p underflows to 0, below 0.001), and higher in all 20 runs. The shunting mean is within 0.451 +- 0.002; the hyperpolarizing mean is 0.0024 above the upper bound of 0.197 +- 0.002. Per-run hyperpolarizing means span 0.1798 to 0.2217, wider than the tolerance; the standard error of a 20-run mean from that spread is 0.0023, and the hyperpolarizing mean is 1.9 of these SEs from 0.197 (the shunting mean 0.4 from 0.451).

fig4f-model-hyperpolarizing-less-activity¶

In the network model, shunting E_GABAAR gives more variable input-evoked spike times, while hyperpolarizing E_GABAAR gives less activity and spiking more closely aligned across neurons.

The activity part: the gist's peri-stimulus firing rate of the excitatory neurons, pooled over the 20 runs, neurons with no spike included at zero, paired t test. The spike-time parts are judged in the two claims above.

In [8]:
sh, hy = pooled("firing_rate")
t = stats.ttest_rel(sh, hy)
print(f"neurons {len(sh)}; peri-stimulus rate shunting {sh.mean():.3f} +- {stats.sem(sh):.3f} Hz, "
      f"hyperpolarizing {hy.mean():.3f} +- {stats.sem(hy):.3f} Hz; paired t = {t.statistic:.2f}, p = {t.pvalue:.2e}")
print("neurons with no peri-stimulus spike: shunting %d, hyperpolarizing %d" % ((sh == 0).sum(), (hy == 0).sum()))
pr = per_run.pivot(index="seed", columns="condition", values="rate_mean")
print("runs with lower mean rate under hyperpolarizing: %d of %d" % ((pr.hyperpolarizing < pr.shunting).sum(), len(pr)))
sp = per_run.pivot(index="seed", columns="condition", values="spikes_in_condition")
print("spikes over the whole condition (all 100 repeats), hyperpolarizing / shunting: %.3f to %.3f"
      % ((sp.hyperpolarizing / sp.shunting).min(), (sp.hyperpolarizing / sp.shunting).max()))
neurons 16000; peri-stimulus rate shunting 19.468 +- 0.026 Hz, hyperpolarizing 8.785 +- 0.020 Hz; paired t = 446.42, p = 0.00e+00
neurons with no peri-stimulus spike: shunting 0, hyperpolarizing 0
runs with lower mean rate under hyperpolarizing: 20 of 20
spikes over the whole condition (all 100 repeats), hyperpolarizing / shunting: 0.431 to 0.445

Result: reproduced. The peri-stimulus rate is lower with hyperpolarizing E_GABA, 8.785 against 19.468 Hz over 16,000 neurons (paired t = 446.42, p below 0.05), and lower in all 20 runs; over whole conditions the hyperpolarizing network fires 0.431 to 0.445 times the spikes of the shunting one. The spike-time parts of the statement hold in the two claims above (higher entropy and lower synchrony with shunting E_GABA).

figs7-model-decoding¶

Responses of networks with shunting E_GABAAR to 100 different input patterns are decoded more accurately by a downstream classifier.

The gist's decoder: spike counts of the first 50 excitatory neurons in each 25 ms epoch, a k-nearest neighbour classifier (scikit-learn defaults), 5-fold shuffled stratified cross-validation over the 10,000 trials of a condition, mean accuracy. Chance is 1%. Readings: (D1) paired t test of the 20 per-run accuracies, (D2) shunting higher in every run.

The spike counts are small integers, so many training trials are at the same distance from a test trial, and which of them are the five neighbours depends on how the classifier breaks ties. That is not fixed by the seeds: executions of this notebook on different runners, with the same per-run rate, entropy and synchrony, have printed D1 t = 16.92 (p = 6.52e-13) and t = 16.42 (p = 1.11e-12) from slightly different per-run accuracies. So the cell below also gives, per condition, the share of test trials whose fifth neighbour is tied with the sixth, and D1 and D2 recomputed with tied neighbours chosen by five other random orders of the training trials (network.decoding_ties).

In [9]:
acc = per_run.pivot(index="seed", columns="condition", values="accuracy")
t = stats.ttest_rel(acc.shunting, acc.hyperpolarizing)
print(acc.round(4).to_string())
print(f"\nmean accuracy shunting {acc.shunting.mean():.4f}, hyperpolarizing {acc.hyperpolarizing.mean():.4f} (chance 0.01)")
print(f"D1 paired t = {t.statistic:.2f}, p = {t.pvalue:.2e}")
print("D2 shunting higher in %d of %d runs" % ((acc.shunting > acc.hyperpolarizing).sum(), len(acc)))
tied = per_run.pivot(index="seed", columns="condition", values="tied_share")
print("\ntest trials whose fifth neighbour is tied with the sixth: shunting %.2f to %.2f, hyperpolarizing %.2f to %.2f (share per run)"
      % (tied.shunting.min(), tied.shunting.max(), tied.hyperpolarizing.min(), tied.hyperpolarizing.max()))
orders = {cond: np.array([r[eg]["accuracy_orders"] for r in runs]) for eg, cond in zip(network.EGABA, ("shunting", "hyperpolarizing"))}
spread = {cond: (a.max(axis=1) - a.min(axis=1)) for cond, a in orders.items()}
print("range of a run's accuracy over the five training orders: shunting up to %.4f, hyperpolarizing up to %.4f"
      % (spread["shunting"].max(), spread["hyperpolarizing"].max()))
for k in range(orders["shunting"].shape[1]):
    sh, hy = orders["shunting"][:, k], orders["hyperpolarizing"][:, k]
    tk = stats.ttest_rel(sh, hy)
    print(f"training order {k + 1}: mean shunting {sh.mean():.4f}, hyperpolarizing {hy.mean():.4f}; "
          f"D1 t = {tk.statistic:.2f}, p = {tk.pvalue:.2e}; D2 {(sh > hy).sum()} of {len(sh)}")
print(f"\nnotebook run time {(time.time() - T0) / 60:.1f} min")
condition  hyperpolarizing  shunting
seed                                
1                   0.9424    0.9840
2                   0.9341    0.9780
3                   0.9241    0.9867
4                   0.9516    0.9898
5                   0.9401    0.9921
6                   0.9150    0.9858
7                   0.9107    0.9814
8                   0.9302    0.9839
9                   0.9246    0.9810
10                  0.9411    0.9824
11                  0.9361    0.9883
12                  0.9466    0.9857
13                  0.9326    0.9829
14                  0.9464    0.9815
15                  0.9369    0.9891
16                  0.9286    0.9860
17                  0.8930    0.9824
18                  0.9458    0.9906
19                  0.9450    0.9829
20                  0.9055    0.9817

mean accuracy shunting 0.9848, hyperpolarizing 0.9315 (chance 0.01)
D1 paired t = 16.42, p = 1.11e-12
D2 shunting higher in 20 of 20 runs

test trials whose fifth neighbour is tied with the sixth: shunting 0.80 to 0.81, hyperpolarizing 0.90 to 0.92 (share per run)
range of a run's accuracy over the five training orders: shunting up to 0.0020, hyperpolarizing up to 0.0045
training order 1: mean shunting 0.9846, hyperpolarizing 0.9316; D1 t = 16.35, p = 1.20e-12; D2 20 of 20
training order 2: mean shunting 0.9848, hyperpolarizing 0.9311; D1 t = 16.77, p = 7.59e-13; D2 20 of 20
training order 3: mean shunting 0.9847, hyperpolarizing 0.9317; D1 t = 17.22, p = 4.75e-13; D2 20 of 20
training order 4: mean shunting 0.9849, hyperpolarizing 0.9315; D1 t = 17.07, p = 5.56e-13; D2 20 of 20
training order 5: mean shunting 0.9849, hyperpolarizing 0.9315; D1 t = 16.89, p = 6.74e-13; D2 20 of 20

notebook run time 30.1 min

Result: reproduced. Decoding accuracy is higher with shunting E_GABA, 0.9848 against 0.9315 on average (chance 0.01); D1 paired t = 16.42, p = 1.11e-12, and D2 holds, shunting higher in 20 of 20 runs. Most test trials have a tie at the fifth neighbour (0.80 to 0.81 of them under shunting, 0.90 to 0.92 under hyperpolarizing), so the accuracies depend on how ties are broken; over five other training orders a run's accuracy moves by at most 0.0020 (shunting) and 0.0045 (hyperpolarizing), D1 gives t = 16.35 to 17.22 (p at most 1.20e-12) and D2 holds in 20 of 20 runs each time. The conclusion does not depend on the tie-breaking.

Summary¶

Claim Outcome
fig4h-model-synchrony partially reproduced (hyperpolarizing mean 0.8789, 0.0011 outside tolerance)
fig4h-model-entropy partially reproduced (hyperpolarizing mean 0.2014, 0.0024 outside tolerance)
fig4f-model-hyperpolarizing-less-activity reproduced
figs7-model-decoding reproduced (under every tie-breaking order tried)

A failure to reproduce here may be a failure of this attempt, not of the paper: see the reasoning and the differences from the paper's method.

The two partial outcomes are means a little outside tolerances that are the SEM over pooled neurons; the spread of the per-run means is wider (the standard error of a 20-run mean is 0.0013 for synchrony and 0.0023 for entropy, and the misses are 1.6 and 1.9 of these), and the paper's seeds are not known.

How the analysis differs from the paper's. The model is the paper's code, with the stimulus held as one periodic set to fit in memory and seeds fixed, so the 20 runs are other draws of the same model than the paper's. On a small run with one seed, network.py gives the same spikes as its own whole-run stimulus and as the gist itself run unmodified, and the same per-neuron rate, entropy and synchrony as the gist; in every full run the learning rate in the compiled synapse code is 0.1 during balancing and 0 during the test (checked above). The seeds fix the spikes but not the decoding accuracy exactly, as the classifier's ties between equally distant trials are broken differently on different runners; the decoding conclusion holds under each tie-breaking order tried.