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

BOLD initialization : avoid divide by zero with default params #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions neurolib/models/bold/timeIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ def integrateBOLD_numba(BOLD, X, Q, F, V, Z, dt, N, rho, alpha, V0, k1, k2, k3,
for i in range(len(Z[0, :])): # loop over all timesteps
# component-wise loop for compatibilty with numba
for j in range(N): # loop over all areas
F[j] = max(F[j], EPS)

X[j] = X[j] + dt * (Z[j, i] - K[j] * X[j] - Gamma[j] * (F[j] - 1))
Q[j] = Q[j] + dt / Tau[j] * (F[j] / rho * (1 - (1 - rho) ** (1 / F[j])) - Q[j] * V[j] ** (1 / alpha - 1))
V[j] = V[j] + dt / Tau[j] * (F[j] - V[j] ** (1 / alpha))
F[j] = F[j] + dt * X[j]

F[j] = max(F[j], EPS)

BOLD[j, i] = V0 * (k1 * (1 - Q[j]) + k2 * (1 - Q[j] / V[j]) + k3 * (1 - V[j]))
return BOLD, X, F, Q, V