You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I provide more than one intervention to the load_and_optimize_and_sample_petri_model(...) function, I get the following IndexError:
For reference, these are the inputs:
num_samples=5timepoints=np.arange(5.0, dtype=float)
start_time=timepoints[0] -1e-5# Interventions over the parameters# interventions = [(2.1, "beta")]# intervention_bounds = [[0.0], [3.0]]interventions= [(2.5, "beta"), (3.2, "beta")] # <=========intervention_bounds= [[0.0, 0.5], [3.0, 1.0]]
# Initial conditionstart_state= {}
forvarinmodel['semantics']['ode']['initials']:
start_state[var['target']] =var['expression']
forparaminmodel['semantics']['ode']['parameters']:
start_state[var['target']] =start_state[var['target']].replace(param['id'], str(param['value']))
start_state[var['target']] =float(start_state[var['target']])
# Optimization objective function to be minimized# e.g. L1 norm of intervention parametersobjective_function=lambdax: np.sum(np.abs(x))
# Quantity of interest that is targeted by the optimization# tuple of the form (callable function, state variable name, function arguments# "scenario2dec_nday_average" computes the average of the n last daysqoi= ("scenario2dec_nday_average", "Infected_sol", 2)
optimize_result=load_and_optimize_and_sample_petri_model(
model_path,
num_samples,
timepoints=timepoints,
interventions=interventions,
bounds=intervention_bounds,
qoi=qoi,
risk_bound=10.0,
objfun=objective_function,
initial_guess=1.0, # initial guess of the parameter for the optimizerverbose=True,
start_time=start_time,
start_state=start_state,
n_samples_ouu=int(100),
method="euler",
alpha_qs= [0.25, 0.5, 0.75, 0.95]
)
The model is just BIOMD0000000955_askenet.json
The text was updated successfully, but these errors were encountered:
When I provide more than one intervention to the
load_and_optimize_and_sample_petri_model(...)
function, I get the following IndexError:For reference, these are the inputs:
The model is just
BIOMD0000000955_askenet.json
The text was updated successfully, but these errors were encountered: