Skip to content

Commit

Permalink
Fix spatial correlations
Browse files Browse the repository at this point in the history
  • Loading branch information
leon committed Jan 5, 2024
1 parent 0fe20bc commit b705ac9
Show file tree
Hide file tree
Showing 22 changed files with 1,901 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion analysis/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def decode_bump(signal, axis=-1):
dft = np.swapaxes(dft, axis, -1)

m1 = 2.0 * np.absolute(dft) / length
phi = np.arctan2(dft.imag, dft.real) % (2.0 * np.pi)
phi = np.arctan2(dft.imag, dft.real)

return m0, m1, phi

Expand Down
Binary file modified bin/LifNet
Binary file not shown.
184 changes: 169 additions & 15 deletions conf/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,176 @@
##########################################
# Simulation parameters
##########################################
IF_SAVE_DATA: 1
# to load connectivity matrix from MAT_PATH
IF_LOAD_MAT: 1
# to save connectivity matrix from MAT_PATH
IF_SAVE_MAT: 0

IF_REC_SPIKE: 0

# saving the last T_SAVE ms
T_SAVE: 1000.0

# path for the output files of the simulation
DATA_PATH: /home/leon/models/lif_cpp/data/simul
# path to load/save the connectivity matrix
MAT_PATH: /home/leon/models/lif_cpp/data/matrix

# output different prompts for debugging purpose
verbose: 1
N: 10000
N_POP: 1
K: 1000.0

FRAC: [1.0]
# Time step in ms
DT: 0.1
# total simulation time in ms
DURATION: 5000.0
# time to start showing simulation result ms
T_STEADY: 0.0
# Saving to files every T_WINDOW in ms
T_WINDOW: 250.0

##########################################
# Network parameters
##########################################
# Total number of neurons
N: 40000
# Number of populations
N_POP: 2
# Average number of presynaptic inputs
K: 4000.0
# K: 4000.0
# Fraction of neurons in each population
FRAC: [0.8, 0.2]

DT: 0.01
DURATION: 1000.0
T_WINDOW: 10.
##########################################
# Parameters for the stimulus presentation
##########################################
# stimulus has a cosine shape
# time for stimulus onset/offset in ms
T_STIM: [1000.0, 1500.0]
# amplitude of the stimulus
A_STIM: [0.2, 0.0]
# std of the stimulus
STD_STIM: [0.0, 0.0]
# Phase of the 1st stimulus
PHI_STIM: [180.0, 0.0]

# Lif Model
V_THRESH: 1.0
V_REST: 0.0
V_LEAK: 0.0
# Tuning of the stimulus
KAPPA_STIM: [1.0, 0.0]

TAU_MEM: [1.0]
TAU_SYN: [1.0]
T_DIST: [135000.0, 145000.0]
# amplitude of the stimulus
A_DIST: [0.0, 0.0]
# std of the stimulus
STD_DIST: [0.0, 0.0]
# Phase of the 1st stimulus
PHI_DIST: [90.0, 0.0]
# Tuning of the stimulus
KAPPA_DIST: [0.0, 0.0]

CHECK_BISTABILITY: 0
BUMP_SWITCH: [0, 0]
##############
# Network Dynamics
##############
# Threshold in mV
V_THRESH: -50.0
# Resting potential in mV
V_REST: -70.0
# Leak in mV
V_LEAK: -50.0
# Reversal in mV
V_REV: [-20.0, -20.0]

# Conductance based
IF_COND_BASE: 0
# Refractory period
IF_THRESH_DYN: 0
# threshold adaptation
DELTA_THRESH: 5.0
# absolute ref
TAU_AREF: [2.0, 2.0]
# refraction
TAU_REF: [10.0, 10.0]

# Membrane time constants in ms
TAU_MEM: [20.0, 10.0]
# Synaptic time constants in ms
TAU_SYN: [4.0, 2.0]

# Adding NMDA currents
IF_NMDA: 1
# NMDA time constants in s
TAU_NMDA: [80.0, 40.0]
# NMDA strength ratio
R_NMDA: [0.5, 0.5]

