tensorflow / tensorflow/probability

a bug when using MultivariateStudentTLinearOperator in DistributionLamda during training

Open
#1,595 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

I want to build a distribution layer of multivariate students't distribution. when I using tensorflow.distribution.MultivariateStudentTLinearOperator in DistributionLambda, always have an error:

`AttributeError: Exception encountered when calling layer "distribution_lambda_20" (type DistributionLambda).

'Tensor' object has no attribute 'range_dimension'

Call arguments received:
• inputs=['tf.Tensor(shape=(None, 64), dtype=float32)', 'tf.Tensor(shape=(None, 64), dtype=float32)']
• args=<class 'inspect._empty'>
• kwargs={'training': 'None'}`

My code:
`

inputs = tfk.Input(shape=input_shape)

x1= tfkl.Dense(64)(inputs)
x2= tfkl.Dense(64)(inputs)
outputs=tfpl.DistributionLambda(
make_distribution_fn=lambda t: tfd.multivariate_student_t.MultivariateStudentTLinearOperator (df=3,loc=t[0],scale=1e-05+ tf.math.softplus(0.01 *t[1]))
)([x1, x2]) `

This seems like could not receive 'None', but it works when using tfd.StudenT. Is anyone know what is the problem? Any solution? Thank you very much!

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 running the provided TensorFlow Probability reproduction with DistributionLambda and MultivariateStudentTLinearOperator, comparing it with the working StudentT case. Trace the range_dimension error during training and confirm the issue is resolved when the multivariate distribution layer accepts the shown inputs without raising the AttributeError.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.