fiddy.extensions.amici package
Submodules
fiddy.extensions.amici.amici module
- fiddy.extensions.amici.amici.flatten(arrays: Dict[str, ndarray[Any, dtype[float64]]]) ndarray[Any, dtype[float64]]
- fiddy.extensions.amici.amici.rdata_to_array(rdata: <MagicMock name='mock.AmiciReturnData' id='140508573588624'>)
Convert AMICI return data to fiddy output.
- Parameters:
rdata – The AMICI return data.
- Returns:
The converted return data.
- fiddy.extensions.amici.amici.reshape(array: ndarray[Any, dtype[float64]], structure: Tuple[int, int, Tuple[int, ...]], sensitivities: bool = False) Dict[str, ndarray[Any, dtype[float64]]]
- fiddy.extensions.amici.amici.run_amici_simulation_to_cached_functions(amici_model: <MagicMock name='mock.AmiciModel' id='140508573588432'>, *args, cache: bool = True, output_keys: ~typing.List[str] = None, parameter_ids: ~typing.List[str] = None, amici_solver: <MagicMock name='mock.AmiciSolver' id='140508573588240'> = None, amici_edata: <MagicMock name='mock.AmiciExpData' id='140508573636880'> = None, derivative_variables: ~typing.List[str] = None, **kwargs)
Convert amici.runAmiciSimulation to fiddy functions.
- Parameters:
derivative_variables – The variables that derivatives will be computed or approximated for. See the keys of all_rdata_derivatives for options.
parameter_ids – The IDs that correspond to the values in the parameter vector that is simulated.
Returns – function, derivatives and structure
- fiddy.extensions.amici.amici.simulate_petab_to_cached_functions(petab_problem: ~petab.problem.Problem, amici_model: <MagicMock name='mock.Model' id='140508573642320'>, parameter_ids: ~typing.List[str] = None, cache: bool = True, precreate_edatas: bool = True, precreate_parameter_mapping: bool = True, simulate_petab: ~typing.Callable[[~typing.Any], str] = None, **kwargs) Tuple[Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]], Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]]]
Convert amici.petab_objective.simulate_petab to fiddy functions.
Note that all gradients are provided on linear scale. The correction from ‘log10’ scale is automatically done.
- Parameters:
simulate_petab – A method to simulate PEtab problems with AMICI, e.g. amici.petab_objective.simulate_petab.
parameter_ids – The IDs of the parameters, in the order that parameter values will be supplied. Defaults to petab_problem.parameter_df.index.
petab_problem – The PEtab problem.
cache – Whether to cache the function call.
precreate_edatas – Whether to create the AMICI measurements object in advance, to save time.
precreate_parameter_mapping – Whether to create the AMICI parameter mapping object in advance, to save time.
**kwargs – Passed to simulate_petab.
- Returns:
- tuple
1: A method to compute the function at a point. 2: A method to compute the gradient at a point.
- fiddy.extensions.amici.amici.transform_gradient_lin_to_lin(gradient_value, parameter_value)
- fiddy.extensions.amici.amici.transform_gradient_lin_to_log(gradient_value, parameter_value)
- fiddy.extensions.amici.amici.transform_gradient_lin_to_log10(gradient_value, parameter_value)