# Network's gain
GAIN: 1.0
Iext: [2.0]
Jab: [-1.0]

# Feedforward inputs strengths
Iext: [2.0, 2.0]
# FF rate
M0: 1.0
# Synaptic strengths
# Jab: [15.0, -1.35, 2.5, -2.0]
# Jab: [4.5, -1.125, 0.625, -1.7]
Jab: [3.5, -0.85, 0.6, -1.27]

##############
# CONNECTIVITY
##############
# PROBA can be 'cos', 'spec', 'gauss', 'None'
# By default the matrix is a random sparse matrix Cij
# 'cos' gives a sparse matrix with strong cosine structure,
# Pij = (1 + KAPPA cos(theta_ij) / sqrt(Kb)), Cij = 1 with proba Pij
# 'spec' gives a sparse matrix with weak cosine structure,
# Pij = (1 + KAPPA cos(theta_ij) / sqrt(Kb)) , Cij = 1 with proba Pij

PROBA: ['cos', 'cos', 'cos', 'cos']
KAPPA: [1.0, 0.95, 1.0, 1.0]

# PROBA: ['spec', 'rand', 'rand', 'rand']
# KAPPA: [10.0, 0.0, 0.0, 0.0]

# PROBA: ['lr', 'rand', 'rand', 'rand']
# KAPPA: [3.0, 0.0, 0.0, 0.0]

##############
# STP
##############
# adds STP (as in Mato & Hansel, J Neurosci, 2012)
IF_STP: 1
IS_STP: [1, 0, 0, 0]
USE: [0.03, 0.05, 0.5, 0.05]
TAU_FAC: [600, 400.0, 250, 400]
TAU_REC: [250, 850, 600, 850]

############################
# Feed Forward Input
############################
# adds gaussian noise to feedforward
IF_FF_NOISE: 0
# variance of the noise
STD_FF: [0.01, 0.01]

# adds cosine correlation to the feedforward
IF_FF_CORR: 2
# amplitude of the correlations
A_CORR: [2.0, 1.7]
# tuning of the correlations
CORR_FF: [0.01, 0.01]

####################
# Low rank
####################
LR_SEED: 1
LR_LOAD: 0

LR_RANK: 3
LR_MEAN: [0.0, 0.0, 0.0]
LR_STD: [1.0, 1.0, 1.0]
# ksi_1 ksi_2, ksi_1 h_s, ksi_2 h_s
# LR_RHO: [0.05, 0.8, 0.2]
# LR_RHO: [0.0, 0.8, -0.2]
LR_RHO: [0.0, 1.0, 0.0]
176 changes: 176 additions & 0 deletions conf/config.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
##########################################
# Simulation parameters
##########################################
IF_SAVE_DATA: 1
# to load connectivity matrix from MAT_PATH
IF_LOAD_MAT: 1
# to save connectivity matrix from MAT_PATH
IF_SAVE_MAT: 0

IF_REC_SPIKE: 0

# saving the last T_SAVE ms
T_SAVE: 1000.0

# path for the output files of the simulation
DATA_PATH: /home/leon/models/lif_cpp/data/simul
# path to load/save the connectivity matrix
MAT_PATH: /home/leon/models/lif_cpp/data/matrix

# output different prompts for debugging purpose
verbose: 1

# Time step in ms
DT: 0.1
# total simulation time in ms
DURATION: 5000.0
# time to start showing simulation result ms
T_STEADY: 0.0
# Saving to files every T_WINDOW in ms
T_WINDOW: 250.0

##########################################
# Network parameters
##########################################
# Total number of neurons
N: 40000
# Number of populations
N_POP: 2
# Average number of presynaptic inputs
K: 4000.0
# K: 4000.0
# Fraction of neurons in each population
FRAC: [0.8, 0.2]

##########################################
# Parameters for the stimulus presentation
##########################################
# stimulus has a cosine shape
# time for stimulus onset/offset in ms
T_STIM: [1000.0, 1500.0]
# amplitude of the stimulus
A_STIM: [0.2, 0.0]
# std of the stimulus
STD_STIM: [0.0, 0.0]
# Phase of the 1st stimulus
PHI_STIM: [180.0, 0.0]

