Probability: Debugging option to globally enable `validate_args` for all distributions

Created on 15 Dec 2020  路  3Comments  路  Source: tensorflow/probability

All 3 comments

This seems to work:

tfd.Distribution.validate_args = property(lambda _: True)

tfd.Normal(0., 0.)
# ==> Error

Perhaps it would make sense to expose this via the API? Knowing about this could probably help users be more productive when debugging, as an addition to TF core functions like tf.debugging.enable_check_numerics() and tf.config.run_functions_eagerly().

Yeah I think a method that doesn't rely on hackery like the above would be better. We have generally shied away from global config options like this in TFP, but I definitely think it's worth considering. A tfp.debugging package could be a nice home for such a thing.

Was this page helpful?
0 / 5 - 0 ratings