WishartTriL does not support df \in (k - 1, k)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- machine-learning
Piste de recherche
Commencez par la construction tfd.WishartTriL présentée dans l’issue et examinez comment elle valide df par rapport à la dimension de scale_tril. Comparez son comportement et son logpdf avec l’exemple Gamma fourni pour k - 1 < df < k. Le travail est terminé lorsque la construction est valide et que le comportement de logpdf est correct dans cette plage, et que la contrainte documentée a été mise à jour en conséquence.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
My understanding is that the Wishart distribution is well defined so long as df > k - 1. k is the dimension parameter, so the Wishart distribution has support over k x k matrices. df is the "degrees of freedom" parameter. However, the docs for WishartTriL indicate that it only supports df >= k. And when I try constructing a WishartTriL with k > df > k - 1, I get an error.
The fact that Wishart is supported for any df > k - 1 seems to be indicated in the distribution overview section of the wikipedia for InverseWishart, and in the wikipedia for the Wishart distribution, in the last paragraph of the "Spectral Density" section.
I have in mind that it would be useful to use a Wishart with df < k in order to express a very uncertain prior over the covariance of a multivariate normal distribution.
The scipy docs suggest that scipy's Wishart distribution supports construction with k - 1 < df < k. They do note, however, that the behavior of their sampling algorithm can create invalid samples sometimes when df < k, and advise users to check for invalid sample generation.
Here is a code example showing the problem:
import tensorflow_probability.substrates.jax.distributions as tfd
import jax.numpy as jnp
nu = 0.01
Lambda = jnp.array([[1.0]])
X = jnp.array([[0.5]])
scale_tril = jnp.linalg.cholesky(Lambda)
tfd.WishartTriL(nu, scale_tril)
Constructing this distribution causes an error.
This is despite the fact that it is possible to construct and evaluate logpdfs of the following Gamma distribution, even though (if I understand correctly) this 1D Gamma is equivalent to the above Wishart distribution:
tfd.Gamma(nu / 2, 1 / (2 * Lambda[0, 0]))
(You can check this equivalence by changing nu to something greater than 1, so you can construct the Wishart distribution, and test that the logpdf values for the two distributions are the same.)
I am using tensorflow_probability version 0.23.0.
Thank you for the help!
- Langage dominant
- Jupyter Notebook
- Étoiles
- 4.4k
- Forks
- 1.1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de tensorflow/probability
-
KL divergence between two `TransformedDistribution`s with a shared non-injective bijector (`AbsoluteValue`) returns the base KLPeut-être pris @Andreas-Hum l’a pris il y a 9 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
tensorflow/probability#2036 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 54/100
tensorflow/probability#2040 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
tensorflow/probability#2034 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
tensorflow/probability#2021 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
tensorflow/probability#2015 ·
Toutes les issues de tensorflow/probability
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
facebookresearch/xformers#1417 ·
-
SPLADE `/embed_sparse` output depends on the other inputs in the batch (candle BertModel / DistilBertModel)Peut-être pris @0z5a l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
huggingface/text-embeddings-inference#979 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
bug z-test-failure
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
torch-spyre/spyre-inference#1598 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
NVIDIA/nvalchemi-toolkit#262 ·
Les mainteneurs répondent en général sous 2 jours