-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.qmd
203 lines (147 loc) · 5.63 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
---
title: "the odin-monty toolkit"
author: "Rich FitzJohn, Marc Baguelin, Ed Knock"
subtitle: "MRC Centre for Global Infectious Disease Analysis, Imperial College London"
date: "2025-02-13"
format:
revealjs:
logo: "images/logo.png"
slide-number: c/t
footer: "[the odin-monty toolkit](https://mrc-ide.github.io/odin-monty/)"
editor: visual
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
r_output <- function(path, highlight = NULL) {
if (is.null(highlight)) {
prefix <- "```r"
} else {
prefix <- sprintf('```{.r code-line-numbers="%s"}', highlight)
}
writeLines(c(prefix, readLines(path), "```"))
}
set.seed(1) # always the same
knitr::knit_hooks$set(small_margins = function(before, options, envir) {
if (before) {
par(mar = c(4, 4, .1, .1))
}
})
```
## Interactive session
```{r, echo=FALSE}
#| fig-width: 8
code <- qrcode::qr_code("https://github.com/mrc-ide/odin-monty-hpru-2025?tab=readme-ov-file#interactive-session")
plot(code)
```
[`github.com/mrc-ide/odin-monty-hpru-2025`](https://github.com/mrc-ide/odin-monty-hpru-2025)
## odin - the beginnings (2016-2019)
- **`odin`** created to integrate ODEs (e.g. for compartmental models) in R with a domain-specific language (DSL)
- Limited support for difference (discrete-time) equations
- Automatic translation to C/C++/JavaScript; efficient solutions in little code
- Used in models of malaria, HIV, ebola and other diseases
- No support for inference
## COVID-19 response
- **`mcstate`** and **`dust`** emerged during the COVID-19 pandemic
- Collaborative work by the UK real-time modelling & research software engineers teams at Imperial College
- Tailored to handle and fit complex state-space models at scale (e.g. Knock et al. 2021)
## Challenges addressed by `dust` and `mcstate`
- **Efficient** (marginal) likelihood computation for large stochastic models via particle filters
- Exploit parallelism (OpenMP & across chains)
- Limited toolkit for inference for models created in `odin`
## Recent developments
- Design of a new architecture, rewiring data, model and parameters
- rewrite from ground up, keeping best ideas and discarding some baggage
- Design of a new interface
- new small BUGS-inspired DSL for priors
- modular approach to inference
- inverts the dependency stack
- Development of automatic differentiation algorithms
## Key components
::::: columns
::: {.column width="60%"}

:::
::: {.column width="40%"}
- `monty` models can be built from
- `odin` and data
- custom DSL
- by composition
- MCMC samplers work on any `monty` model
- Concept of "packer"
:::
:::::
## Introducing `monty`
- **`monty`**: A framework to handle statistical models (defined by their domain and density)
- Aims to offers multiple sampling solutions
- Modular approach so that `odin` and `monty` "collaborate" but remain independent
## Different samplers
::: {layout-ncol=2}


:::
## Introducing automatic differentiation {.smaller}
::::: columns
::: {.column width="60%"}

:::
::: {.column width="40%"}
```{r}
#| results: "asis"
r_output("models/sir_4_AD.R")
```
:::
:::::
## Introducing automatic differentiation {.smaller}

- `odin` DSL is small
- Ladder shaped computation graph
- Regular parameter inputting (red)
- Regular state outputting (green)
## Reverse automatic differentiation {.smaller}

Goal: a large class of `odin` models and the DSL `monty` models can autodifferentiate
## The odin-`monty` vision
- Provide a **modern modeling ecosystem**:
1. Powerful DSL (`odin2`+`monty`)
2. Streamlined parallel simulation & filtering engine (`dust2`)
3. User-friendly statistical integration platform (`monty`)
- Empower researchers to build robust models quickly, accelerating scientific insights
# In action!
(switch to RStudio and Ed here)
```{r, echo=FALSE}
#| fig-width: 8
code <- qrcode::qr_code("https://github.com/mrc-ide/odin-monty-hpru-2025?tab=readme-ov-file#interactive-session")
plot(code)
```
[`github.com/mrc-ide/odin-monty-hpru-2025`](https://github.com/mrc-ide/odin-monty-hpru-2025)
# Toward the future
<!-- ## `odin2` and `dust2` (Rich) -->
<!-- -\> @Rich for most people `odin2` and `dust2` are the same than `odin` and `dust`: can you summarise how the change make the whole toolkit more efficient? the parallelisation of parameter+stochastic draw groups is one I see and better memory usage between "fixed data" and changing parameters but feel free to put what you think -->
## 2025 Roadmap {.smaller}
- Finish development of automatic differentiation
- NUTS and HMC algorithms
- GPU acceleration via CUDA graph API
- MPI-based backend for many-node
- Restore missing features from `mcstate`/`dust` and original `odin`
## Resources
- We will provide a demonstration
- You can find more in [our online `odin` & `monty` book](https://mrc-ide.github.io/odin-monty/)
## `odin`-`monty` Workshop {.smaller}
::::: columns
::: {.column width="60%"}
📅 **24–25 March 2025**
📍 **White City, Imperial College London**
✅ **Hybrid participation available**
✅ **Travel grants available**
✅ **Lightning talk slots!**
🔗 **Register now [here](https://docs.google.com/forms/d/e/1FAIpQLSePERaKXjMMYK0re1mh--2nNM5PCUZaRrd-SL_zSqAYY-pk5A/viewform)!**
⚠️ **Deadline: 19/02 – Don't miss out!**
:::
::: {.column width="40%"}
```{r, echo=FALSE}
#| fig-width: 8
code <- qrcode::qr_code("https://docs.google.com/forms/d/e/1FAIpQLSePERaKXjMMYK0re1mh--2nNM5PCUZaRrd-SL_zSqAYY-pk5A/viewform")
plot(code)
```
:::
:::::