Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A '' warning'' appears after I run the program, which cannot be removed #2

Open
MINGtoMING opened this issue Oct 29, 2022 · 0 comments

Comments

@MINGtoMING
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant