Added distribution method nodes that take 2d tensor as input
This commit is contained in:
@@ -12,7 +12,7 @@ class PtdmCdf:
|
||||
|
||||
Args:
|
||||
distribution (torch.distributions.distribution.Distribution): Distribution.
|
||||
v (float): Value
|
||||
x (float): Value
|
||||
|
||||
category: PyTorch wrapper - Distribution
|
||||
"""
|
||||
@@ -28,7 +28,7 @@ class PtdmCdf:
|
||||
return {
|
||||
"required": {
|
||||
"distribution": ("PTDISTRIBUTION", {}),
|
||||
"v": ("STRING", {"default": ""})
|
||||
"x": ("STRING", {"default": ""})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,18 +36,18 @@ class PtdmCdf:
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Distribution"
|
||||
|
||||
def f(self, distribution: torch.distributions.Distribution, v: str) -> tuple:
|
||||
def f(self, distribution: torch.distributions.Distribution, x: str) -> tuple:
|
||||
"""
|
||||
Computes the cumulative distribution function for the input distribution.
|
||||
|
||||
Args:
|
||||
distribution (torch.distributions.Distribution): Distribution.
|
||||
v (str): Value
|
||||
x (str): Value
|
||||
|
||||
Returns:
|
||||
tuple containing the probability
|
||||
"""
|
||||
v2 = ast.literal_eval(v)
|
||||
v2 = ast.literal_eval(x)
|
||||
if isinstance(v2, int) is False and isinstance(v2, float) is False :
|
||||
if isinstance(distribution, Dirichlet) is False:
|
||||
raise ValueError("You need to specify a float or an int.")
|
||||
|
||||
Reference in New Issue
Block a user