private static <T> void updateVertexValue(Vertex<T> vertex) { if (vertex.isProbabilistic()) { if (!vertex.hasValue()) { vertex.setValue(vertex.sample()); } } else { if (!vertex.isObserved()) { vertex.setValue(((NonProbabilistic<T>) vertex).calculate()); } } } }
/** * One sigma that matches a proposed tensor shape of HalfGaussian (a Gaussian with mu = 0 and non-negative x). * <p> * If provided parameter is scalar then the proposed shape determines the shape * * @param tensorShape the desired shape of the tensor in this vertex * @param sigma the sigma of the HalfGaussian with either the same tensorShape as specified for this vertex or a scalar */ public HalfGaussianVertex(@LoadShape long[] tensorShape, @LoadVertexParam(SIGMA_NAME) DoubleVertex sigma) { super(tensorShape, MU_ZERO, sigma); }
@ExportVertexToPythonBindings public IntegerProxyVertex(@LoadShape long[] tensorShape, @LoadVertexParam(LABEL_NAME) String label) { this(tensorShape, new VertexLabel(label)); }
public static <T> void feedValueAndCascade(LogProbGraph logProbGraph, Vertex<T> input, T value) { Vertex<T> placeholderVertex = logProbGraph.getPlaceholder(input); placeholderVertex.setAndCascade(value); } }
public static <T> void feedValue(LogProbGraph logProbGraph, Vertex<T> input, T value) { Vertex<T> placeholderVertex = logProbGraph.getPlaceholder(input); placeholderVertex.setValue(value); }
@SaveVertexParam(ERROR_MESSAGE_NAME) public String getErrorMessage() { return errorMessage; } }
public DoubleUnaryOpLambda(Vertex<IN> inputVertex, Function<IN, DoubleTensor> op, Function<Map<Vertex, PartialDerivative>, PartialDerivative> forwardModeAutoDiffLambda, Function<PartialDerivative, Map<Vertex, PartialDerivative>> reverseModeAutoDiffLambda) { this(inputVertex.getShape(), inputVertex, op, forwardModeAutoDiffLambda, reverseModeAutoDiffLambda); }
@ExportVertexToPythonBindings public BooleanProxyVertex(@LoadShape long[] shape, @LoadVertexParam(LABEL_NAME) String label) { this(shape, new VertexLabel(label)); }
/** * One scale that matches a proposed tensor shape of HalfCauchy (Cauchy with location = 0 and non-negative x) * <p> * If provided parameter is scalar then the proposed shape determines the shape * * @param tensorShape the desired shape of the tensor in this vertex * @param scale the scale of the HalfCauchy with either the same tensorShape as specified for this vertex or a scalar */ public HalfCauchyVertex(@LoadShape long[] tensorShape, @LoadVertexParam(SCALE_NAME) DoubleVertex scale) { super(tensorShape, LOC_ZERO, scale); }
@SaveVertexParam(RIGHT_NAME) public IntegerVertex getRight() { return right; } }
@ExportVertexToPythonBindings public DoubleProxyVertex(@LoadShape long[] shape, @LoadVertexParam(LABEL_PARAM_NAME) String label) { this(shape, new VertexLabel(label)); }
public SmoothUniformVertex(@LoadShape long[] tensorShape, @LoadVertexParam(X_MIN_NAME) DoubleVertex xMin, @LoadVertexParam(X_MAX_NAME) DoubleVertex xMax) { this(tensorShape, xMin, xMax, DEFAULT_EDGE_SHARPNESS); }
@SaveVertexParam(SET_VALUE_NAME) public DoubleVertex getSetValue() { return setValue; } }
@SaveVertexParam(INDEX_NAME) public int getIndex() { return index; } }
@SaveVertexParam(P_NAME) public DoubleVertex getP() { return p; } }
@SaveVertexParam(ELSE_NAME) public Vertex<? extends Tensor<T>> getEls() { return els; } }
@SaveVertexParam(DIMENSION_NAME) public int getDimension() { return dimension; } }
@SaveVertexParam(ELS_NAME) public BooleanVertex getEls() { return els; } }