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
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
186
187
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
188
+
- **network_architectures.py**: Defines various GNN architectures (ARMAConv, GCSConv, GATConv, GCNConv, APPNPConv) with configurable depth and channels
189
189
- **evaluate_and_train.py**: Implements training and evaluation pipelines for GNN models
190
190
- **grid_search.py**: Provides hyperparameter optimization through systematic grid search
191
191
- **GNN_utils.py**: Contains utility functions for data preprocessing, graph construction, and population data handling
192
192
193
193
Data Generation
194
194
~~~~~~~~~~~~~~~
195
195
196
-
The data generation process in ``data_generation.py`` creates graph-structured training data through mechanistic simulations:
196
+
The data generation process in ``data_generation.py`` creates graph-structured training data through mechanistic simulations. Use ``generate_data`` to run multiple simulations and persist a pickle with inputs, labels, damping info, and contact matrices:
197
197
198
198
.. code-block:: python
199
199
200
200
from memilio.surrogatemodel.GNNimport data_generation
mobility_dir='path/to/mobility', # Mobility data location
209
-
save_path='gnn_training_data.pickle'
201
+
import memilio.simulation as mio
202
+
203
+
data = data_generation.generate_data(
204
+
num_runs=5,
205
+
data_dir="/path/to/memilio/data",
206
+
output_path="/tmp/generated_datasets",
207
+
input_width=5,
208
+
label_width=30,
209
+
start_date=mio.Date(2020, 10, 1),
210
+
end_date=mio.Date(2021, 10, 31),
211
+
mobility_file="commuter_mobility.txt", # or commuter_mobility_2022.txt
212
+
transform=True,
213
+
save_data=True
210
214
)
211
215
212
216
**Data Generation Workflow:**
@@ -240,28 +244,18 @@ The data generation process in ``data_generation.py`` creates graph-structured t
240
244
Network Architectures
241
245
~~~~~~~~~~~~~~~~~~~~~
242
246
243
-
The ``network_architectures.py`` module provides flexible GNN model construction for different layer types.
247
+
The ``network_architectures.py`` module provides flexible GNN model construction for supported layer types (ARMAConv, GCSConv, GATConv, GCNConv, APPNPConv).
244
248
245
249
.. code-block:: python
246
250
247
251
from memilio.surrogatemodel.GNNimport network_architectures
0 commit comments