Uses of Interface
org.tribuo.math.la.SGDVector
Package
Description
Provides infrastructure for Stochastic Gradient Descent for classification problems.
Provides an implementation of a linear chain CRF trained using Stochastic Gradient Descent.
Provides classification loss functions for Stochastic Gradient Descent.
Provides an implementation of HDBSCAN*.
Provides a multithreaded implementation of K-Means, with a
configurable distance function.
Provides the base classes for models trained with stochastic gradient descent.
Provides an interface to TensorFlow, allowing the training of non-sequential models using any supported
Tribuo output type.
Contains the implementation of Tribuo's math library, it's gradient descent optimisers, kernels and a set of
math related utils.
An interface for distance computations between two
SGDVector
instances
along with some standard implementations.Provides a linear algebra system used for numerical operations in Tribuo.
Provides nearest neighbour query functionality.
Provides a brute-force nearest neighbour query implementation.
Provides a k-d tree nearest neighbour query implementation.
Utilities for converting Tribuo math objects into ONNX representations.
Provides some utility tensors for use in gradient optimisers.
Provides an implementation of a multi-label classification factorization machine model using Stochastic Gradient Descent.
Provides an implementation of a multi-label classification linear model using Stochastic Gradient Descent.
Provides multi-label classification loss functions for Stochastic Gradient Descent.
Provides infrastructure for Stochastic Gradient Descent based regression models.
Provides regression loss functions for Stochastic Gradient Descent.
-
Uses of SGDVector in org.tribuo.classification.sgd
Modifier and TypeFieldDescriptionfinal SGDVector[][]
Util.SequenceExampleArray.features
The array of sequence example features.Modifier and TypeMethodDescriptionLabelObjective.lossAndGradient
(Integer truth, SGDVector prediction) LabelObjective.valueAndGradient
(int truth, SGDVector prediction) Deprecated.Modifier and TypeMethodDescriptionLabelObjective.lossAndGradient
(Integer truth, SGDVector prediction) static Util.SequenceExampleArray
Util.shuffle
(SGDVector[][] features, int[][] labels, double[] weights, SplittableRandom rng) Shuffles a sequence of features, labels and weights, returning a tuple of the shuffled values.static void
Util.shuffleInPlace
(SGDVector[][] features, int[][] labels, double[] weights, SplittableRandom rng) In place shuffle used for sequence problems.LabelObjective.valueAndGradient
(int truth, SGDVector prediction) Deprecated.In 4.1, to migrate to the new nameLabelObjective.lossAndGradient(java.lang.Integer, org.tribuo.math.la.SGDVector)
. -
Uses of SGDVector in org.tribuo.classification.sgd.crf
Modifier and TypeMethodDescriptionCRFModel.convertToVector
(SequenceExample<T> example, ImmutableFeatureMap featureIDMap) Converts aSequenceExample
into an array ofSGDVector
s suitable for CRF prediction.Modifier and TypeMethodDescriptionCRFParameters.getCliqueValues
(SGDVector[] features) Generates the local scores and tuples them with the label - label transition weights.CRFParameters.getLocalScores
(SGDVector[] features) Generate the local scores (i.e., the linear classifier for each token).int[]
Generate a prediction using Viterbi.CRFParameters.predictConfidenceUsingCBP
(SGDVector[] features, List<Chunk> chunks) This predicts per chunk confidence using the constrained forward backward algorithm from Culotta and McCallum 2004.CRFParameters.predictMarginals
(SGDVector[] features) Generate a prediction using Belief Propagation.CRFParameters.valueAndGradient
(SGDVector[] features, int[] labels) Generates predictions based on the input features and labels, then scores those predictions to produce a loss for the example and a gradient update. -
Uses of SGDVector in org.tribuo.classification.sgd.objectives
Modifier and TypeMethodDescriptionHinge.lossAndGradient
(Integer truth, SGDVector prediction) LogMulticlass.lossAndGradient
(Integer truth, SGDVector prediction) Hinge.valueAndGradient
(int truth, SGDVector prediction) Deprecated.LogMulticlass.valueAndGradient
(int truth, SGDVector prediction) Deprecated.Modifier and TypeMethodDescriptionHinge.lossAndGradient
(Integer truth, SGDVector prediction) LogMulticlass.lossAndGradient
(Integer truth, SGDVector prediction) Hinge.valueAndGradient
(int truth, SGDVector prediction) Deprecated.LogMulticlass.valueAndGradient
(int truth, SGDVector prediction) Deprecated. -
Uses of SGDVector in org.tribuo.clustering.hdbscan
Modifier and TypeMethodDescriptionHdbscanTrainer.ClusterExemplar.getFeatures()
Get the feature vector in this exemplar. -
Uses of SGDVector in org.tribuo.clustering.kmeans
Modifier and TypeMethodDescriptionprotected void
KMeansTrainer.mStep
(ForkJoinPool fjp, DenseVector[] centroidVectors, Map<Integer, List<Integer>> clusterAssignments, SGDVector[] data, double[] weights) Runs the mStep, writing to thecentroidVectors
array. -
Uses of SGDVector in org.tribuo.common.sgd
Modifier and TypeMethodDescriptionSGDObjective.lossAndGradient
(T truth, SGDVector prediction) Scores a prediction, returning the loss and a vector of per output dimension gradients.Modifier and TypeMethodDescriptionTensor[]
FMParameters.gradients
(com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> score, SGDVector features) Generate the gradients for a particular feature vector given the loss and the per output gradients.SGDObjective.lossAndGradient
(T truth, SGDVector prediction) Scores a prediction, returning the loss and a vector of per output dimension gradients.Generates an unnormalised prediction by multiplying the weights with the incoming features, adding the bias and adding the feature factors.static <T> void
AbstractSGDTrainer.shuffleInPlace
(SGDVector[] features, T[] labels, double[] weights, SplittableRandom rng) Shuffles the features, outputs and weights in place. -
Uses of SGDVector in org.tribuo.interop.tensorflow
Modifier and TypeMethodDescriptionModifier and TypeMethodDescription -
Uses of SGDVector in org.tribuo.math
Modifier and TypeMethodDescriptionTensor[]
FeedForwardParameters.gradients
(com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> score, SGDVector features) Generates the parameter gradients given the loss, output gradient and input features.Tensor[]
LinearParameters.gradients
(com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> score, SGDVector features) Generate the gradients for a particular feature vector given the loss and the per output gradients.Generates an un-normalized prediction by feeding the features through the parameters.Generates an unnormalised prediction by leftMultiply'ing the weights with the incoming features.Modifier and TypeMethodDescriptionTensor[]
FeedForwardParameters.gradients
(com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> score, SGDVector features) Generates the parameter gradients given the loss, output gradient and input features.Tensor[]
LinearParameters.gradients
(com.oracle.labs.mlrg.olcut.util.Pair<Double, SGDVector> score, SGDVector features) Generate the gradients for a particular feature vector given the loss and the per output gradients. -
Uses of SGDVector in org.tribuo.math.distance
Modifier and TypeMethodDescriptiondouble
CosineDistance.computeDistance
(SGDVector first, SGDVector second) double
Distance.computeDistance
(SGDVector first, SGDVector second) Computes the distance between the two vectors.double
DistanceType.computeDistance
(SGDVector vector1, SGDVector vector2) Calculates the distance between two vectors.double
L1Distance.computeDistance
(SGDVector first, SGDVector second) double
L2Distance.computeDistance
(SGDVector first, SGDVector second) -
Uses of SGDVector in org.tribuo.math.la
Modifier and TypeClassDescriptionclass
A dense vector, backed by a double array.class
A sparse vector.Modifier and TypeMethodDescriptionAddsother
to this vector, producing a newSGDVector
.Addsother
to this vector, producing a newSGDVector
.SGDVector.copy()
Returns a deep copy of this vector.Matrix.getColumn
(int index) Returns a copy of the specified column.Matrix.getRow
(int i) AnSGDVector
view of the row.Matrix.leftMultiply
(SGDVector input) Multiplies this Matrix by aSGDVector
returning a vector of the appropriate size.Matrix.rightMultiply
(SGDVector input) Multiplies this Matrix by aSGDVector
returning a vector of the appropriate size.SGDVector.scale
(double coefficient) Generates a new vector with each element scaled bycoefficient
.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this factorization, and b is the returned value.Subtractsother
from this vector, producing a newSGDVector
.Subtractsother
from this vector, producing a newSGDVector
.Modifier and TypeMethodDescriptionAddsother
to this vector, producing a newDenseVector
.Addsother
to this vector, producing a newSGDVector
.Addsother
to this vector, producing a newSGDVector
.void
DenseMatrix.broadcastIntersectAndAddInPlace
(SGDVector input, boolean broadcastOverDim1) Broadcasts the input vector and adds it to each row/column of the matrix.default double
SGDVector.cosineDistance
(SGDVector other) Calculates the cosine distance of two vectors.default double
SGDVector.cosineSimilarity
(SGDVector other) Calculates the cosine similarity of two vectors.static DenseMatrix
DenseMatrix.createDenseMatrix
(SGDVector[] vectors) Constructs a new DenseMatrix copying the values from the supplied vectors.static DenseSparseMatrix
DenseSparseMatrix.createDiagonal
(SGDVector diagonal) Creates a diagonal matrix using the supplied values.double
SparseVector.distance
(SGDVector other, DoubleUnaryOperator transformFunc, DoubleUnaryOperator normalizeFunc) Computes the distance between this vector and the other vector.double
double
Calculates the dot product between this vector andother
.double
double
DenseVector.euclideanDistance
(SGDVector other) The l2 or euclidean distance between this vector and the other vector.double
SGDVector.euclideanDistance
(SGDVector other) The l2 or euclidean distance between this vector and the other vector.double
SparseVector.euclideanDistance
(SGDVector other) double
DenseVector.l1Distance
(SGDVector other) The l1 or Manhattan distance between this vector and the other vector.double
SGDVector.l1Distance
(SGDVector other) The l1 or Manhattan distance between this vector and the other vector.double
SparseVector.l1Distance
(SGDVector other) default double
SGDVector.l2Distance
(SGDVector other) Synonym for euclideanDistance.DenseMatrix.leftMultiply
(SGDVector input) DenseSparseMatrix.leftMultiply
(SGDVector input) Matrix.leftMultiply
(SGDVector input) Multiplies this Matrix by aSGDVector
returning a vector of the appropriate size.Generates the matrix representing the outer product between the two vectors.This generates the outer product when dotted with anotherSparseVector
.DenseMatrix.rightMultiply
(SGDVector input) DenseSparseMatrix.rightMultiply
(SGDVector input) rightMultiply is very inefficient on DenseSparseMatrix due to the storage format.Matrix.rightMultiply
(SGDVector input) Multiplies this Matrix by aSGDVector
returning a vector of the appropriate size.void
Sets the column to the supplied vector value.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this Cholesky factorization, and b is the returned value.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this eigen decomposition, and b is the returned value.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this LU factorization, and b is the returned value.Solves a system of linear equations A * b = y, where y is the input vector, A is the matrix which produced this factorization, and b is the returned value.Subtractsother
from this vector, producing a newDenseVector
.Subtractsother
from this vector, producing a newSGDVector
.Subtractsother
from this vector, producing a newSGDVector
. -
Uses of SGDVector in org.tribuo.math.neighbour
Modifier and TypeMethodDescriptionNeighboursQueryFactory.createNeighboursQuery
(SGDVector[] data) Constructs a nearest neighbour query object using the supplied array ofSGDVector
.Queries a set ofSGDVector
s to determine the k points nearest to the provided points.Queries a set ofSGDVector
s to determine the k points nearest to the provided point. -
Uses of SGDVector in org.tribuo.math.neighbour.bruteforce
Modifier and TypeMethodDescriptionNeighboursBruteForceFactory.createNeighboursQuery
(SGDVector[] data) Constructs a brute-force nearest neighbor query object using the supplied array ofSGDVector
. -
Uses of SGDVector in org.tribuo.math.neighbour.kdtree
Modifier and TypeMethodDescriptionorg.tribuo.math.neighbour.kdtree.DimensionNode
KDTree.approximateParentNode
(SGDVector point) This makes a fast approximation of the provided point's parent node, if it were being inserted into the tree.KDTreeFactory.createNeighboursQuery
(SGDVector[] data) Constructs a k-d tree nearest neighbor query object using the supplied array ofSGDVector
. -
Uses of SGDVector in org.tribuo.math.onnx
Modifier and TypeMethodDescriptionstatic ONNXInitializer
ONNXMathUtils.floatVector
(ONNXContext context, String name, SGDVector vector) Builds aONNXInitializer
containing theSGDVector
. -
Uses of SGDVector in org.tribuo.math.optimisers.util
Modifier and TypeClassDescriptionclass
A subclass ofDenseVector
which shrinks the value every time a new value is added. -
Uses of SGDVector in org.tribuo.multilabel.sgd.fm
Modifier and TypeMethodDescriptionprotected SGDObjective<SGDVector>
FMMultiLabelTrainer.getObjective()
-
Uses of SGDVector in org.tribuo.multilabel.sgd.linear
Modifier and TypeMethodDescriptionprotected SGDObjective<SGDVector>
LinearSGDTrainer.getObjective()
-
Uses of SGDVector in org.tribuo.multilabel.sgd.objectives
Modifier and TypeMethodDescriptionBinaryCrossEntropy.lossAndGradient
(SGDVector truth, SGDVector prediction) Hinge.lossAndGradient
(SGDVector truth, SGDVector prediction) Modifier and TypeMethodDescriptionBinaryCrossEntropy.lossAndGradient
(SGDVector truth, SGDVector prediction) Hinge.lossAndGradient
(SGDVector truth, SGDVector prediction) -
Uses of SGDVector in org.tribuo.regression.sgd
Modifier and TypeMethodDescriptionRegressionObjective.loss
(DenseVector truth, SGDVector prediction) Deprecated.In 4.1 to move to the new name, lossAndGradient.RegressionObjective.lossAndGradient
(DenseVector truth, SGDVector prediction) Modifier and TypeMethodDescriptionRegressionObjective.loss
(DenseVector truth, SGDVector prediction) Deprecated.In 4.1 to move to the new name, lossAndGradient.RegressionObjective.lossAndGradient
(DenseVector truth, SGDVector prediction) -
Uses of SGDVector in org.tribuo.regression.sgd.objectives
Modifier and TypeMethodDescriptionAbsoluteLoss.loss
(DenseVector truth, SGDVector prediction) Deprecated.Huber.loss
(DenseVector truth, SGDVector prediction) Deprecated.SquaredLoss.loss
(DenseVector truth, SGDVector prediction) Deprecated.AbsoluteLoss.lossAndGradient
(DenseVector truth, SGDVector prediction) Huber.lossAndGradient
(DenseVector truth, SGDVector prediction) SquaredLoss.lossAndGradient
(DenseVector truth, SGDVector prediction) Modifier and TypeMethodDescriptionAbsoluteLoss.loss
(DenseVector truth, SGDVector prediction) Deprecated.Huber.loss
(DenseVector truth, SGDVector prediction) Deprecated.SquaredLoss.loss
(DenseVector truth, SGDVector prediction) Deprecated.AbsoluteLoss.lossAndGradient
(DenseVector truth, SGDVector prediction) Huber.lossAndGradient
(DenseVector truth, SGDVector prediction) SquaredLoss.lossAndGradient
(DenseVector truth, SGDVector prediction)
LabelObjective.lossAndGradient(java.lang.Integer, org.tribuo.math.la.SGDVector)
.