Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug in fhn, hopf, wc, ww models: copy params #232

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions neurolib/models/fhn/timeIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def timeIntegration(params):
"""Sets up the parameters for time integration

:param params: Parameter dictionary of the model
:type params: dict
:return: Integrated activity variables of the model
Expand Down Expand Up @@ -80,8 +80,8 @@ def timeIntegration(params):
max_global_delay = np.max(Dmat_ndt)
startind = int(max_global_delay + 1) # timestep to start integration at

x_ou = params["x_ou"]
y_ou = params["y_ou"]
x_ou = params["x_ou"].copy()
y_ou = params["y_ou"].copy()

# state variable arrays, have length of t + startind
# they store initial conditions AND simulated data
Expand Down Expand Up @@ -229,13 +229,13 @@ def timeIntegration_njit_elementwise(
- ys[no, i - 1]
+ xs_input_d[no] # input from other nodes
+ x_ou[no] # ou noise
+ x_ext[no, i-1] # external input
+ x_ext[no, i - 1] # external input
)
y_rhs = (
(xs[no, i - 1] - delta - epsilon * ys[no, i - 1]) / tau
+ ys_input_d[no] # input from other nodes
+ y_ou[no] # ou noise
+ y_ext[no, i-1] # external input
+ y_ext[no, i - 1] # external input
)

# Euler integration
Expand Down
10 changes: 5 additions & 5 deletions neurolib/models/hopf/timeIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def timeIntegration(params):
"""Sets up the parameters for time integration

:param params: Parameter dictionary of the model
:type params: dict
:return: Integrated activity variables of the model
Expand Down Expand Up @@ -74,8 +74,8 @@ def timeIntegration(params):
max_global_delay = np.max(Dmat_ndt)
startind = int(max_global_delay + 1) # timestep to start integration at

x_ou = params["x_ou"]
y_ou = params["y_ou"]
x_ou = params["x_ou"].copy()
y_ou = params["y_ou"].copy()

# state variable arrays, have length of t + startind
# they store initial conditions AND simulated data
Expand Down Expand Up @@ -208,14 +208,14 @@ def timeIntegration_njit_elementwise(
- w * ys[no, i - 1]
+ xs_input_d[no] # input from other nodes
+ x_ou[no] # ou noise
+ x_ext[no, i-1] # external input
+ x_ext[no, i - 1] # external input
)
y_rhs = (
(a - xs[no, i - 1] ** 2 - ys[no, i - 1] ** 2) * ys[no, i - 1]
+ w * xs[no, i - 1]
+ ys_input_d[no] # input from other nodes
+ y_ou[no] # ou noise
+ y_ext[no, i-1] # external input
+ y_ext[no, i - 1] # external input
)

# Euler integration
Expand Down
8 changes: 4 additions & 4 deletions neurolib/models/wc/timeIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def timeIntegration(params):
startind = int(max_global_delay + 1) # timestep to start integration at

# noise variable
exc_ou = params["exc_ou"]
inh_ou = params["inh_ou"]
exc_ou = params["exc_ou"].copy()
inh_ou = params["inh_ou"].copy()

# state variable arrays, have length of t + startind
# they store initial conditions AND simulated data
Expand Down Expand Up @@ -219,7 +219,7 @@ def S_I(x):
c_excexc * excs[no, i - 1] # input from within the excitatory population
- c_inhexc * inhs[no, i - 1] # input from the inhibitory population
+ exc_input_d[no] # input from other nodes
+ exc_ext[no, i-1]
+ exc_ext[no, i - 1]
) # external input
+ exc_ou[no] # ou noise
)
Expand All @@ -233,7 +233,7 @@ def S_I(x):
* S_I(
c_excinh * excs[no, i - 1] # input from the excitatory population
- c_inhinh * inhs[no, i - 1] # input from within the inhibitory population
+ inh_ext[no, i-1]
+ inh_ext[no, i - 1]
) # external input
+ inh_ou[no] # ou noise
)
Expand Down
4 changes: 2 additions & 2 deletions neurolib/models/ww/timeIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def timeIntegration(params):
startind = int(max_global_delay + 1) # timestep to start integration at

# noise variable
exc_ou = params["exc_ou"]
inh_ou = params["inh_ou"]
exc_ou = params["exc_ou"].copy()
inh_ou = params["inh_ou"].copy()

# state variable arrays, have length of t + startind
# they store initial conditions AND simulated data
Expand Down