tensorflow / tensorflow/probability

scale parameter unexpected behavior influence the uncertainty estimation

Open
#1,760 0 comments 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

hi, i was experimenting with tensorflow probability and i made a simple multilayer perceptron with 3 hidden layers alternated to 3 dropout layers and a final distributional layer that model a gaussian distribution with scale and loc trainable.

`scale=1e-8
fratto=1

def normal_sp(params):
return tfd.Normal(loc=params[:,0:1], scale=(scale + tf.math.softplus( params[:,1:2]))/fratto)
#loss function
def NLL(y, distr):
return -distr.log_prob(y)

`
the particular structure of the model is fairly standard and not that important, but
i just realized that the uncertainty estimate of the neural network heavily depends on the value of the hyperparameter fratto even though there is no reason for it to be so fundamental. the neural network should update the value params[:,1:2] accordingly whether i set fratto to 1 or 2 or 3 and reach the same result, instead it doesn't happen and with fratto = 1 i get much larger standard deviation than what the data suggests. With fratto=2 instead i get better results with a lower level of miscalibration.
is it normal that one needs to fine tune the scale parameter?

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 normal_sp distribution function and the NLL loss shown in the report. Reproduce the multilayer perceptron with dropout and the trainable Gaussian loc and scale while varying fratto between 1, 2, and 3. Compare the learned standard deviations and uncertainty calibration to determine whether the differing results indicate expected optimization behavior or a defect.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.