tensorflow / tensorflow/probability
Feature Request: Serialization/deserialization for Distribution class objects
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
From here: https://groups.google.com/a/tensorflow.org/g/tfprobability/c/_9EuU3FnErY/m/cpNQENy6AQAJ
- Re: saving models: I think it'd be both advantageous and straightforward for us to implement setstate and getstate in Distributions, Bijectors, and DeferredTensor.
For Distributions I'm currently converting all tf.Tensor objects to numpy on getstate and then calling in setstate
variable.assign(
tf.cast(value, self.dtype)
)
Don't know if you guys have a better way of doing this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by reviewing the Distribution, Bijector, and DeferredTensor classes and the proposed getstate and setstate hooks, including tensor-to-NumPy conversion and variable.assign behavior. Done means these class objects can be serialized and restored reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100