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

Introduce TensorFlow support #4

Merged

Conversation

brandonwillard
Copy link
Contributor

This is an attempt to implement #3. First, it abstracts away the Theano specifics/dependencies from the meta objects, then it creates analogous objects for TensorFlow and adds unification and term/operator/arguments generic function implementations for TF objects.

@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch 6 times, most recently from 65a604a to b3f167a Compare March 11, 2019 23:36
@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch from b3f167a to 28a39c9 Compare March 12, 2019 23:06
@brandonwillard
Copy link
Contributor Author

brandonwillard commented Mar 13, 2019

All right, this seems to be at a state of basic functionality. It's able to convert TFP objects to their meta equivalents and reconstruct/reify them from scratch (e.g. a non-trivial model in TFP).

The base objects (i.e. TF objects) corresponding to each meta object are constructed in the current TF graph environment. Since base objects can be constructed as intermediate objects—in order to get otherwise unavailable shape information and such—and not just when requested (e.g. via MetaSymbol.reify()), we might want to set up a means of specifying the graph (or use specific one for meta objects), if only to avoid polluting the user's graph. In other words, we should probably use with tf.name_scope(...):.

@twiecki
Copy link
Member

twiecki commented Mar 13, 2019

@brandonwillard Will this work in eager mode?

@brandonwillard
Copy link
Contributor Author

Good question; haven't tried it out, yet.

@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch 3 times, most recently from 6bf6a34 to a9706ae Compare March 14, 2019 23:32
@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch 3 times, most recently from 8e5a43f to 5671e44 Compare March 21, 2019 00:24
@brandonwillard brandonwillard marked this pull request as ready for review March 21, 2019 00:25
@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch from 5671e44 to 5b5a6dd Compare March 24, 2019 00:57
@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch 2 times, most recently from fd63c6c to c044f6d Compare May 30, 2019 18:49
This commit provides basic TensorFlow graph interop.  There are still a few
design questions and choices to iterate on (e.g. the TF namespace/graph used
during intermediate base-object derived meta object construction steps), but the
basic class wrappers, helper functions, term representation and unification are
working.

Closes pymc-devs#3.
@brandonwillard brandonwillard force-pushed the add-tensorflow-support branch from a93ced9 to 6daa63d Compare June 1, 2019 03:08
@brandonwillard brandonwillard merged commit e09866d into pymc-devs:master Jun 1, 2019
@brandonwillard brandonwillard deleted the add-tensorflow-support branch June 2, 2019 02:16
@brandonwillard brandonwillard added the TensorFlow This issue involves the TensorFlow backend label Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TensorFlow This issue involves the TensorFlow backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants