wandou.math.algebra.decomposer.hebbian

HebbianSolver

class HebbianSolver extends AnyRef

The Hebbian solver is an iterative, sparse, singular value decomposition solver, based on the paper Generalized Hebbian Algorithm for Latent Semantic Analysis (2005) by Genevieve Gorrell and Brandyn Webb (a.k.a. Simon Funk). TODO: more description here! For now: read the inline comments, and the comments for the constructors.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HebbianSolver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HebbianSolver(numPassesPerEigen: Int)

    Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread, with convergenceTarget set to 0, which means that the solver will not really care about convergence as a loop-exiting criterion (but will be checking for convergence anyways, so it will be logged and singular values will be saved).

    Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread, with convergenceTarget set to 0, which means that the solver will not really care about convergence as a loop-exiting criterion (but will be checking for convergence anyways, so it will be logged and singular values will be saved).

    numPassesPerEigen

    the exact number of times the verifier will check convergence status in the background before the solver will move on to the next eigen-vector.

  2. new HebbianSolver(convergenceTarget: Double)

    Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread, with maxPassesPerEigen set to Integer.MAX_VALUE.

    Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread, with maxPassesPerEigen set to Integer.MAX_VALUE. Not recommended unless only looking for the first few (5, maybe 10?) singular vectors, as small errors which compound early on quickly put a minimum error on subsequent vectors.

    convergenceTarget

    a small "epsilon" value which tells the solver how small you want the cosine of the angle between a proposed eigenvector and that same vector after being multiplied by the (square of the) input corpus

  3. new HebbianSolver(convergenceTarget: Double, maxPassesPerEigen: Int)

    This is the recommended constructor to use if you're not sure Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread.

    This is the recommended constructor to use if you're not sure Creates a new HebbianSolver with the default to do the updating work, and the default to check for convergence in a (single) background thread.

    convergenceTarget

    a small "epsilon" value which tells the solver how small you want the cosine of the angle between a proposed eigenvector and that same vector after being multiplied by the (square of the) input corpus

    maxPassesPerEigen

    a cutoff which tells the solver after how many times of checking for convergence (done by the verifier) should the solver stop trying, even if it has not reached the convergenceTarget.

  4. new HebbianSolver(updater: EigenUpdater, verifier: SingularVectorVerifier, convergenceTarget: Double)

    Creates a new HebbianSolver with maxPassesPerEigen = Integer.MAX_VALUE (i.e.

    Creates a new HebbianSolver with maxPassesPerEigen = Integer.MAX_VALUE (i.e. keep on iterating until convergenceTarget is reached). Not recommended unless only looking for the first few (5, maybe 10?) singular vectors, as small errors which compound early on quickly put a minimum error on subsequent vectors.

    updater

    EigenUpdater used to do the actual work of iteratively updating the current "best guess" singular vector one data-point presentation at a time.

    verifier

    an object which perpetually tries to check how close to convergence the current singular vector is (typically is a which does this in the background in another thread, while the main thread continues to converge)

    convergenceTarget

    a small "epsilon" value which tells the solver how small you want the cosine of the angle between a proposed eigenvector and that same vector after being multiplied by the (square of the) input corpus

  5. new HebbianSolver(updater: EigenUpdater, verifier: SingularVectorVerifier, convergenceTarget: Double, maxPassesPerEigen: Int)

    updater

    EigenUpdater used to do the actual work of iteratively updating the current "best guess" singular vector one data-point presentation at a time.

    verifier

    an object which perpetually tries to check how close to convergence the current singular vector is (typically is a which does this in the background in another thread, while the main thread continues to converge)

    convergenceTarget

    a small "epsilon" value which tells the solver how small you want the cosine of the angle between a proposed eigenvector and that same vector after being multiplied by the (square of the) input corpus

    maxPassesPerEigen

    a cutoff which tells the solver after how many times of checking for convergence (done by the verifier) should the solver stop trying, even if it has not reached the convergenceTarget.

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. def hasNotConverged(currentPseudoEigen: Vector, corpus: Matrix, state: TrainingState): Boolean

    Uses the to check for convergence

    Uses the to check for convergence

    currentPseudoEigen

    the purported singular vector whose convergence is being checked

    corpus

    the corpus to check against

    state

    contains the previous eigens, various other solving state TrainingState

    returns

    true if either we have converged, or maxPassesPerEigen has been exceeded.

    Attributes
    protected
  11. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  16. def solve(corpus: Matrix, desiredRank: Int): TrainingState

    Primary singular vector solving method.

    Primary singular vector solving method.

    corpus

    input matrix to find singular vectors of. Needs not be symmetric, should probably be sparse (in fact the input vectors are not mutated, and accessed only via dot-products and sums, so they should be

    desiredRank

    the number of singular vectors to find (in roughly decreasing order by singular value)

    returns

    the final of the solver, after desiredRank singular vectors (and approximate singular values) have been found.

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

    Definition Classes
    AnyRef → Any
  19. def verify(corpus: Matrix, currentPseudoEigen: Vector): EigenStatus

    Attributes
    protected
  20. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped