Extending Gen
Gen is designed for extensibility. To implement behaviors that are not directly supported by the existing modeling languages, users can implement `black-box' generative functions that directly implement the generative function interface. These generative functions can then be invoked by generative functions defined using the built-in modeling language.
The following how-tos describe various ways of extending Gen:
- Adding custom distributions
- Custom incremental computation of return values
- Custom gradient computations
- Implementing custom generative functions from scratch
Gen can also be extended with entirely new modeling languages by implementing new generative function types, and constructors for these types that take models as input. This typically requires implementing the entire generative function interface, and is advanced usage of Gen.