Class ShrinkingMatrix

java.lang.Object
org.tribuo.math.la.DenseMatrix
org.tribuo.math.optimisers.util.ShrinkingMatrix
All Implemented Interfaces:
Serializable, Iterable<MatrixTuple>, Matrix, Tensor, ShrinkingTensor

public class ShrinkingMatrix extends DenseMatrix implements ShrinkingTensor
A subclass of DenseMatrix which shrinks the value every time a new value is added.

Be careful when modifying this or DenseMatrix.

See Also:
  • Constructor Details

    • ShrinkingMatrix

      public ShrinkingMatrix(DenseMatrix v, double baseRate, boolean scaleShrinking)
      Constructs a shrinking matrix copy of the supplied dense matrix.

      This matrix shrinks during each call to intersectAndAddInPlace(Tensor, DoubleUnaryOperator).

      Parameters:
      v - The matrix to copy.
      baseRate - The base amount of shrinking to apply after each update.
      scaleShrinking - If true reduce the shrinking value over time proportionally to the number of updates.
    • ShrinkingMatrix

      public ShrinkingMatrix(DenseMatrix v, double baseRate, double lambda)
      Constructs a shrinking matrix copy of the supplied dense matrix.

      This matrix shrinks during each call to intersectAndAddInPlace(Tensor, DoubleUnaryOperator), and then reprojects the matrix so it has the same twoNorm.

      Parameters:
      v - The matrix to copy.
      baseRate - The base rate of shrinkage.
      lambda - The lambda value (see Pegasos).
  • Method Details