Closed richfitz closed 1 year ago
Patch coverage: 100.00
% and no project coverage change.
Comparison is base (
4f9f69e
) 100.00% compared to head (2dffc48
) 100.00%.:exclamation: Current head 2dffc48 differs from pull request most recent head 5c02f09. Consider uploading reports for the commit 5c02f09 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Code changes themselves look fine, but I'm a bit confused. Where will this be used? What does differentiate mean here? You said in the epic this is for "indicating which parameters we want the likelihood differentiated with respect to". The likelihood is the compare function? Or the compare function is used to build the likelihood after running the adjoint model? How does setting this differentiate flag relate to that? I thought user was just to let users specify the parameter value used in the model. Is it possible to work this out automatically by looking at the parameters that the compare function uses?
Only user()
parameters can be used as the thing we differentiate with respect to, but not all can. For example, in the motivating SIR model we can't differentiate against freq
as it is an integer, and we probably would not want to differentiate with respect to dt
if we provided that directly. Other things we might not differentiate against would be user "parameters" that represent data (mixing matrices, vaccination schedules etc).
The compare function goes into the likelihood (the likelihood is the sum over all the times that the compare gets called). The parameters that we differentiate with respect to get added into the adjoint model so that it has some extra variables, each corresponding to the partial derivative of the likelihood with respect to a parameter.
All parameters will ultimately end up somewhere in the graph, and it's not just the bit in the compare function that matters. Again, in the motivating SIR model we differentiate with respect to parameters that only appear in the forward time model and not in the compare function
This PR builds on #294 to add control over differentiation of parameters to odin. The syntax for users just replaces
with