Dirichlet Prior - cannot bufferize concentration #1797
Unanswered
fweberling
asked this question in
Q&A
Replies: 1 comment 4 replies
-
What parameter are you placing the Dirichlet prior over? Can you include a complete code example? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I would like to run a GP Model with a Dirichlet prior on a GPU. Thus, I created a Dirichlet prior based on the torch Dirichlet distribution:
However, it seems that the bufferize_attributes method does not work. I always get this error message:
---> 29
outputscale_prior = DirichletPrior(self.concentration)
/content/utils.py in init(self, concentration, validate_args, transform)
66
TModule.__init__(self)
67
torch.distributions.dirichlet.Dirichlet.__init__(self, concentration, validate_args=validate_args)
---> 68
gpytorch.priors.utils._bufferize_attributes(self, ("concentration"))
69
self._transform = transform
70
/usr/local/lib/python3.7/dist-packages/gpytorch/priors/utils.py in _bufferize_attributes(module, attributes)
3
4
def _bufferize_attributes(module, attributes):
----> 5
attr_clones = {attr: getattr(module, attr).clone() for attr in attributes}
6
for attr, value in attr_clones.items():
7
delattr(module, attr)
/usr/local/lib/python3.7/dist-packages/gpytorch/priors/utils.py in (.0)
3
4
def _bufferize_attributes(module, attributes):
----> 5
attr_clones = {attr: getattr(module, attr).clone() for attr in attributes}
6
for attr, value in attr_clones.items():
7
delattr(module, attr)
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in getattr(self, name)
1129
return modules[name]
1130
raise AttributeError("'{}' object has no attribute '{}'".format(
-> 1131
type(self).__name__, name))
1132
1133
def __setattr__(self, name: str, value: Union[Tensor, 'Module']) -> None:
AttributeError: 'DirichletPrior' object has no attribute 'c'
Does someone know what I did wrong or can point me to another way to implement the Dirichlet prior?
Thank you in advance!
Friedrich
Beta Was this translation helpful? Give feedback.
All reactions