# Tuning of the stimulus
KAPPA_STIM: [1.0, 0.0]

T_DIST: [135000.0, 145000.0]
# amplitude of the stimulus
A_DIST: [0.0, 0.0]
# std of the stimulus
STD_DIST: [0.0, 0.0]
# Phase of the 1st stimulus
PHI_DIST: [90.0, 0.0]
# Tuning of the stimulus
KAPPA_DIST: [0.0, 0.0]

CHECK_BISTABILITY: 0
BUMP_SWITCH: [0, 0]
##############
# Network Dynamics
##############
# Threshold in mV
V_THRESH: -50.0
# Resting potential in mV
V_REST: -70.0
# Leak in mV
V_LEAK: -50.0
# Reversal in mV
V_REV: [-20.0, -20.0]

# Conductance based
IF_COND_BASE: 0
# Refractory period
IF_THRESH_DYN: 0
# threshold adaptation
DELTA_THRESH: 5.0
# absolute ref
TAU_AREF: [2.0, 2.0]
# refraction
TAU_REF: [10.0, 10.0]

# Membrane time constants in ms
TAU_MEM: [20.0, 10.0]
# Synaptic time constants in ms
TAU_SYN: [4.0, 2.0]

# Adding NMDA currents
IF_NMDA: 1
# NMDA time constants in s
TAU_NMDA: [80.0, 40.0]
# NMDA strength ratio
R_NMDA: [0.5, 0.5]

# Network's gain
GAIN: 1.0

# Feedforward inputs strengths
Iext: [2.0, 2.0]
# FF rate
M0: 1.0
# Synaptic strengths
# Jab: [15.0, -1.35, 2.5, -2.0]
# Jab: [4.5, -1.125, 0.625, -1.7]
Jab: [3.5, -0.85, 0.6, -1.27]

##############
# CONNECTIVITY
##############
# PROBA can be 'cos', 'spec', 'gauss', 'None'
# By default the matrix is a random sparse matrix Cij
# 'cos' gives a sparse matrix with strong cosine structure,
# Pij = (1 + KAPPA cos(theta_ij) / sqrt(Kb)), Cij = 1 with proba Pij
# 'spec' gives a sparse matrix with weak cosine structure,
# Pij = (1 + KAPPA cos(theta_ij) / sqrt(Kb)) , Cij = 1 with proba Pij

PROBA: ['cos', 'cos', 'cos', 'cos']
KAPPA: [1.0, 0.95, 1.0, 1.0]

# PROBA: ['spec', 'rand', 'rand', 'rand']
# KAPPA: [10.0, 0.0, 0.0, 0.0]

# PROBA: ['lr', 'rand', 'rand', 'rand']
# KAPPA: [3.0, 0.0, 0.0, 0.0]

##############
# STP
##############
# adds STP (as in Mato & Hansel, J Neurosci, 2012)
IF_STP: 1
IS_STP: [1, 0, 0, 0]
USE: [0.03, 0.05, 0.5, 0.05]
TAU_FAC: [600, 400.0, 250, 400]
TAU_REC: [250, 850, 600, 850]

############################
# Feed Forward Input
############################
# adds gaussian noise to feedforward
IF_FF_NOISE: 0
# variance of the noise
STD_FF: [0.01, 0.01]

# adds cosine correlation to the feedforward
IF_FF_CORR: 2
# amplitude of the correlations
A_CORR: [2.0, 1.7]
# tuning of the correlations
CORR_FF: [0.01, 0.01]

####################
# Low rank
####################
LR_SEED: 1
LR_LOAD: 0

LR_RANK: 3
LR_MEAN: [0.0, 0.0, 0.0]
LR_STD: [1.0, 1.0, 1.0]
# ksi_1 ksi_2, ksi_1 h_s, ksi_2 h_s
# LR_RHO: [0.05, 0.8, 0.2]
# LR_RHO: [0.0, 0.8, -0.2]
LR_RHO: [0.0, 1.0, 0.0]
Loading

0 comments on commit b705ac9

Please sign in to comment.