greta-dev / greta-dev/greta

add transformed_variable node type

Open
#339 0 comments 0 reactions 0 assignees View on GitHub
distributions documentation
Dominant language
C++
Stars
607
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
1

Description

greta's four node-type model (data, operation, variable, distribution) doesn't well capture the case when a node is (statistically) notionally a variable, but computationally better treated as an operation. Currently, greta has some cases where a distribution constructor returns an 'operation node following a distribution', e.g. for `wishart()` and `lkj_correlation()` this works, but is a bit hacky. There is some opaque internal code to deal with these situations.

A more rational architecture would be to replace these with a new node type: `transformed_variable`, inheriting from the `operation` node type, but containing all of these different methods. They would essentially be an operation but with a distribution slot, and with methods to reverse the operation (using tfp bijectors), thereby making it easier to set initial values.

This wouldn't be a major change, but would make it make it easier to standardise and understand the internal workings of greta.

The docs and technical details vignette would need to be updated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.