probability icon indicating copy to clipboard operation
probability copied to clipboard

DistributionLambda in conjunction with TransformedDistribution and ScalarFunctionWithInferredInverse raises Exception

Open MArpogaus opened this issue 3 years ago • 1 comments

Hello,

I am using:

  • TFP Version 0.16.0
  • TF Version 2.8.1

I am training a simple model on a density estimation task.

When using a DistributionLambda in conjunction with a TransformedDistribution and a ScalarFunctionWithInferredInverse bijector i get the following Exception:

ValueError: Exception encountered when calling layer "distribution_lambda" (type DistributionLambda).

Cannot infer tensor rank of objective values.

Call arguments received:
  • inputs=tf.Tensor(shape=(None, 12), dtype=float32)
  • args=<class 'inspect._empty'>
  • kwargs={'training': 'None'}
Error: Process completed with exit code 1.

[Full Traceback]

However, using the same distribution as a custom Loss function works.

MArpogaus avatar May 23 '22 14:05 MArpogaus

I would like to use TransformedDistribution as an output of DistributionLambda as well. It would be helpful if there's a way to use more customized distribution other than Normal, Binomial etc.

hjlgood avatar Jun 18 '23 16:06 hjlgood