tensorflow / tensorflow/probability

How to save a distribution?

Open
#533 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I'm starting to implement my own VAE, inspired by this post.

I would like the ability to save and load each of the three core elements: the statistical prior, the variational encoder, and the decoder. This is essential for R&D and production deployment.

Because the latter two objects are wrapped in Keras models, it is possible to save them like so: vae.save('model.h5') and decoder.save('decoder.h5').

But the statistical prior is a Distribution.

Maybe there is a built-in TensorFlow approach? Or do we need to develop one? Or maybe there is a way to access or embed the prior into an existing or new model?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TensorFlow Probability Distribution API and the Keras save examples linked in the issue. Determine how the statistical prior should be serialized alongside the variational encoder and decoder, then define a supported save/load path and verify that all three components can be restored.

Written by the indexing model from the issue text.

Assessment

Tech stack
keras, tensorflow
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.