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
Copy file name to clipboardExpand all lines: docs/source/python/m-surrogate.rst
+343-3Lines changed: 343 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,347 @@ The `grid_search.py` and `hyperparameter_tuning.py` modules provide tools for sy
163
163
- Visualization of hyperparameter importance
164
164
- Selection of optimal model configurations
165
165
166
-
SECIR Groups Model
167
-
------------------
168
166
169
-
To be added...
167
+
168
+
Graph Neural Network (GNN) Surrogate Models
169
+
--------------------------------------------
170
+
171
+
The Graph Neural Network (GNN) module provides advanced surrogate models that leverage spatial connectivity and age-stratified epidemiological dynamics. These models are designed for immediate and reliable pandemic response by combining mechanistic expert knowledge with machine learning efficiency.
172
+
173
+
Overview and Scientific Foundation
174
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
+
176
+
The GNN surrogate models are based on the research presented in:
177
+
178
+
|Graph_Neural_Network_Surrogates|
179
+
180
+
The implementation leverages the mechanistic ODE-SECIR model (see :doc:`ODE-SECIR documentation <../models/ode_secir>`) as the underlying expert model, using Python bindings to the C++ backend for efficient simulation during data generation.
181
+
182
+
Module Structure
183
+
~~~~~~~~~~~~~~~~
184
+
185
+
The GNN module is located in `pycode/memilio-surrogatemodel/memilio/surrogatemodel/GNN <https://github.com/SciCompMod/memilio/tree/main/pycode/memilio-surrogatemodel/memilio/surrogatemodel/GNN>`_ and consists of:
186
+
187
+
- **data_generation.py**: Generates training and evaluation data by simulating epidemiological scenarios with the mechanistic SECIR model
188
+
- **network_architectures.py**: Defines various GNN architectures (GCN, GAT, GIN) with configurable layers and preprocessing
189
+
- **evaluate_and_train.py**: Implements training and evaluation pipelines for GNN models
190
+
- **grid_search.py**: Provides hyperparameter optimization through systematic grid search
191
+
- **GNN_utils.py**: Contains utility functions for data preprocessing, graph construction, and population data handling
192
+
193
+
Data Generation
194
+
~~~~~~~~~~~~~~~
195
+
196
+
The data generation process in ``data_generation.py`` creates graph-structured training data through mechanistic simulations:
197
+
198
+
.. code-block:: python
199
+
200
+
from memilio.surrogatemodel.GNNimport data_generation
mobility_dir='path/to/mobility', # Mobility data location
209
+
save_path='gnn_training_data.pickle'
210
+
)
211
+
212
+
**Data Generation Workflow:**
213
+
214
+
1. **Parameter Sampling**: Randomly sample epidemiological parameters (transmission rates, incubation periods, recovery rates) from predefined distributions to create diverse scenarios.
215
+
216
+
2. **Compartment Initialization**: Initialize epidemic compartments for each age group in each region based on realistic demographic data. Compartments are initialized using shared base factors.
217
+
218
+
3. **Mobility Graph Construction**: Build a spatial graph where:
219
+
220
+
- Nodes represent geographic regions (e.g., German counties)
221
+
- Edges represent mobility connections with weights from commuting data
222
+
- Node features include age-stratified population sizes
223
+
224
+
4. **Contact Matrix Configuration**: Load and configure baseline contact matrices for different location types (home, school, work, other) stratified by age groups.
225
+
226
+
5. **Damping Application**: Apply time-varying dampings to contact matrices to simulate NPIs:
0 commit comments