tensorflow / tensorflow/probability

Save the architecture of a Bayesian neural network

Open
#516 16 comments 4 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 have read the following issue posts: https://github.com/tensorflow/probability/issues/325 and https://github.com/tensorflow/probability/issues/289.

I know I can just save/load the weights of a BNN by simply using functions of model.save_weights and model.load_weights (though I actually used tf.keras.callbacks.ModelCheckpoint to implicitly save the weights with the best performance metrics).

However, my goal is to save the architecture of a Bayesian neural network (BNN). What I tried are:

model.to_json(): saw issue https://github.com/tensorflow/probability/issues/325
model.to_yaml(): can save but cannot load
model.get_config(): can save but cannot load

Is there any workaround to save the architecture of a model that uses TensorFlow Probability layers to a file on the disk?

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 by reading the linked issues 325 and 289, then compare the serialization behavior of model.to_json(), model.to_yaml(), model.get_config(), and the mentioned weight-saving methods. Determine whether a supported architecture save/load path exists for TensorFlow Probability layers; done would be a confirmed workaround or a clearly scoped implementation request.

Written by the indexing model from the issue text.

Assessment

Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.