MixtureDist Expression functionality #28
Cygnus-A18
started this conversation in
Development
Replies: 1 comment 1 reply
-
I've come to this but I am unsure of how to access the gx and px parameters separately class MixtureDist(Distribution):
def __init__(self, *, name: str, coefficients: list, extended: bool, summands: list):
super().__init__(name, "mixture_dist")
self.coefficients = coefficients
self.extended = extended
self.summands = summands
def expression(self, parameters: dict(str, pt.scalar)):
return parameters[self.coefficients[0]] * self.summands[0] + (1.0 - parameters[self.coefficients[0]]) * self.summands[1] this is being called by: for dist in distributions:
print(dist)
self.distributions[dist.name] = dist.expression(self.parameters) So I am unsure of how to pull the two different distributions, right now im just multiplying them by the strings "px" and "gx" which obviously doesn't make sense but I am unsure of what to substitute here. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Im having trouble structuring the logic for the expression functionality of the MixtureDist class, here is what I have currently:
Im looking at the following example:
Should I add two inputs which are both Dist objects to the mixturedist class init function?
Beta Was this translation helpful? Give feedback.
All reactions