keanu.vertex

Vertices

keanu.vertex.Broadcast(input_vertex, to_shape, label=None)[source]
Return type:Vertex
keanu.vertex.DiagPart(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.Diag(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.FillTriangular(input_vertex, fill_upper, fill_lower, label=None)[source]
Return type:Vertex
keanu.vertex.Permute(input_vertex, rearrange, label=None)[source]
Return type:Vertex
keanu.vertex.Reshape(input_vertex, proposed_shape, label=None)[source]
Return type:Vertex
keanu.vertex.Slice(input_vertex, dimension, index, label=None)[source]

Takes the slice along a given dimension and index of a vertex

Parameters:
  • input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the input vertex
  • dimension (int) – the dimension to extract along
  • index (int) – the index of extraction
Return type:

Vertex

keanu.vertex.StridedSlice(input_vertex, start, end, stride, ellipsis, upper_bound_stop, drop_dimension, label=None)[source]
Return type:Vertex
keanu.vertex.Take(input_vertex, index, label=None)[source]
Return type:Vertex
keanu.vertex.TriLower(input_vertex, k, label=None)[source]
Return type:Vertex
keanu.vertex.TriUpper(input_vertex, k, label=None)[source]
Return type:Vertex
keanu.vertex.TrianglePart(input_vertex, upper_part, label=None)[source]
Return type:Vertex
keanu.vertex.Where(predicate, thn, els, label=None)[source]
Return type:Vertex
keanu.vertex.BooleanProxy(shape, label)[source]
Return type:Vertex
keanu.vertex.CastNumberToBoolean(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.CastToBoolean(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.ConstantBoolean(constant, label=None)[source]
Return type:Vertex
keanu.vertex.AndBinary(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.OrBinary(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.XorBinary(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.Equals(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.GreaterThanOrEqual(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.GreaterThan(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.LessThanOrEqual(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.LessThan(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.NotEquals(a, b, label=None)[source]
Return type:Vertex
keanu.vertex.NumericalEquals(a, b, epsilon, label=None)[source]
Return type:Vertex
keanu.vertex.BooleanConcatenation(dimension, input, label=None)[source]
Return type:Vertex
keanu.vertex.BooleanToDoubleMask(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.BooleanToIntegerMask(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.AllFalse(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.AllTrue(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.AnyFalse(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.AnyTrue(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.IsFinite(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.IsInfinite(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.IsNaN(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.IsNegativeInfinity(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.IsPositiveInfinity(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.NotBinary(a, label=None)[source]
Return type:Vertex
keanu.vertex.NotNaN(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.Bernoulli(prob_true, label=None)[source]

One to one constructor for mapping some shape of probTrue to a matching shaped Bernoulli.

Parameters:prob_true (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – probTrue with same shape as desired Bernoulli tensor or scalar
Return type:Vertex
keanu.vertex.Print(parent, message, print_data, label=None)[source]
Return type:Vertex
keanu.vertex.CastNumberToInteger(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.ConstantInteger(constant, label=None)[source]
Return type:Vertex
keanu.vertex.IntegerProxy(shape, label)[source]
Return type:Vertex
keanu.vertex.IntegerConcatenation(dimension, input, label=None)[source]
Return type:Vertex
keanu.vertex.ArgMax(input_vertex, axis, label=None)[source]
Return type:Vertex
keanu.vertex.ArgMin(input_vertex, axis, label=None)[source]
Return type:Vertex
keanu.vertex.NaNArgMax(input_vertex, axis, label=None)[source]
Return type:Vertex
keanu.vertex.NaNArgMin(input_vertex, axis, label=None)[source]
Return type:Vertex
keanu.vertex.Binomial(p, n, label=None)[source]
Return type:Vertex
keanu.vertex.Geometric(p, label=None)[source]
Return type:Vertex
keanu.vertex.Multinomial(n, p, label=None)[source]
Return type:Vertex
keanu.vertex.Poisson(mu, label=None)[source]

One to one constructor for mapping some shape of mu to a matching shaped Poisson.

Parameters:mu (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – mu with same shape as desired Poisson tensor or scalar
Return type:Vertex
keanu.vertex.UniformInt(min, max, label=None)[source]
Return type:Vertex
keanu.vertex.Mod(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.CastNumberToDouble(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.ConstantDouble(constant, label=None)[source]
Return type:Vertex
keanu.vertex.DoubleProxy(shape, label)[source]
Return type:Vertex
keanu.vertex.Concatenation(dimension, operands, label=None)[source]

A vertex that can concatenate any amount of vertices along a given dimension.

Parameters:
  • dimension (int) – the dimension to concatenate on. This is the only dimension in which sizes may be different. Negative dimension indexing is not supported.
  • operands (Collection[Vertex]) – the operands vertices to concatenate
Return type:

Vertex

keanu.vertex.Beta(alpha, beta, label=None)[source]

One to one constructor for mapping some tensorShape of alpha and beta to a matching tensorShaped Beta.

Parameters:
  • alpha (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the alpha of the Beta with either the same tensorShape as specified for this vertex or a scalar
  • beta (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the beta of the Beta with either the same tensorShape as specified for this vertex or a scalar
Return type:

Vertex

keanu.vertex.Cauchy(location, scale, label=None)[source]
Return type:Vertex
keanu.vertex.ChiSquared(k, label=None)[source]

One to one constructor for mapping some shape of k to a matching shaped ChiSquared.

Parameters:k (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the number of degrees of freedom
Return type:Vertex
keanu.vertex.Dirichlet(concentration, label=None)[source]

Matches a vector of concentration values to a Dirichlet distribution

Parameters:concentration (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the concentration values of the dirichlet
Return type:Vertex
keanu.vertex.Exponential(rate, label=None)[source]

One to one constructor for mapping some shape of rate to matching shaped exponential.

Parameters:rate (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the rate of the Exponential with either the same shape as specified for this vertex or scalar
Return type:Vertex
keanu.vertex.Gamma(theta, k, label=None)[source]

One to one constructor for mapping some shape of theta and k to matching shaped gamma.

Parameters:
  • theta (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the theta (scale) of the Gamma with either the same shape as specified for this vertex
  • k (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the k (shape) of the Gamma with either the same shape as specified for this vertex
Return type:

Vertex

keanu.vertex.Gaussian(mu, sigma, label=None)[source]
Return type:Vertex
keanu.vertex.HalfCauchy(scale, label=None)[source]
Return type:Vertex
keanu.vertex.HalfGaussian(sigma, label=None)[source]
Return type:Vertex
keanu.vertex.InverseGamma(alpha, beta, label=None)[source]

One to one constructor for mapping some shape of alpha and beta to alpha matching shaped Inverse Gamma.

Parameters:
  • alpha (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the alpha of the Inverse Gamma with either the same shape as specified for this vertex or alpha scalar
  • beta (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the beta of the Inverse Gamma with either the same shape as specified for this vertex or alpha scalar
Return type:

Vertex

keanu.vertex.KDE(samples, bandwidth, label=None)[source]
Return type:Vertex
keanu.vertex.Laplace(mu, beta, label=None)[source]

One to one constructor for mapping some shape of mu and sigma to a matching shaped Laplace.

Parameters:
  • mu (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the mu of the Laplace with either the same shape as specified for this vertex or a scalar
  • beta (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the beta of the Laplace with either the same shape as specified for this vertex or a scalar
Return type:

Vertex

keanu.vertex.LogNormal(mu, sigma, label=None)[source]
Return type:Vertex
keanu.vertex.Logistic(mu, s, label=None)[source]
Return type:Vertex
keanu.vertex.MultivariateGaussian(mu, covariance, label=None)[source]

Matches a mu and full covariance matrix of some shape to a Multivariate Gaussian distribution. Mu should be shape (batchShape, N) where N is the number of dimensions and batchShape can be any shape that is broadcastable with the covariance batchShape if it is also batched. The covariance matrix should be shape (batchShape, N, N) where the batchShape must be broadcastable with the batchShape of mu. Only the lower triangle of the covariance matrix is used due to it being assumed to be a symmetric matrix. The upper triangle will be ignored.

Parameters:
  • mu (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the mu of the Multivariate Gaussian
  • covariance (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the covariance matrix of the Multivariate Gaussian
Return type:

Vertex

keanu.vertex.Pareto(location, scale, label=None)[source]
Return type:Vertex
keanu.vertex.StudentT(v, label=None)[source]
Return type:Vertex
keanu.vertex.Triangular(x_min, x_max, c, label=None)[source]

One to one constructor for mapping some shape of xMin, xMax and c to a matching shaped triangular.

Parameters:
  • x_min (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the xMin of the Triangular with either the same shape as specified for this vertex or a scalar
  • x_max (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the xMax of the Triangular with either the same shape as specified for this vertex or a scalar
  • c (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the c of the Triangular with either the same shape as specified for this vertex or a scalar
Return type:

Vertex

keanu.vertex.Uniform(x_min, x_max, label=None)[source]

One to one constructor for mapping some shape of mu and sigma to a matching shaped Uniform Vertex

Parameters:
  • x_min (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the inclusive lower bound of the Uniform with either the same shape as specified for this vertex or a scalar
  • x_max (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the exclusive upper bound of the Uniform with either the same shape as specified for this vertex or a scalar
Return type:

Vertex

keanu.vertex.ArcTan2(x, y, label=None)[source]

Calculates the signed angle, in radians, between the positive x-axis and a ray to the point (x, y) from the origin

Parameters:
  • x (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – x coordinate
  • y (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – y coordinate
Return type:

Vertex

keanu.vertex.LogAddExp2(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.LogAddExp(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.SafeLogTimes(x, y, label=None)[source]
Return type:Vertex
keanu.vertex.ArcCos(input_vertex, label=None)[source]

Takes the inverse cosine of a vertex, Arccos(vertex)

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ArcCosh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ArcSin(input_vertex, label=None)[source]

Takes the inverse sin of a vertex, Arcsin(vertex)

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ArcSinh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ArcTan(input_vertex, label=None)[source]

Takes the inverse tan of a vertex, Arctan(vertex)

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ArcTanh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Ceil(input_vertex, label=None)[source]

Applies the Ceiling operator to a vertex. This maps a vertex to the smallest integer greater than or equal to its value

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to be ceil’d
Return type:Vertex
keanu.vertex.CholeskyDecomposition(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.CholeskyInverse(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Cos(input_vertex, label=None)[source]

Takes the cosine of a vertex, Cos(vertex)

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Cosh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Digamma(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Exp2(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.ExpM1(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Exp(input_vertex, label=None)[source]

Calculates the exponential of an input vertex

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Floor(input_vertex, label=None)[source]

Applies the Floor operator to a vertex. This maps a vertex to the biggest integer less than or equal to its value

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to be floor’d
Return type:Vertex
keanu.vertex.Log10(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Log1p(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Log2(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.LogGamma(input_vertex, label=None)[source]

Returns the log of the gamma of the inputVertex

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Log(input_vertex, label=None)[source]

Returns the natural logarithm, base e, of a vertex

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.MatrixDeterminant(vertex, label=None)[source]
Return type:Vertex
keanu.vertex.MatrixInverse(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.Mean(input_vertex, over_dimensions, label=None)[source]

Performs a sum across specified dimensions. Negative dimension indexing is not supported.

Parameters:
  • input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to have its values summed
  • over_dimensions (Collection[int]) – dimensions to sum over
Return type:

Vertex

keanu.vertex.ReplaceNaN(input_vertex, replace_with_value, label=None)[source]
Return type:Vertex
keanu.vertex.Round(input_vertex, label=None)[source]

Applies the Rounding operator to a vertex. This maps a vertex to the nearest integer value

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to be rounded
Return type:Vertex
keanu.vertex.Sigmoid(input_vertex, label=None)[source]

Applies the sigmoid function to a vertex. The sigmoid function is a special case of the Logistic function.

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Sin(input_vertex, label=None)[source]

Takes the sine of a vertex. Sin(vertex).

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Sinh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.StandardDeviation(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Standardize(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.Tan(input_vertex, label=None)[source]

Takes the tangent of a vertex. Tan(vertex).

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Tanh(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Trigamma(input_vertex, label=None)[source]
Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Addition(left, right, label=None)[source]

Adds one vertex to another

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – a vertex to add
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – a vertex to add
Return type:

Vertex

keanu.vertex.Difference(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.Division(left, right, label=None)[source]

Divides one vertex by another

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to be divided
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to divide
Return type:

Vertex

keanu.vertex.GreaterThanMask(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.GreaterThanOrEqualToMask(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.LessThanMask(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.LessThanOrEqualToMask(left, right, label=None)[source]
Return type:Vertex
keanu.vertex.MatrixMultiplication(left, right, transpose_left, transpose_right, label=None)[source]

Matrix multiplies one vertex by another. C = AB

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – vertex A
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – vertex B
  • transpose_left (bool) – transpose the left operand before multiply
  • transpose_right (bool) – transpose the right operand before multiply
Return type:

Vertex

keanu.vertex.Max(left, right, label=None)[source]

Finds the minimum between two vertices

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – one of the vertices to find the minimum of
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – one of the vertices to find the minimum of
Return type:

Vertex

keanu.vertex.Min(left, right, label=None)[source]

Finds the minimum between two vertices

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – one of the vertices to find the minimum of
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – one of the vertices to find the minimum of
Return type:

Vertex

keanu.vertex.Multiplication(left, right, label=None)[source]

Multiplies one vertex by another

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – vertex to be multiplied
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – vertex to be multiplied
Return type:

Vertex

keanu.vertex.Power(base, exponent, label=None)[source]

Raises a vertex to the power of another

Parameters:
  • base (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the base vertex
  • exponent (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the exponent vertex
Return type:

Vertex

keanu.vertex.TensorMultiplication(left, right, dims_left, dims_right, label=None)[source]

Tensor multiplies one vertex by another. C = AB.

Parameters:
  • left (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the left vertex for operand
  • right (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the right vertex for operand
  • dims_left (Collection[int]) – The dimensions of the left for multiplying. The left shape at these dimensions must align with the shape of the corresponding right vertex at its specified dimensions.
  • dims_right (Collection[int]) – The dimensions of the right for multiplying. The right shape at these dimensions must align with the shape of the corresponding left vertex at its specified dimensions.
Return type:

Vertex

keanu.vertex.SetWithMask(operand, mask, set_value, label=None)[source]
Return type:Vertex
keanu.vertex.Abs(input_vertex, label=None)[source]

Takes the absolute of a vertex

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.CumProd(input_vertex, requested_dimension, label=None)[source]
Return type:Vertex
keanu.vertex.CumSum(input_vertex, requested_dimension, label=None)[source]
Return type:Vertex
keanu.vertex.MaxUnary(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.MinUnary(input_vertex, label=None)[source]
Return type:Vertex
keanu.vertex.Product(input_vertex, over_dimensions, label=None)[source]
Return type:Vertex
keanu.vertex.Sign(input_vertex, label=None)[source]

Takes the sign of a vertex

Parameters:input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex
Return type:Vertex
keanu.vertex.Sum(input_vertex, over_dimensions, label=None)[source]

Performs a sum across specified dimensions. Negative dimension indexing is not supported.

Parameters:
  • input_vertex (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the vertex to have its values summed
  • over_dimensions (Collection[int]) – dimensions to sum over
Return type:

Vertex

keanu.vertex.Assert(predicate, error_message, label=None)[source]

A vertex that asserts a {@link BooleanVertex} is all true on calculation.

Parameters:
  • predicate (Union[int, integer, float, floating, bool_, Series, DataFrame, ndarray, JavaObjectWrapper, str]) – the predicate to evaluate
  • error_message (str) – a message to include in the {@link AssertionError}
Return type:

Vertex