Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Normalization and miniKanren Goals for TensorFlow Graphs #19

Open
brandonwillard opened this issue May 27, 2019 · 2 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed important Features and issues that need to be addressed ASAP miniKanren This issue involves miniKanren goals TensorFlow This issue involves the TensorFlow backend

Comments

@brandonwillard
Copy link
Contributor

After TensorFlow graph support is added (i.e. #4), we will need to adapt the existing miniKanren relations to TF[P] objects.

This might require a core set of linear/tensor-algebraic graph normalization/canonicalization relations, as well, since those were previously provided by Theano.

FYI: It will probably be easier to create new relations specific to TF[P]—compared to generalizing the meta objects enough to cover both. Regardless, we should keep both options in mind.

@brandonwillard brandonwillard added enhancement New feature or request important Features and issues that need to be addressed ASAP help wanted Extra attention is needed labels May 27, 2019
@brandonwillard brandonwillard changed the title Create miniKanren Relations for TensorFlow Graphs Graph Normalization and miniKanren Goals for TensorFlow Graphs Aug 5, 2019
@josephwillard
Copy link

What would be the best way to approach this issue?

@brandonwillard
Copy link
Contributor Author

We can start by creating a goal, normalizeo, and make it able to normalize according to all the standard scalar group axioms under a simple ordering like lexicographical path ordering.

For example, the standard, reduced normalization rewrite-rules for scalars:

inv(e) -> e
x * e -> x
e * x -> x
inv(inv(x)) -> x
x * inv(x) -> e
inv(x) * x -> e
x * (inv(x) * y) -> y
inv(x) * (x * y) -> y
(x * y) * z -> x * (y * z)
inv(x * y) -> inv(y) * inv(x)

Next, we'll need to add some rewrite rules for operator properties (e.g. linearity), tensors, and their interactions with scalars. We might be able to get away with some small combination of axioms.

After that, we can designate specific TF operators (e.g. RandomStandardNormal, Add, etc.) as having said properties using kanren.facts.

@brandonwillard brandonwillard added TensorFlow This issue involves the TensorFlow backend miniKanren This issue involves miniKanren goals labels Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed important Features and issues that need to be addressed ASAP miniKanren This issue involves miniKanren goals TensorFlow This issue involves the TensorFlow backend
Projects
None yet
Development

No branches or pull requests

2 participants