Evaluate NeurEco Discrete Dynamic model with the Python API
Evaluate NeurEco Discrete Dynamic model with the Python API#
To evaluate a NeurEco Discrete Dynamic model in Python API, import NeurEcoDynamic library:
from NeurEco import NeurEcoDynamic as Dynamic
Initialize a NeurEco object to handle the Discrete Dynamic problem:
model = Dynamic.DiscreteDynamic()
Build NeurEco Discrete Dynamic model with the Python API or load previously build and saved to “the/path/to/the/saved/discrete/dynamic/model.ernn” model:
Once model contains a Discrete Dynamic model, call method evaluate with the parameters set accordingly to the data to evaluate:
model.evaluate(time, excitations, init_time=None, init_excitations=None, init_outputs=None)
Evaluates a Dynamic model.
list of NumPy column arrays or a column NumPy array
list of NumPy excitations arrays or a excitations NumPy array corresponding to time parameter
list of initial time column arrays or initial time column array
list of initial excitations arrays or initial excitations array
list of initial outputs arrays or initial outputs array
list of output NumPy arrays if multi-trajectory evaluation, NumPy array if single trajectory evaluation
For more information on the data format, see Data preparation for NeurEco Discrete Dynamic with the Python API.
Evaluation of a Dynamic model requires initialization. This initialization can be done in two ways:
Recommended: provide explicitly the initialization of the trajectory to evaluate. The provided initialization contains:
Required: the initial outputs ** init_outputs** of the trajectory to evaluate
Optional: the excitations init_excitations and the timesteps init_time that correspond to these points
If explicit initialization is not provided, NeurEco uses the Steady State Initialization: the beginning of the trajectory is computed from the steady state deduced from the model.