コード例 #1
0
def Min(left: vertex_constructor_param_types,
        right: vertex_constructor_param_types) -> Vertex:
    """
    Finds the minimum between two vertices
    
    :param left: one of the vertices to find the minimum of
    :param right: one of the vertices to find the minimum of
    """
    return Double(context.jvm_view().MinVertex, cast_to_double(left),
                  cast_to_double(right))
コード例 #2
0
def Multiplication(left: vertex_constructor_param_types,
                   right: vertex_constructor_param_types) -> Vertex:
    """
    Multiplies one vertex by another
    
    :param left: vertex to be multiplied
    :param right: vertex to be multiplied
    """
    return Double(context.jvm_view().MultiplicationVertex,
                  cast_to_double(left), cast_to_double(right))
コード例 #3
0
def MatrixMultiplication(left: vertex_constructor_param_types,
                         right: vertex_constructor_param_types) -> Vertex:
    """
    Matrix multiplies one vertex by another. C = AB
    
    :param left: vertex A
    :param right: vertex B
    """
    return Double(context.jvm_view().MatrixMultiplicationVertex,
                  cast_to_double(left), cast_to_double(right))
コード例 #4
0
def Division(left: vertex_constructor_param_types,
             right: vertex_constructor_param_types) -> Vertex:
    """
    Divides one vertex by another
    
    :param left: the vertex to be divided
    :param right: the vertex to divide
    """
    return Double(context.jvm_view().DivisionVertex, cast_to_double(left),
                  cast_to_double(right))
コード例 #5
0
def Difference(left: vertex_constructor_param_types,
               right: vertex_constructor_param_types) -> Vertex:
    """
    Subtracts one vertex from another
    
    :param left: the vertex that will be subtracted from
    :param right: the vertex to subtract
    """
    return Double(context.jvm_view().DifferenceVertex, cast_to_double(left),
                  cast_to_double(right))
コード例 #6
0
def Power(base: vertex_constructor_param_types,
          exponent: vertex_constructor_param_types) -> Vertex:
    """
    Raises a vertex to the power of another
    
    :param base: the base vertex
    :param exponent: the exponent vertex
    """
    return Double(context.jvm_view().PowerVertex, cast_to_double(base),
                  cast_to_double(exponent))
