Translates a graph_ir into a sample-based graphical model library built on ccyan primitives.
Given a directed graphical model represented as a graph_ir, this function does multiple things:
- defines observed and unobserved structs that hold values of observed and unobserved random variables and their associated log probabilities
- defines a function to compute the joint log probability of the model
- defines functions that are equivalent to the following interpretations of the graphical model: (a) running it forward conditioned on observed data; (b) evaluating the joint log probability of the model conditioned on both observed and unobserved random variables; (c) predicting values of observed random variables conditioned on unobserved random variables.
- creates associated build utilities (CMakeLists.txt files, blank canvas main file)
- Todo:
- more functionality coming – a work in progress
These functions are implemented using ccyan primitives. ccyan is a C99 library that depends only on libm and stdint. It does not dynamically allocate memory, making it safe for many low-resource or real-time applications.
- Template Parameters
-
Ts | The distribution types in the graph_ir |
- Parameters
-
gr | a graph_ir and a record pair |
info | information about the generated program |
- Todo:
- more information – a work in progress
- Parameters
-
file_ | if not null, the directory in which to save the generated code relative to executable directory (e.g., "out/") |
- Returns
- program_rep