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

{WIP] Add HalfCauchy distribution #17

Closed
wants to merge 1 commit into from

Conversation

sharanry
Copy link
Contributor

No description provided.

shape=shape, minval=0., maxval=1., dtype=self.dtype, seed=seed)
return tf.abs(sampled * self.scale)

def _prob(self, x):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we get all of that from the bijection applied to the Cauchy distribution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @jvdillon mentioned in the tensorflow_probability issue, the AbsoluteValue solution resembles HalfCauchy with similar properties but isn't exactly that.

From what I understand, AbsoluteValue gives a modified scaled up version of Cauchy resulting in similar properties to HalfCauchy(with same scale as Cauchy described earlier) only on the positive side. This is demonstrated in this notebook.

PS: The notebook uses HalfCauchy defined using absolute value.

IMO Only way to have a proper HalfCauchy distribution is to define it from scratch like tensorflow_probability does with other distributions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense.

@junpenglao
Copy link
Member

Close as TFP now has HalfCauchy implemented.

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

Successfully merging this pull request may close these issues.

3 participants