You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried everything, but I still couldn't get rid of it.
The ''warning'' message as follow:
WARNING:root:
Distribution subclass SafeTruncatedNormal inherits _parameter_properties from its parent (TruncatedNormal) while also redefining init. The inherited annotations cover the following parameters: dict_keys(['loc', 'scale', 'low', 'high']). It is likely that these do not match the subclass parameters. This may lead to errors when computing batch shapes, slicing into batch dimensions, calling .copy(), flattening the distribution as a CompositeTensor (e.g., when it is passed or returned from a tf.function), and possibly other cases. The recommended pattern for distribution subclasses is to define a new _parameter_propertiesmethod with the subclass parameters, and to store the corresponding parameter values asself._parametersininit`, after
calling the superclass constructor:
```
class MySubclass(tfd.SomeDistribution):
def __init__(self, param_a, param_b):
parameters = dict(locals())
# ... do subclass initialization ...
super(MySubclass, self).__init__(**base_class_params)
# Ensure that the subclass (not base class) parameters are stored.
self._parameters = parameters
def _parameter_properties(self, dtype, num_classes=None):
return dict(
# Annotations may optionally specify properties, such as `event_ndims`,
# `default_constraining_bijector_fn`, `specifies_shape`, etc.; see
# the `ParameterProperties` documentation for details.
param_a=tfp.util.ParameterProperties(),
param_b=tfp.util.ParameterProperties())
```
Although it does not affect the normal operation of the program, I still want to remove it. I would be grateful if there is a way to help.
The text was updated successfully, but these errors were encountered:
I tried everything, but I still couldn't get rid of it.
The ''warning'' message as follow:
WARNING:root:
Distribution subclass SafeTruncatedNormal inherits
_parameter_properties from its parent (TruncatedNormal) while also redefining
init. The inherited annotations cover the following parameters: dict_keys(['loc', 'scale', 'low', 'high']). It is likely that these do not match the subclass parameters. This may lead to errors when computing batch shapes, slicing into batch dimensions, calling
.copy(), flattening the distribution as a CompositeTensor (e.g., when it is passed or returned from a
tf.function), and possibly other cases. The recommended pattern for distribution subclasses is to define a new
_parameter_propertiesmethod with the subclass parameters, and to store the corresponding parameter values as
self._parametersin
init`, aftercalling the superclass constructor:
Although it does not affect the normal operation of the program, I still want to remove it. I would be grateful if there is a way to help.
The text was updated successfully, but these errors were encountered: