probability
probability copied to clipboard
Feature Request: Serialization/deserialization for Distribution class objects
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.
:+1: I'd love to use the PixelCNN distribution from tfp but unfortunately it's not usable for me at the moment for lack of a model saving implementation. I don't have a fleet of GPUs at my disposal so I do model selection on a few hyperparameters and retrain the most promising one. But that requires me to save my models...