Replies: 1 comment
-
Hi, thank you writing this up. This should be in the issues page and not in the discussion forum, but never mind :) Please post the entire stack trace here, so we can see the origin of this error. Could be some outdate or incompatible libraries. What system are you running this on? Have you tried to search for this error on Google or Stackexchange? I have never encountered this problem before. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I hope you're doing well.
I'm running an evolutionary algorithm
I am working with an evolutionary algorithm to find values in the ALN model that will allow me to generate a simulated functional matrix as close as possible to an experimental functional matrix.
My code is as follows:
`import numpy as np
import logging
from neurolib.models.aln import ALNModel
from neurolib.utils.parameterSpace import ParameterSpace
from neurolib.optimize.evolution import Evolution
import neurolib.utils.functions as func
from neurolib.optimize import evolution
from neurolib.utils.loadData import Dataset
ds = Dataset("hcp")
model = ALNModel(Cmat = ds.Cmat, Dmat = ds.Dmat) # simulates the whole-brain model in 10s chunks by default if bold == True
Resting state fits
model.params['mue_ext_mean'] = 1.57
model.params['mui_ext_mean'] = 1.6
model.params['sigma_ou'] = 0.09
model.params['b'] = 5.0
model.params['signalV'] = 2
model.params['dt'] = 0.2
model.params['duration'] = 0.2 * 60 * 1000 #ms
testing: aln.params['duration'] = 0.2 * 60 * 1000 #ms
real: aln.params['duration'] = 1.0 * 60 * 1000 #ms
def evaluateSimulation(traj):
rid = traj.id
model = evolution.getModelFromTraj(traj)
defaultDuration = model.params['duration']
invalid_result = (np.nan,)* len(ds.BOLDs)
#%% Parameters
pars = ParameterSpace(['mue_ext_mean', 'mui_ext_mean', 'b', 'sigma_ou', 'K_gl', 'signalV'],
[[0.0, 3.0], [0.0, 3.0], [0.0, 100.0], [0.0, 0.3], [0.0, 500.0], [0.0, 400.0]])
#%% Def evolution
evolution = Evolution(evaluateSimulation, pars, algorithm = 'nsga2', weightList = [1.0] * len(ds.BOLDs), model = model, POP_INIT_SIZE=4, POP_SIZE = 4, NGEN=2, filename="example-2.2.hdf")
#%% Run
evolution.run(verbose = False)
#%% Saving
evolution.saveEvolution()
evolution.info()
But when I try to run everything I always get the same error, even if I'm not using an evolutionary algorithm, this also happens when I use the parameter space to explore constants:
I'm not understanding if I'm missing something, is this error normal, or should I get nothing wrong?
What can I do?
Beta Was this translation helpful? Give feedback.
All reactions