petab.v2.extensions.sciml
PEtab SciML extension — classes and runtime state for hybrid ODE/ML problems.
Classes
|
Assigns PEtab SciML NN inputs and outputs. |
|
PEtab SciML hybridization table. |
|
A neural net in the PEtab SciML problem configuration. |
|
The extended configuration of a PEtab SciML problem. |
|
SciML extension runtime state. |
- class petab.v2.extensions.sciml.Hybridization(*, targetId: str, targetValue: Basic, **extra_data: Any)[source]
Bases:
BaseModelAssigns PEtab SciML NN inputs and outputs.
- target_value: sp.Basic
The target value.
- class petab.v2.extensions.sciml.HybridizationTable(hybridizations: list[Hybridization] = None, **kwargs)[source]
Bases:
objectPEtab SciML hybridization table.
- property elements: list[Hybridization]
- classmethod from_df(df: DataFrame, **kwargs) HybridizationTable[source]
Create a HybridizationTable from a DataFrame.
- classmethod from_tsv(file_path: str | Path, base_path: str | Path | None = None) HybridizationTable[source]
Create a HybridizationTable from a TSV file.
- hybridizations: list[Hybridization]
- class petab.v2.extensions.sciml.NeuralNetConfig(*, location: AnyUrl | Path, pre_initialization: bool, format: str)[source]
Bases:
BaseModelA neural net in the PEtab SciML problem configuration.
- location: AnyUrl | Path
- class petab.v2.extensions.sciml.SciMLConfig(*, version: str = '0.1.0', array_files: list[AnyUrl | Path] = [], hybridization_files: list[AnyUrl | Path] = [], neural_networks: dict[str, NeuralNetConfig] | None = {})[source]
Bases:
BaseModelThe extended configuration of a PEtab SciML problem.
- neural_networks: dict[str, NeuralNetConfig] | None
The neural network IDs and info.
- class petab.v2.extensions.sciml.SciMLExt(neural_networks: list | None = None, hybridization_tables: list[HybridizationTable] | None = None, array_data_files: list | None = None)[source]
Bases:
objectSciML extension runtime state.
Accessible as
Problem.extensions.sciml.- add_array_data_from_hdf5(file_path: str | Path, base_path: str | Path | None = None)[source]
Add array data from an HDF5 file.
- add_hybridization(target_id: str, target_value: str)[source]
Add a hybridization entry.
If there is more than one hybridization table the entry is added to the last one.
- Parameters:
target_id – The ID of the target entity in the PEtab problem or neural network model
target_value – The value that is assigned to the target id.
- add_neural_network_from_dict(model_id: str, nn_dict: dict)[source]
Add a neural network from a dictionary.
- add_neural_network_from_yaml(model_id: str, file_path: str | Path, base_path: str | Path | None = None)[source]
Add a neural network from a YAML file.
- static from_config(config, base_path: str | Path | None = None) SciMLExt[source]
Construct a SciMLExt from a ProblemConfig.
- Parameters:
config – A ProblemConfig whose
extensions[EXT_ID_SCIML]entry is aSciMLConfig.base_path – Base path used to resolve relative file paths.
- hybridization_tables: list[HybridizationTable]
- property hybridizations: list[Hybridization]
Flat list of all hybridizations across all hybridization tables.