public class MultinomialVertex extends IntegerVertex implements ProbabilisticInteger, SamplableWithManyScalars<IntegerTensor>
Constructor and Description |
---|
MultinomialVertex(int n,
DoubleVertex p) |
MultinomialVertex(IntegerVertex n,
DoubleVertex p) |
MultinomialVertex(long[] tensorShape,
IntegerVertex n,
DoubleVertex p) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<Vertex,DoubleTensor> |
dLogProb(IntegerTensor value,
java.util.Set<? extends Vertex> withRespectTo)
The partial derivatives of the natural log prob.
|
IntegerVertex |
getN() |
DoubleVertex |
getP() |
double |
logProb(IntegerTensor kTensor)
This is the natural log of the probability at the supplied value.
|
IntegerTensor |
sampleWithShape(long[] shape,
KeanuRandom random) |
abs, concat, div, div, divideBy, divideBy, divideBy, equalTo, getValue, greaterThan, greaterThanOrEqualTo, lambda, lambda, lessThan, lessThanOrEqualTo, loadValue, max, min, minus, minus, minus, multiply, multiply, multiply, notEqualTo, observe, observe, plus, plus, plus, pow, pow, reshape, reverseDiv, reverseMinus, saveValue, setAndCascade, setAndCascade, setValue, setValue, slice, sum, sum, take, times, times, toDouble, unaryMinus
addChild, addParent, addParents, equals, eval, getChildren, getConnectedGraph, getDegree, getId, getIndentation, getLabel, getObservedValue, getParents, getRank, getReference, getShape, getState, getValue, hashCode, hasValue, isDifferentiable, isObserved, isProbabilistic, lazyEval, observe, observeOwnValue, print, print, removeLabel, save, setAndCascade, setLabel, setLabel, setParents, setParents, setState, setValue, toString, unobserve
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
dLogPmf, dLogPmf, dLogPmf, logPmf, logPmf, logPmf
dLogProb, dLogProbAtValue, dLogProbAtValue, getValue, keepOnlyProbabilisticVertices, logProbAtValue
getObservedValue, isObserved, observe, unobserve
sample, sampleManyScalars, sampleManyScalars
sampleWithShape
public MultinomialVertex(long[] tensorShape, IntegerVertex n, DoubleVertex p)
public MultinomialVertex(IntegerVertex n, DoubleVertex p)
public MultinomialVertex(int n, DoubleVertex p)
public double logProb(IntegerTensor kTensor)
Probabilistic
logProb
in interface Probabilistic<IntegerTensor>
kTensor
- The supplied value.public java.util.Map<Vertex,DoubleTensor> dLogProb(IntegerTensor value, java.util.Set<? extends Vertex> withRespectTo)
Probabilistic
dLogProb
in interface Probabilistic<IntegerTensor>
value
- at a given valuewithRespectTo
- list of parents to differentiate with respect topublic IntegerTensor sampleWithShape(long[] shape, KeanuRandom random)
sampleWithShape
in interface SamplableWithShape<IntegerTensor>
public DoubleVertex getP()
public IntegerVertex getN()