AmanC007/Spiking-CODER-V2
3B • Updated • 8
prompt stringlengths 199 1.21k | output stringlengths 120 20k |
|---|---|
Design a calcium channel model in MOOSE for a single-compartment neuron that replicates L-type Ca²⁺ dynamics with voltage-dependent activation. The channel must use a Hodgkin-Huxley formalism with a double-power activation gate (X²), no inactivation, and a reversal potential set to *ECA*; scale its maximal conductance ... | import moose
import numpy
def make_Ca():
if moose.exists( 'Ca' ):
return
Ca = moose.HHChannel( 'Ca' )
Ca.Ek = ECA
Ca.Gbar = 40 * SOMA_A
Ca.Gk = 0
Ca.Xpower = 2
Ca.Ypower = 1
Ca.Zpower = 0
xgate = moose.element( 'Ca/gateX' )
... |
Design a calcium concentration model in MOOSE to simulate intracellular calcium dynamics for a single-compartment neuron, where spike-triggered calcium influx must decay with a time constant of 13.333 ms. The model should convert incoming calcium current (from spike-generated events) into concentration changes using a ... | import moose
def make_Ca_conc():
if moose.exists( 'Ca_conc' ):
return
conc = moose.CaConc( 'Ca_conc' )
conc.tau = 0.013333 # sec
conc.B = 17.402e12 # Curr to conc conversion for soma
conc.Ca_base = 0.0 |
Implement a slow afterhyperpolarization potassium channel (K_AHP) in MOOSE to model spike-frequency adaptation in a single-compartment neuron. The channel must use a first-order Z-gate with voltage-independent kinetics where the activation time constant transitions from 50 ms at low calcium to 100 ms at high calcium, u... | import moose
import numpy
def make_K_AHP():
if moose.exists( 'K_AHP' ):
return
K_AHP = moose.HHChannel( 'K_AHP' )
K_AHP.Ek = EK # V
K_AHP.Gbar = 8 * SOMA_A # S
K_AHP.Gk = 0 # S
K_AHP.Xpower = 0
K... |
Implement a potassium channel model in MOOSE for a conductance-based spiking neuron where the activation gate follows Hodgkin-Huxley kinetics with piecewise voltage-dependent rates. The channel must use an instantaneous Z gate (flag 0x100) and a table-based X gate with 3000 divisions spanning -0.1V to 0.05V, where alph... | import moose
import math
import numpy
def make_K_C():
if moose.exists( 'K_C'):
return
K_C = moose.HHChannel( 'K_C' )
K_C.Ek = EK # V
K_C.Gbar = 100.0 * SOMA_A # S
K_C.Gk = 0 ... |
Implement a Hodgkin-Huxley sodium channel model in MOOSE for a somatic compartment with resting potential `EREST_ACT`, ensuring the activation gate follows a dual-exponential kinetics (Xpower=2) and the inactivation gate uses single-exponential dynamics (Ypower=1). The channel must scale conductance by `300 * SOMA_A` a... | import moose
import numpy
def make_Na():
if moose.exists( 'Na' ):
return
Na = moose.HHChannel( 'Na' )
Na.Ek = ENA # V
Na.Gbar = 300 * SOMA_A # S
Na.Gk = 0 # S
Na.Xpo... |
Implement a delayed-rectifier potassium channel (K_DR) in MOOSE for a conductance-based spiking neuron model with Hodgkin-Huxley dynamics. The channel must use a single activation gate (Xpower=1) with voltage-dependent kinetics defined by the provided alpha/beta parameter arrays, scaled to a resting potential of `EREST... | import moose
import numpy
def make_K_DR():
if moose.exists( 'K_DR' ):
return
K_DR = moose.HHChannel( 'K_DR' )
K_DR.Ek = EK # V
K_DR.Gbar = 150 * SOMA_A # S
K_DR.Gk = 0 # S
... |
Implement a transient potassium A-current channel in MOOSE for a single-compartment neuron model, using Hodgkin-Huxley kinetics with separate activation (X) and inactivation (Y) gates. The channel must enforce a maximum conductance scaled by somatic area (`SOMA_A`), a reversal potential of `EK`, and voltage-dependent r... | import moose
import numpy
def make_K_A():
if moose.exists( 'K_A' ):
return
K_A = moose.HHChannel( 'K_A' )
K_A.Ek = EK # V
K_A.Gbar = 50 * SOMA_A # S
K_A.Gk = 0 # S
K... |
Design a minimal glutamatergic synapse model in MOOSE for studying spike-timing-dependent plasticity in a single-compartment neuron. The synapse must use dual-exponential conductance dynamics with rise/decay time constants of 2ms and 9ms, a reversal potential of 0mV, and a maximum conductance scaled by the somatic area... | import moose
def make_glu():
if moose.exists( 'glu' ):
return
glu = moose.SynChan( 'glu' )
glu.Ek = 0.0
glu.tau1 = 2.0e-3
glu.tau2 = 9.0e-3
glu.Gbar = 40 * SOMA_A
sh = moose.SimpleSynHandler( 'glu/sh' )
moose.connect( sh, 'activationOut', ... |
Implement an NMDA synapse model in MOOSE with magnesium block dynamics for a neuromorphic spike-timing-dependent plasticity study. The synapse must include dual-exponential kinetics (τ₁ = τ₂ = 20ms), a reversal potential of 0mV, and conductance scaled by somatic area, while the Mg²⁺ block requires 1.2mM extracellular m... | import moose
def make_NMDA():
if moose.exists( 'NMDA' ):
return
NMDA = moose.SynChan( 'NMDA' )
NMDA.Ek = 0.0
NMDA.tau1 = 20.0e-3
NMDA.tau2 = 20.0e-3
NMDA.Gbar = 5 * SOMA_A
block = moose.MgBlock( '/library/NMDA/block' )
block.CMg = 1.2 ... |
Implement a calcium-permeable NMDA synapse in MOOSE with magnesium block dynamics for a neuromorphic model of spike-timing-dependent plasticity. The synapse must use a double-exponential conductance profile (τ₁ = τ₂ = 20ms), a peak conductance scaled by somatic area, and a magnesium block mechanism with 1.2mM extracell... | import moose
def make_Ca_NMDA():
if moose.exists( 'Ca_NMDA' ):
return
Ca_NMDA = moose.SynChan( 'Ca_NMDA' )
Ca_NMDA.Ek = ECA
Ca_NMDA.tau1 = 20.0e-3
Ca_NMDA.tau2 = 20.0e-3
Ca_NMDA.Gbar = 5 * SOMA_A
block = moose.MgBlock( '/library/Ca_NMDA/block' )
... |
Design a calcium concentration model for NMDA-dependent synaptic plasticity in a dendritic spine using MOOSE, where the calcium dynamics must decay with a 4ms time constant to capture rapid spine-specific signaling. The baseline calcium level should start at 0, but the buffer capacity (B) needs to be set high enough to... | import moose
def make_NMDA_Ca_conc():
if moose.exists( 'NMDA_Ca_conc' ):
return
NMDA_Ca_conc = moose.CaConc( 'NMDA_Ca_conc' )
NMDA_Ca_conc.tau = 0.004 # sec. Faster in spine than dend
NMDA_Ca_conc.B = 17.402e12 # overridden by cellreader.
NMDA_Ca... |
Design a leaky integrate-and-fire axon model in MOOSE to generate spike trains with a fixed threshold of -40 mV and an absolute refractory period of 10 ms. The neuron must reset its membrane potential immediately after firing and remain silent during refractoriness to simulate biological plausibility. Ensure the model ... | import moose
def make_axon():
if moose.exists( 'axon' ):
return
axon = moose.SpikeGen( 'axon' )
axon.threshold = -40e-3 # V
axon.abs_refract = 10e-3 # sec |
Build a multi-compartmental spiking neuron model in MOOSE with dendritic spines, voltage-gated channels (Na³⁺, K⁺, Ca²⁺), and synaptic receptors (NMDA, AMPA, GABA) for studying branch-specific spike initiation and backpropagation. Distribute channel densities using path-dependent rules—soma, axon, and dendrites must ha... | import rdesigneur as rd
def buildRdesigneur():
##################################################################
# Here we define which prototypes are to be loaded in to the system.
# Each specification has the format
# source [localName]
# source can be any of
# filename.extension, # Identi... |
Design a leaky integrate-and-fire neuron model in rdesigneur that captures subthreshold membrane dynamics with exponential decay, where membrane potentials reset after threshold crossing. The neuron must process incoming spike trains with synaptic weights of 0.2 and track postsynaptic potentials over time for later ana... | import rdesigneur as rd
def makeDetailedNeuron():
rdes = buildRdesigneur()
rdes.buildModel( '/model' )
#bcs.addAllPlots() |
Implement a leaky integrate-and-fire network with separate excitatory and inhibitory populations to study balanced-state dynamics under noisy input conditions. Configure 10 randomly selected neurons for membrane potential tracking alongside full spike raster plots, ensuring refractory periods, threshold resets, and mem... | import matplotlib.pyplot as plt
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
from PyQt4 import Qt, QtCore, QtGui
import random
class ExcInhNetBase:
"""Simulates and plots LIF neurons (exc and inh separate).
Author: Aditya Gilra, NCBS, Bangalore, India, October 2014
... |
Build a recurrent spiking network of leaky integrate-and-fire neurons with separate excitatory and inhibitory populations to study the effects of calcium-dependent plasticity on spike-timing dynamics. The excitatory-to-excitatory synapses must use the Graupner-Brunel 2012 plasticity rule with per-synapse calcium pools,... | from moose.neuroml.NeuroML import NeuroML
import moose
class ExcInhNet(ExcInhNetBase):
""" Recurrent network simulation """
def __init__(self,J=J,incC=C,fC=fC,scaleI=g,syndelay=syndelay,**kwargs):
"""Overloads base (parent) class"""
self.J = J # exc connection weight
s... |
Design a 3D visualization system for a biologically detailed spiny neuron model loaded from MOOSE, highlighting dendritic spines in orange while scaling their head radii by 4× for clarity. Overlay a 50×50 grid of green LIF neuron spheres around the soma—each with radius matching the soma’s base—to simulate a hybrid SNN... | import moogli
import rdesigneur as rd
def create_viewer(rdes):
# print "Creating 3D Viewer"
network = moogli.extensions.moose.read(path=rdes.elecid.path,
vertices=10)
# print "Read Network"
network.set("color", moogli.colors.LIGHT_BLUE)
network.groups["sp... |
Build a multi-compartmental spiking pyramidal neuron in MOOSE with dendritic spines, calcium dynamics, and synaptic plasticity mechanisms. The model must include spatially varying ion channel densities (Na⁺, K⁺, Ca²⁺), GABAergic/NMDAR-mediated synapses on apical dendrites, and a distance-dependent spine distribution (4... | import rdesigneur as rd
def buildRdesigneur():
##################################################################
# Here we define which prototypes are to be loaded in to the system.
# Each specification has the format
# source [localName]
# source can be any of
# filename.extension, # Identi... |
Design a single-compartment Hodgkin-Huxley neuron in rdesigneur with biologically plausible ion channel dynamics to study how varying sodium and potassium conductances affect spike-train regularity under constant current injection. The model must track membrane potential, gating variables, and spike timing with 0.1ms r... | import rdesigneur as rd
def makeDetailedNeuron():
rdes = buildRdesigneur()
rdes.buildModel( '/model' )
#bcs.addAllPlots() |
Implement a sparse, probabilistic connectivity scheme for a multi-compartment neuron model in MOOSE where excitatory (AMPA), NMDA, and inhibitory (GABA) synapses receive random spike inputs from a network population. Use fixed connection probabilities (0.005) but vary synaptic delays uniformly between 2–10 ms and weigh... | from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
from __future__ import print_function
import moose
def connectDetailedNeuron():
excProb = 0.005
excSeed = 1234
inhProb = 0.005
inhSeed = 4567
numExc = 0
numNMDA = 0
numInh = 0
delayMax = 0.010
delayMin = 0.... |
Implement a leaky integrate-and-fire network with separate excitatory and inhibitory populations to study how Gaussian noise injection affects spike timing variability and population synchrony. Configure 80% excitatory and 20% inhibitory neurons with standard LIF dynamics (τ_m = 10ms, V_th = -50mV, V_reset = -65mV) and... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import random
from __future__ import print_function
class ExcInhNetBase:
"""Simulates and plots LIF neurons (exc and inh separate).
Author: Aditya Gilra, NCBS, Bangalore,... |
Implement a recurrent spiking network of leaky integrate-and-fire neurons with separate excitatory and inhibitory populations, where excitatory-to-excitatory synapses use the Graupner-Brunel 2012 calcium-based plasticity rule. Each neuron must receive a fixed number of random connections with specified excitatory/inhib... | import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import random
from __future__ import print_function
class ExcInhNet(ExcInhNetBase):
""" Recurrent network simulation """
def __init__(self,J=J,incC=C,fC=fC,scaleI=g,syndelay=syndelay,**kwargs):
... |
Design a spike-rate conversion function for analyzing neuromorphic sensor data where raw spike timings must be transformed into continuous firing rates. The function should convolve input spike trains with a Gaussian kernel (τ = 50 ms) to smooth discrete events into a time-resolved rate estimate, preserving temporal pr... | from numpy import random as nprand
import numpy as np
def rate_from_spiketrain(spiketimes,fulltime,dt,tau=50e-3):
"""
Returns a rate series of spiketimes convolved with a Gaussian kernel;
all times must be in SI units.
"""
sigma = tau/2.
## normalized Gaussian kernel, integral with dt is normed... |
You’re analyzing a balanced excitatory-inhibitory spiking network where membrane potentials evolve under conductance-based dynamics. Plot individual and population firing rates for the first 10 excitatory and inhibitory neurons, plus aggregated rates for both groups, using a 1ms time bin and capping the y-axis at 100Hz... | import matplotlib.pyplot as plt
def extra_plots(net):
## extra plots apart from the spike rasters
timeseries = net.trange
## individual neuron firing rates
fig3 = plt.figure()
plt.subplot(221)
num_to_plot = 10
#rates = []
for nrni in range(num_to_plot):
rate = rate_from_spiketra... |
Design a 2D visualization tool for analyzing membrane potential distributions across a grid of leaky integrate-and-fire neurons in a neuromorphic chip simulation. The function must plot spatial voltage patterns from an *m×n* neuron array, using a colormap scaled between 0.5 and 1.0 to highlight subthreshold dynamics, w... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
def makeScatterPlot( m, n, v ):
fig4 = plt.figure()
dx = 100e-6
dy = 100e-6
x = np.arange( m ) * dx
x = np.tile( x, n )
y = np.arange( n ) * dy
y = y... |
Design a MOOSE-based simulation to monitor and visualize the real-time dynamics of a single neuron’s membrane potential, somatic calcium concentration, and postsynaptic receptor states during spike-train stimulation. Ensure the setup captures both the soma’s voltage and calcium traces via direct connections to their re... | from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import rdesigneur as rd
from __future__ import print_function
def buildNeuronPlots( rdes ):
if not moose.exists( '/graphs' ):
graphs = moose.Neutral( '/graphs' )
vtab = moose.Table( '/graphs/vtab' )
catab = mo... |
Implement a standardized plotting utility for visualizing spike train dynamics in a multi-layer SNN where membrane potentials and spike timings must be compared across different encoding schemes. The function should clean up matplotlib axes by removing unnecessary spines, adjusting tick marks, and adding bold labels—en... | def cleanAx( ax, label, showXlabel = False ):
ax.spines['top'].set_visible( False )
ax.spines['right'].set_visible( False )
ax.tick_params( direction = 'out' )
if not showXlabel:
ax.set_xticklabels( [] )
for tick in ax.xaxis.get_major_ticks():
tick.tick2On = False
for tick in ax.... |
Design a MOOSE-based simulation to visualize the intracellular dynamics of a single neuron under spike-timing-dependent plasticity. Plot membrane potential traces (Vm) in millivolts, intracellular calcium concentration ([Ca]) in micromolar from PCA channels, and the real-time insertion count of GluR receptors over a 5-... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import time
from __future__ import print_function
def saveNeuronPlots( fig, rdes ):
#fig = plt.figure( figsize=(12, 10), facecolor='white' )
#fig.subplots_adjust( left = ... |
Construct a multi-compartmental spiking pyramidal neuron in MOOSE with biologically plausible ion channel distributions and dendritic spines for studying spike-timing-dependent plasticity (STDP). The model must include Hodgkin-Huxley-type channels (Na³⁺, K⁺, Ca²⁺), NMDA/GABA synapses, and a calcium-dependent LTP mechan... | import rdesigneur as rd
def buildRdesigneur():
##################################################################
# Here we define which prototypes are to be loaded in to the system.
# Each specification has the format
# source [localName]
# source can be any of
# filename.extension, # Identi... |
Design a single-compartment neuron in rdesigneur with biologically plausible dynamics for testing spike-timing-dependent plasticity rules. The model must track membrane potential, synaptic currents, and spike trains while allowing real-time parameter adjustments through the `/model` path. Ensure the architecture suppor... | import rdesigneur as rd
def makeDetailedNeuron():
rdes = buildRdesigneur()
rdes.buildModel( '/model' )
#bcs.addAllPlots() |
Implement a sparse, probabilistic connectivity scheme for a multi-compartmental neuron model in MOOSE, where excitatory (AMPA), NMDA, and inhibitory (GABA) synapses receive spike trains from a presynaptic network with fixed random seeds. Use heterogeneous delays between 2–10 ms and weight distributions scaled by maximu... | from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
from __future__ import print_function
import moose
def connectDetailedNeuron():
excProb = 0.00042
excSeed = 1234
inhProb = 0.00013
inhSeed = 4567
numExc = 0
numNMDA = 0
numInh = 0
delayMax = 0.010
delayMin ... |
Build a leaky integrate-and-fire network with 80% excitatory and 20% inhibitory neurons to study how injected noise and tetanic stimulation affect spike-timing dynamics. Implement membrane potential tracking for 10 randomly selected neurons alongside full spike raster plots for both populations, using a 50ms refractory... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
from PyQt4 import Qt, QtCore, QtGui
import random
from __future__ import print_function
class ExcInhNetBase:
"""Simulates and plots LIF neurons (exc and inh separate).
Au... |
Implement a recurrent spiking neural network of leaky integrate-and-fire neurons with separate excitatory and inhibitory populations, where excitatory-to-excitatory synapses use the Graupner-Brunel 2012 calcium-based plasticity rule. Each neuron must receive a fixed number of incoming connections with a specified excit... | import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
from PyQt4 import Qt, QtCore, QtGui
import random
from __future__ import print_function
class ExcInhNet(ExcInhNetBase):
""" Recurrent network simulation """
def __init__(self,J=J,incC=C,fC=fC,scale... |
Design a spike-rate conversion function for analyzing neuromorphic sensor data where raw spike timings must be transformed into continuous firing rates. The function should convolve input spike trains with a Gaussian kernel (τ = 50 ms) to smooth discrete events into a time-resolved rate estimate, accounting for kernel ... | from numpy import random as nprand
import numpy as np
def rate_from_spiketrain(spiketimes,fulltime,dt,tau=50e-3):
"""
Returns a rate series of spiketimes convolved with a Gaussian kernel;
all times must be in SI units.
"""
sigma = tau/2.
## normalized Gaussian kernel, integral with dt is normed... |
You’re analyzing a balanced excitatory-inhibitory spiking network where membrane potentials evolve under conductance-based dynamics. Plot individual and population firing rates for the first 10 excitatory and inhibitory neurons alongside their aggregated activity, using a 1ms time bin to capture transient rate fluctuat... | import matplotlib.pyplot as plt
def extra_plots(net):
## extra plots apart from the spike rasters
timeseries = net.trange
## individual neuron firing rates
fig3 = plt.figure()
plt.subplot(221)
num_to_plot = 10
#rates = []
for nrni in range(num_to_plot):
rate = rate_from_spiketra... |
Design a 2D grid visualization for a neuromorphic chip’s spike-rate-dependent plasticity experiment where each neuron’s membrane potential is recorded across *m×n* units. Plot the normalized firing rates (scaled 0.5–1.0) as a heatmap using a 100µm-spaced grid, applying the *afmhot* colormap to highlight spatial activit... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import moogli
def makeScatterPlot( m, n, v ):
fig4 = plt.figure()
dx = 100e-6
dy = 100e-6
x = np.arange( m ) * dx
x = np.tile( x, n )
y = np.arange( n ) ... |
Design a real-time monitoring system for a multi-compartmental SNN model in MOOSE that tracks somatic membrane potential, calcium dynamics, and postsynaptic receptor activation during spike-timing-dependent plasticity experiments. Your implementation must capture voltage traces from the soma, intracellular calcium conc... | from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import rdesigneur as rd
from PyQt4 import Qt, QtCore, QtGui
from __future__ import print_function
def buildNeuronPlots( rdes ):
if not moose.exists( '/graphs' ):
graphs = moose.Neutral( '/graphs' )
vtab = moose.Ta... |
Design a visualization helper function to standardize spike raster plots and membrane potential traces in your SNN analysis pipeline. The function must remove top/right spines, adjust tick marks outward, and optionally hide x-axis labels for multi-panel figures while adding a bold axis label offset to the upper-left co... | def cleanAx( ax, label, showXlabel = False ):
ax.spines['top'].set_visible( False )
ax.spines['right'].set_visible( False )
ax.tick_params( direction = 'out' )
if not showXlabel:
ax.set_xticklabels( [] )
for tick in ax.xaxis.get_major_ticks():
tick.tick2On = False
for tick in ax.... |
Implement a visualization pipeline for a single-compartment neuron model in MOOSE that tracks three key dynamics during synaptic stimulation: membrane potential (Vm), intracellular calcium concentration ([Ca]), and AMPA receptor insertion rates over time. Plot Vm in millivolts from the `/graphs/vtab` table, sample [Ca]... | import matplotlib.pyplot as plt
import numpy as np
from moose.neuroml.NeuroML import NeuroML
from numpy import random as nprand
import moose
import time
from PyQt4 import Qt, QtCore, QtGui
from __future__ import print_function
def saveNeuronPlots( fig, rdes ):
#fig = plt.figure( figsize=(12, 10), facecolor='white'... |
Design a 3D visualization pipeline for a multi-compartmental neuron model in MOOSE, where a detailed dendritic spine structure must be highlighted alongside a grid of 25×25 leaky integrate-and-fire (LIF) neurons positioned around the soma. The spines should be visually emphasized with scaled head radii (4× apex size) a... | import moogli
import rdesigneur as rd
def create_viewer(rdes):
# print "Creating 3D Viewer"
network = moogli.extensions.moose.read(path=rdes.elecid.path,
vertices=10)
# print "Read Network"
network.set("color", moogli.colors.LIGHT_BLUE)
network.groups["sp... |
Implement a two-compartment Hodgkin-Huxley neuron model with dendritic NMDA receptors and intracellular calcium dynamics for studying spike-timing-dependent plasticity. The soma and dendrite must include distinct sodium and potassium channel kinetics, SK channel modulation by calcium, and a Markov-model NMDA receptor w... | def __init__(self, params, **optionals):
try:
## Parameter values used in the two-compartmental Hodgkin-Huxley model
self.C_m = params['C_m'].value # membrane capacitance (uF/cm**2)
self.kappa = params['kappa'].value ########### membrane capacitance (uF/cm**2)
... |
Implement a glutamate release model for a spiking neural network where synaptic transmission depends on exponential decay dynamics. The function should compute the instantaneous glutamate concentration at time `tau` relative to a presynaptic spike, using a fixed amplitude `A_glu` and decay constant `tau_decay`. Ensure ... | def glurelease(self, tau):
glurel = (self.A_glu * np.exp(-tau/self.tau_decay)) if tau >=0 else 0
return glurel
|
Design a preprocessing pipeline for raw membrane potential recordings from a spiking neural network with leaky integrate-and-fire neurons. The data contains slow drift artifacts that distort spike detection—implement a high-pass Butterworth filter (5th order, cutoff at 100 Hz) to isolate fast transient spike events whi... | def butter_highpass(data, cutoff, fs, order=5, btype='high'):
nyq = 0.5 * fs
normal_cutoff = cutoff / nyq
b, a = signal.butter(order, normal_cutoff, btype= btype, analog=False)
filt_data = signal.filtfilt(b, a, data)
return filt_data
|
Implement a biophysically detailed Hodgkin-Huxley-style dendritic spine model that tracks somatic (Vs) and dendritic (Vd) membrane potentials alongside calcium dynamics, IP₃-mediated signaling, and NMDA receptor kinetics. The system must handle glutamate release events (glui) with time-dependent decay, compute ionic cu... | def HH(self, t, y, glui, dw):
## State variables of the dynamical system
Vs = y[0]
Vd = y[1]
ns = y[2]
hd = y[3]
nd = y[4]
pd = y[5]
Ca = y[6]
CaER = y[7]
hca = y[8]
C0 = y[9]
C1 = y[10]
C2 = y[11]
Ds = y... |
Design a Hodgkin-Huxley neuron simulator that processes stochastic synaptic inputs and noise under variable temporal resolutions. The system must generate random glutamatergic spike trains (binary events) with rate *λ_glu*, integrate them alongside correlated noise (power-law PSD with exponent *β* or Gaussian white noi... | def run(self, **options):
if 'dt' in options:
self.dt = options['dt']
else:
self.dt = 0.005
if 'duration' in options:
self.duration = options['duration']
else:
self.duration = 24000 # 120 seconds (each second is equivalent ... |
Optimize a conductance-based spiking neuron model to match experimental interspike interval (ISI) distributions from recorded spike trains. The function must evaluate membrane potential dynamics over a 120-second simulation (default dt=0.005) using provided initial conditions, discard an initial transient phase (defaul... | def main_optimize(params, func: callable, recording_data, **kwargs):
assert isinstance(params, Parameters), ValueError('params should be lmfit Parameters class')
if 'mode' in kwargs:
mode = kwargs['mode']
else:
mode = 'RMSE'
print(f'{mode} error estimation')
if 'hist_mode' ... |
Implement a two-compartmental Hodgkin-Huxley model with NMDA synaptic dynamics and intracellular calcium signaling to simulate ghost bursts in pyramidal neurons under noisy synaptic bombardment. The model must track somatic and dendritic membrane potentials, ion channel gating variables (Na⁺, K⁺, SK, NMDA), and calcium... | class GhostBurst(object):
def __init__(self, params, **optionals):
try:
## Parameter values used in the two-compartmental Hodgkin-Huxley model
self.C_m = params['C_m'].value # membrane capacitance (uF/cm**2)
self.kappa = params['kappa'].value ########### membran... |
Implement a spike amplitude modulation function for a neuromorphic processor handling leaky integrate-and-fire neurons. Your task is to scale the membrane potential trace of recorded action potentials by a given percentage while preserving the baseline resting potential, ensuring the attenuated waveforms remain biologi... | import numpy as np
def attenuate_action_potential(voltage_vector, percentage):
"""
Attenuates the action potential to a certain percentage, and adds it to the voltage vector
:param voltage_vector: The voltage vector of the action potential
:param percentage: The percentage of the action potential to attenu... |
Generate Poisson-distributed presynaptic spike trains for a single excitatory and inhibitory synapse pair, where spike rates are drawn from given input parameter limits. The function must iteratively decay the spike counts per timestep while tracking remaining events, simulating gradual synaptic depletion over a fixed ... | import numpy as np
def create_presynaptic_spike_trains(input_param_limits):
"""
Creates poisson distributed presynaptic spike traces for the exitation and inhibition
:returns: voltage_vector, the attentuated action potential voltage vector
"""
number_of_E_synapses = 1
number_of_I_synapses = 1
ful... |
Design a preprocessing function for spike train analysis that isolates subthreshold membrane dynamics by removing action potential peaks from recorded voltage traces. The function must take a voltage time series (sampled at 0.025ms resolution) and a spike timestamp, then clamp the membrane potential to -90mV for a 4ms ... | import numpy as np
def remove_spikes(voltage_vector, ap_time):
"""
removes the action potential from the voltage trace
:param voltage_vector: The voltage vector of the simulator output
:param ap_time: the timing of the action potential
:returns: result, the voltage trace without the action potential
"""... |
Design a preprocessing pipeline for a neuromorphic simulator evaluating how excitatory-inhibitory spike train balance affects postsynaptic membrane dynamics. Generate synthetic presynaptic spike events (excitatory and inhibitory) sampled uniformly within given parameter bounds, then partition them into trial batches wh... | import dill as pickle
def set_ground_truth(number_of_core_samples, step_size, name, output_path):
"""
Prepares the simulator for receiving input parameter vectors and outputing results
:param number_of_center_samples: The number of samples to be sampled
:param input_param_names: The names of the parameters
... |
Design a post-processing pipeline for a spiking neural network that converts raw membrane potential recordings into normalized output metrics. The function must handle spike removal by masking action potentials within a 1ms refractory window (defined by `ap_time[0]`), then compute the time-integrated membrane potential... | import pandas as pd
import numpy as np
def extract_outputs(raw_results):
outputs = pd.DataFrame(0, index = np.arange(raw_results.shape[0]), columns = output_names)
outputs['Integral'] = np.sum(remove_spikes(raw_results, ap_time[0]) + 90) / 40.0
return outputs |
Design a single-neuron NEURON simulation to evaluate how balanced excitatory and inhibitory spike trains shape somatic membrane dynamics under varying synaptic conductances. Your task is to write a function that takes pre-recorded spike timings for both E/I inputs, applies them to a morphologically realistic soma model... | import dill as pickle
def simulate_single_param(args):
"""
Simulates a specific input parameter vector
:param args: The parameters for the simulation:
The list of excitatory presynpatic inputs,
The list of inhibitory presynpatic inputs,
and the input param... |
Design a spike-based evaluation framework for a multi-core neuromorphic processor where each core processes `number_of_core_samples` parallel spike trains with fixed `step_size` temporal resolution. Your task is to generate synthetic ground-truth membrane potential traces for benchmarking spike-timing-dependent plastic... | def get_ground_truth(output_path,number_of_core_samples, step_size, name):
print('This is a currently studied system, there is still no ground truth') |
Generate a dataset of perturbed input feature vectors for testing the robustness of a spiking neural network’s spike-timing-dependent plasticity (STDP) learning rule under small input variations. Each core sample should be a random point within predefined feature bounds, with additional perturbed versions created by in... | import time
import pandas as pd
import numpy as np
from scoop import futures
def generate_feature_vectors(number_of_core_samples, step_size):
start = time.time()
lower_limits = np.array([feature_limits[f][0] for f in feature_names])
upper_limits = np.array([feature_limits[f][1] for f in feature_names])
x = low... |
You’re processing binned spike train data from a neuromorphic sensor array where each row represents a neuron’s activity over discrete time bins. Convert the binary spike matrix into a dictionary mapping neuron indices to their exact spike time stamps, preserving temporal precision for downstream STDP or rate-based lea... | import numpy as np
def bin2dict(bin_spikes_matrix):
spike_row_inds, spike_times = np.nonzero(bin_spikes_matrix)
row_inds_spike_times_map = {}
for row_ind, syn_time in zip(spike_row_inds,spike_times):
if row_ind in row_inds_spike_times_map.keys():
row_inds_spike_times_map[row_ind].append... |
Design a preprocessing function to convert sparse spike timing data into a binary spike raster for a neuromorphic vision system. Your task is to take a dictionary mapping neuron indices to lists of spike times (in milliseconds) and output a boolean matrix where each row represents a neuron’s spike train over the full s... | import numpy as np
def dict2bin(row_inds_spike_times_map, num_segments, sim_duration_ms):
bin_spikes_matrix = np.zeros((num_segments, sim_duration_ms), dtype='bool')
for row_ind in row_inds_spike_times_map.keys():
for spike_time in row_inds_spike_times_map[row_ind]:
bin_spikes_matrix[r... |
Implement a preprocessing pipeline to extract and format dendritic voltage traces (DVTs), somatic membrane potentials, and spike trains from simulated multi-compartment neuron experiments stored in pickled dictionaries. The output must handle both raw DVTs and their PCA-reduced projections (if a trained model is provid... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
import sys
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras imp... |
Design a preprocessing pipeline to aggregate spike-timing data from multiple SNN simulations where each experiment file contains raw input currents, somatic membrane potentials, and spike train labels. The pipeline must handle dimensional voltage trace (DVT) features—either raw or PCA-reduced—while stacking input curre... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initial... |
You need to preprocess simulated SNN experiment data for a hybrid CNN-SNN decoder that predicts somatic membrane potentials and output spikes from synaptic input trains. Take raw spike timing dictionaries (excitatory/inhibitory inputs, output spikes) and soma voltage traces, then convert them into binary spike matrices... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initial... |
Design a preprocessing pipeline to aggregate spike-based simulation data from multiple neuromorphic experiments, where each file contains raw input stimuli (`X`), spike train labels (`y_spike`), and somatic membrane potentials (`y_soma`). The parsed outputs must maintain temporal alignment across experiments while stac... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initial... |
Design a multi-output temporal convolutional SNN model that predicts spike trains, somatic membrane potentials, and dendritic voltage traces from binary synaptic input streams. The network must process input windows of variable length with configurable filter sizes, dilation rates, and regularization per layer, using c... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initializers
from keras.re... |
Implement a data generator for training an SNN surrogate model that predicts neuronal spike trains, somatic membrane potentials, and dendritic voltage traces (DVT) from raw synaptic input currents. The generator must sample 400ms windows from high-resolution neuromorphic simulations while ignoring the first 500ms of tr... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initial... |
Build a thread-safe data generator for training a hybrid SNN-ANN model to predict neuronal dynamics from intracellular recordings. The generator must handle 300ms windows of membrane potentials, spike trains, and dendritic voltage transients (DVT) while accounting for a 500ms initial transient period to ignore. Ensure ... | from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, Cropping1D, UpSampling1D, MaxPooling1D, AveragePooling1D
import numpy as np
from keras.layers import Dense, Dropout, Activation, Flatten, Input, TimeDistributed, Reshape, Permute
from keras.models import Model, load_model
from keras import initial... |
Design a spike generator that produces irregular but reproducible spike trains for testing leaky integrate-and-fire neuron dynamics under noisy input conditions. The function must generate `size` spike times uniformly distributed between `low` and `high` milliseconds, then shuffle them while ensuring deterministic outp... | import numpy as np
def random_2(low, high, size):
time_random = np.linspace(low, high, size)
np.random.seed(10)
np.random.shuffle(time_random)
return time_random |
Design a spike latency encoding scheme where each neuron’s first spike time follows a beta distribution between 5ms and 50ms to model variable response delays in a neuromorphic auditory processing system. The membrane potentials should accumulate input spikes until crossing threshold, with the random_beta function gene... | import numpy as np
def random_beta(low, high, size):
time_random = np.random.beta(2, 8, size=size)
np.random.seed(10)
time_random = (high - low)*time_random + low
return time_random |
Simulate glutamate-mediated synaptic integration in a CA2 pyramidal neuron under two receptor pool configurations: a dendritic spine cluster with co-localized AMPA/NMDA receptors (Pool 1) and extrasynaptic NMDA-only receptors (Pool 2). Test how varying synaptic weights (0.01 baseline) and spatial distribution across ba... | import numpy as np
import itertools
import time
import CA229 as de # from CA229 import *
from neuron import h
import utils as ut #from utils import *
def Glu_Stim(TTX = False, Pool1_num = 9, Pool2_num = 9, Syn_w1 = 0.01, Syn_w2 = 0.01, Loc = [0.2, 0.6]):
"""
Model the Glumate Stimulation.
Model the Recepto... |
This dataset contains 40,000 hybrid training samples, designed to blend the benefits of human-written and synthetic data.