### Question:
LogisticVertex extends VertexImpl<DoubleTensor, DoubleVertex> implements DoubleVertex, Differentiable, ProbabilisticDouble, SamplableWithManyScalars<DoubleTensor>, LogProbGraphSupplier { @Override public LogProbGraph logProbGraph() { final DoublePlaceholderVertex xPlaceholder = new DoublePlaceholderVertex(this.getShape()); final DoublePlaceholderVertex muPlaceholder = new DoublePlaceholderVertex(mu.getShape()); final DoublePlaceholderVertex sPlaceholder = new DoublePlaceholderVertex(s.getShape()); return LogProbGraph.builder() .input(this, xPlaceholder) .input(mu, muPlaceholder) .input(s, sPlaceholder) .logProbOutput(Logistic.logProbOutput(xPlaceholder, muPlaceholder, sPlaceholder)) .build(); } LogisticVertex(@LoadShape long[] tensorShape,
                          @LoadVertexParam(MU_NAME) Vertex<DoubleTensor, ?> mu,
                          @LoadVertexParam(S_NAME) Vertex<DoubleTensor, ?> s); @ExportVertexToPythonBindings  LogisticVertex(Vertex<DoubleTensor, ?> mu, Vertex<DoubleTensor, ?> s);  LogisticVertex(Vertex<DoubleTensor, ?> mu, double s);  LogisticVertex(double mu, Vertex<DoubleTensor, ?> s);  LogisticVertex(double mu, double s); @SaveVertexParam(MU_NAME) DoubleVertex getMu(); @SaveVertexParam(S_NAME) DoubleVertex getS(); @Override double logProb(DoubleTensor value); @Override LogProbGraph logProbGraph(); @Override Map<Vertex, DoubleTensor> dLogProb(DoubleTensor value, Set<? extends Vertex> withRespectTo); @Override DoubleTensor sampleWithShape(long[] shape, KeanuRandom random);  }### Answer:
@Test public void logProbGraphMatchesKnownLogDensityOfScalar() { DoubleVertex mu = ConstantVertex.of(0.5); DoubleVertex s = ConstantVertex.of(1.5); LogisticVertex logisticVertex = new LogisticVertex(mu, s); LogProbGraph logProbGraph = logisticVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, mu, mu.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, s, s.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, logisticVertex, DoubleTensor.scalar(2.)); LogisticDistribution distribution = new LogisticDistribution(0.5, 1.5); double expectedDensity = distribution.logDensity(2.); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }
@Test public void logProbGraphMatchesKnownLogDensityOfVector() { DoubleVertex mu = ConstantVertex.of(0., 0.); DoubleVertex s = ConstantVertex.of(1., 1.); LogisticVertex logisticVertex = new LogisticVertex(mu, s); LogProbGraph logProbGraph = logisticVertex.logProbGraph(); LogProbGraphValueFeeder.feedValue(logProbGraph, mu, mu.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, s, s.getValue()); LogProbGraphValueFeeder.feedValue(logProbGraph, logisticVertex, DoubleTensor.create(.25, .75)); LogisticDistribution distribution = new LogisticDistribution(0., 1.); double expectedDensity = distribution.logDensity(.25) + distribution.logDensity(.75); LogProbGraphContract.matchesKnownLogDensity(logProbGraph, expectedDensity); }