tensorflow / tensorflow/probability

raise error if tfp.layers' kernel_prior/posterior aren't specified with correct shapes

Open
#29 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

A common user mistake is to specify the kernel_prior or kernel_posterior distribution without a matrix event shape. This makes the KL divergence computation incorrect as the KL must be over matrixvariate distributions. Let's catch this early on by checking during build().

Same applies to bias vector.

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 in the tfp.layers build() implementations and trace how kernel_prior, kernel_posterior, and bias distributions are configured before KL divergence is computed. Add early validation for the required matrix and vector event shapes, then verify that incorrectly shaped distributions fail during build().

Written by the indexing model from the issue text.

Assessment

Tech stack
tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.