コード例 #7
0
def Gamma(theta: vertex_constructor_param_types,
          k: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of theta and k to matching shaped gamma.
    
    :param theta: the theta (scale) of the Gamma with either the same shape as specified for this vertex
    :param k: the k (shape) of the Gamma with either the same shape as specified for this vertex
    """
    return Double(context.jvm_view().GammaVertex, cast_to_double(theta),
                  cast_to_double(k))
コード例 #8
0
def Addition(left: vertex_constructor_param_types,
             right: vertex_constructor_param_types) -> Vertex:
    """
    Adds one vertex to another
    
    :param left: a vertex to add
    :param right: a vertex to add
    """
    return Double(context.jvm_view().AdditionVertex, cast_to_double(left),
                  cast_to_double(right))
コード例 #9
0
def ArcTan2(x: vertex_constructor_param_types,
            y: vertex_constructor_param_types) -> Vertex:
    """
    Calculates the signed angle, in radians, between the positive x-axis and a ray to the point (x, y) from the origin
    
    :param x: x coordinate
    :param y: y coordinate
    """
    return Double(context.jvm_view().ArcTan2Vertex, cast_to_double(x),
                  cast_to_double(y))
コード例 #10
0
def MultivariateGaussian(mu: vertex_constructor_param_types,
                         covariance: vertex_constructor_param_types) -> Vertex:
    """
    Matches a mu and covariance of some shape to a Multivariate Gaussian
    
    :param mu: the mu of the Multivariate Gaussian
    :param covariance: the covariance matrix of the Multivariate Gaussian
    """
    return Double(context.jvm_view().MultivariateGaussianVertex,
                  cast_to_double(mu), cast_to_double(covariance))
コード例 #11
0
def Beta(alpha: vertex_constructor_param_types,
         beta: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some tensorShape of alpha and beta to
    a matching tensorShaped Beta.
    
    :param alpha: the alpha of the Beta with either the same tensorShape as specified for this vertex or a scalar
    :param beta: the beta of the Beta with either the same tensorShape as specified for this vertex or a scalar
    """
    return Double(context.jvm_view().BetaVertex, cast_to_double(alpha),
                  cast_to_double(beta))
コード例 #12
0
def InverseGamma(alpha: vertex_constructor_param_types,
                 beta: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of alpha and beta to
    alpha matching shaped Inverse Gamma.
    
    :param alpha: the alpha of the Inverse Gamma with either the same shape as specified for this vertex or alpha scalar
    :param beta: the beta of the Inverse Gamma with either the same shape as specified for this vertex or alpha scalar
    """
    return Double(context.jvm_view().InverseGammaVertex, cast_to_double(alpha),
                  cast_to_double(beta))
コード例 #13
0
def Laplace(mu: vertex_constructor_param_types,
            beta: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of mu and sigma to
    a matching shaped Laplace.
    
    :param mu: the mu of the Laplace with either the same shape as specified for this vertex or a scalar
    :param beta: the beta of the Laplace with either the same shape as specified for this vertex or a scalar
    """
    return Double(context.jvm_view().LaplaceVertex, cast_to_double(mu),
                  cast_to_double(beta))
コード例 #14
0
def Uniform(x_min: vertex_constructor_param_types,
            x_max: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of mu and sigma to
    a matching shaped Uniform Vertex
    
    :param x_min: the inclusive lower bound of the Uniform with either the same shape as specified for this vertex or a scalar
    :param x_max: the exclusive upper bound of the Uniform with either the same shape as specified for this vertex or a scalar
    """
    return Double(context.jvm_view().UniformVertex, cast_to_double(x_min),
                  cast_to_double(x_max))
コード例 #15
0
def Triangular(x_min: vertex_constructor_param_types,
               x_max: vertex_constructor_param_types,
               c: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of xMin, xMax and c to a matching shaped triangular.
    
    :param x_min: the xMin of the Triangular with either the same shape as specified for this vertex or a scalar
    :param x_max: the xMax of the Triangular with either the same shape as specified for this vertex or a scalar
    :param c: the c of the Triangular with either the same shape as specified for this vertex or a scalar
    """
    return Double(context.jvm_view().TriangularVertex, cast_to_double(x_min),
                  cast_to_double(x_max), cast_to_double(c))
コード例 #16
0
def Cos(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Takes the cosine of a vertex, Cos(vertex)
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().CosVertex, cast_to_double(input_vertex))
コード例 #17
0
def Tan(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Takes the tangent of a vertex. Tan(vertex).
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().TanVertex, cast_to_double(input_vertex))
コード例 #18
0
def Sum(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Performs a sum across all dimensions
    
    :param input_vertex: the vertex to have its values summed
    """
    return Double(context.jvm_view().SumVertex, cast_to_double(input_vertex))
コード例 #19
0
def Sin(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Takes the sine of a vertex. Sin(vertex).
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().SinVertex, cast_to_double(input_vertex))
コード例 #20
0
def Exp(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Calculates the exponential of an input vertex
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().ExpVertex, cast_to_double(input_vertex))
コード例 #21
0
def Exponential(rate: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of rate to matching shaped exponential.
    
    :param rate: the rate of the Exponential with either the same shape as specified for this vertex or scalar
    """
    return Double(context.jvm_view().ExponentialVertex, cast_to_double(rate))
コード例 #22
0
def Abs(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Takes the absolute of a vertex
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().AbsVertex, cast_to_double(input_vertex))
コード例 #23
0
def Log(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Returns the natural logarithm, base e, of a vertex
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().LogVertex, cast_to_double(input_vertex))
コード例 #24
0
def ArcTan(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Takes the inverse tan of a vertex, Arctan(vertex)
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().ArcTanVertex,
                  cast_to_double(input_vertex))
コード例 #25
0
def Poisson(mu: vertex_constructor_param_types) -> Vertex:
    """
    One to one constructor for mapping some shape of mu to
    a matching shaped Poisson.
    
    :param mu: mu with same shape as desired Poisson tensor or scalar
    """
    return Integer(context.jvm_view().PoissonVertex, cast_to_double(mu))
コード例 #26
0
def Ceil(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Applies the Ceiling operator to a vertex.
    This maps a vertex to the smallest integer greater than or equal to its value
    
    :param input_vertex: the vertex to be ceil'd
    """
    return Double(context.jvm_view().CeilVertex, cast_to_double(input_vertex))
コード例 #27
0
def Floor(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Applies the Floor operator to a vertex.
    This maps a vertex to the biggest integer less than or equal to its value
    
    :param input_vertex: the vertex to be floor'd
    """
    return Double(context.jvm_view().FloorVertex, cast_to_double(input_vertex))
コード例 #28
0
def LogGamma(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Returns the log of the gamma of the inputVertex
    
    :param input_vertex: the vertex
    """
    return Double(context.jvm_view().LogGammaVertex,
                  cast_to_double(input_vertex))
コード例 #29
0
def Round(input_vertex: vertex_constructor_param_types) -> Vertex:
    """
    Applies the Rounding operator to a vertex.
    This maps a vertex to the nearest integer value
    
    :param input_vertex: the vertex to be rounded
    """
    return Double(context.jvm_view().RoundVertex, cast_to_double(input_vertex))
コード例 #30
0
def Dirichlet(concentration: vertex_constructor_param_types) -> Vertex:
    """
    Matches a vector of concentration values to a Dirichlet distribution
    
    :param concentration: the concentration values of the dirichlet
    """
    return Double(context.jvm_view().DirichletVertex,
                  cast_to_double(concentration))