This repository contains the pipeline for Calibration from Fay Frost as part of the CVDNet project.
-
Clone the repository:
git clone https://github.com/alan-turing-institute/cvd-net-pipeline cd cvd-net-pipeline
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On macOS/Linux
-
Install
You can install the dependencies using the pyproject.toml
file:
pip install .
The pipeline can be run by executing the main.py
script. You must specify a configuration file in JSON format using the --config
argument.
The configuration file should define the steps to run and other parameters such as the number of samples. Below is an example configuration file:
{
"steps": ["1", "2", "3"],
"nsamples": 10000,
"input_parameters": "config/parameters_sensitive.json",
"output_path": "data/output"
}
To run the pipeline, specify the configuration file as follows:
python main.py --config config/pipeline_config.json
- Simulate Data: Generates input and output data based on parameters.
- Analyze Giessen: Performs analysis on the simulated pressure waveform data.
- Compute PCA: Performs a PCA on the output data.
- Build Emulator: Builds an emulator for the data.
- Simulate Posterior Data: Simulates data from posterior samples.
- Calibration: Calibrates the model.
- Final Resampling: Performs final resampling on posterior simulations.
To run specific steps, modify the steps
field in the configuration file. For example, to run steps 1, 2, and 3, use the following configuration:
{
"steps": ["1", "2", "3"],
"nsamples": 5000,
"input_parameters": "config/parameters_sensitive.json",
"output_path": "data/output"
}
Then execute:
python main.py --config config/pipeline_config.json
main.py
: Entry point for running the pipeline.pipeline/
: Contains the modules for each step of the pipeline.simulate_data.py
: Simulates input and output data.analyse_giessen.py
: Analyzes the data.build_emulator.py
: Builds the emulator.simulate_posterior.py
: Simulates posterior data.calibrate.py
: Calibrates the model.
This project is licensed under the MIT License. See the LICENSE
file for details.