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 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.
Provides a linear algebra system used for numerical operations in Tribuo.
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.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.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.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
.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.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.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.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)
.