public class BernoulliDistribution extends Object
Constructor and Description |
---|
BernoulliDistribution(org.nd4j.autodiff.samediff.SDVariable logits,
org.nd4j.autodiff.samediff.SameDiff sd)
Construct the bernoulli distribution.
|
Modifier and Type | Method and Description |
---|---|
org.nd4j.autodiff.samediff.SDVariable |
getProb() |
org.nd4j.autodiff.samediff.SDVariable |
klDivergence(org.wso2.extension.siddhi.execution.streamingml.bayesian.model.Distribution distribution)
returns the kl divergence w.r.t the given distribution.
|
org.nd4j.autodiff.samediff.SDVariable |
logProbability(org.nd4j.autodiff.samediff.SDVariable values)
returns the log probability p(x) given x.
|
org.nd4j.autodiff.samediff.SDVariable |
sample()
returns a random sample from the distribution.
|
org.nd4j.autodiff.samediff.SDVariable |
sample(int n)
returns random samples from the distribution.
|
public BernoulliDistribution(org.nd4j.autodiff.samediff.SDVariable logits, org.nd4j.autodiff.samediff.SameDiff sd)
logits
- should be 2-dimensional. the dimensions should follow the order (input_size, 1)sd
- SameDiff contextpublic org.nd4j.autodiff.samediff.SDVariable logProbability(org.nd4j.autodiff.samediff.SDVariable values)
values
- x valuespublic org.nd4j.autodiff.samediff.SDVariable sample()
public org.nd4j.autodiff.samediff.SDVariable sample(int n)
n
- number of samplespublic org.nd4j.autodiff.samediff.SDVariable klDivergence(org.wso2.extension.siddhi.execution.streamingml.bayesian.model.Distribution distribution) throws io.siddhi.core.exception.SiddhiAppCreationException
distribution
- reference distribution p(x)io.siddhi.core.exception.SiddhiAppCreationException
public org.nd4j.autodiff.samediff.SDVariable getProb()
Copyright © 2019 WSO2. All rights reserved.