BIDMach.models

LDA

class LDA extends FactorModel

LDA model using online Variational Bayes (Hoffman, Blei and Bach, 2010)

Parameters

Other key parameters inherited from the learner, datasource and updater:

Example:

a is a sparse word x document matrix

val (nn, opts) = LDA.learner(a)
opts.what             // prints the available options
opts.uiter=2          // customize options
nn.train              // train the model
nn.modelmat           // get the final model
nn.datamat            // get the other factor (requires opts.putBack=1)

val (nn, opts) = LDA.learnPar(a) // Build a parallel learner
opts.nthreads=2       // number of threads (defaults to number of GPUs)
nn.train              // train the model
nn.modelmat           // get the final model
nn.datamat            // get the other factor
Linear Supertypes
FactorModel, Model, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LDA
  2. FactorModel
  3. Model
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LDA(opts: Opts = new LDA.Options)

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. var _modelmats: Array[Mat]

    Definition Classes
    Model
  5. var alpha: Mat

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def bind(ds: DataSource): Unit

    Definition Classes
    Model
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def copyMats(from: Array[Mat], to: Array[Mat]): Unit

    Definition Classes
    Model
  10. def copyTo(mod: Model): Unit

    Definition Classes
    Model
  11. var datasource: DataSource

    Definition Classes
    Model
  12. def doblock(gmats: Array[Mat], ipass: Int, i: Long): Unit

    Definition Classes
    FactorModelModel
  13. def doblockg(amats: Array[Mat], ipass: Int, here: Long): Unit

    Definition Classes
    Model
  14. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  16. def evalblock(mats: Array[Mat], ipass: Int, here: Long): FMat

    Definition Classes
    FactorModelModel
  17. def evalblockg(amats: Array[Mat], ipass: Int, here: Long): FMat

    Definition Classes
    Model
  18. def evalfun(sdata: Mat, user: Mat, ipass: Int): FMat

    Evaluates model log-likelihood on a held-out batch of the input data.

    Evaluates model log-likelihood on a held-out batch of the input data.

    sdata

    The word x document input data. Has dimension (# words x opts.batchSize), where batchSize is typically much smaller than the total number of documents, so sdata is usually a portion of the full input.

    user

    An (opts.dim x opts.batchSize) matrix that stores some intermediate/temporary data and gets left- multiplied by modelmats(0) to form sdata.

    ipass

    Index of the pass over the data (0 = first pass, 1 = second pass, etc.).

    Definition Classes
    LDAFactorModel
  19. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  21. var gmats: Array[Mat]

    Definition Classes
    Model
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def init(): Unit

    Sets up the modelmats and updatemats arrays and initializes modelmats(0) randomly unless stated otherwise.

    Sets up the modelmats and updatemats arrays and initializes modelmats(0) randomly unless stated otherwise.

    Definition Classes
    LDAFactorModelModel
  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. var mats: Array[Mat]

    Definition Classes
    Model
  26. var mm: Mat

  27. def modelmats: Array[Mat]

    Definition Classes
    Model
  28. def mupdate(sdata: Mat, user: Mat, ipass: Int): Unit

    Updates modelmats(0), the topic x word matrix that is ultimately returned as output for the model.

    Updates modelmats(0), the topic x word matrix that is ultimately returned as output for the model.

    sdata

    The word x document input data. Has dimension (# words x opts.batchSize), where batchSize is typically much smaller than the total number of documents, so sdata is usually a portion of the full input.

    user

    An (opts.dim x opts.batchSize) matrix that stores some intermediate/temporary data and gets left- multiplied by modelmats(0) to form sdata.

    ipass

    Index of the pass over the data (0 = first pass, 1 = second pass, etc.).

    Definition Classes
    LDAFactorModel
  29. def mupdate2(data: Mat, user: Mat, ipass: Int): Unit

    Definition Classes
    FactorModel
  30. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  33. val opts: Opts

    Definition Classes
    LDAFactorModelModel
  34. var parent_model: Model

    Definition Classes
    Model
  35. var putBack: Int

    Definition Classes
    Model
  36. var refresh: Boolean

    Definition Classes
    Model
  37. def setmodelmats(a: Array[Mat]): Unit

    Definition Classes
    Model
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  39. def toString(): String

    Definition Classes
    AnyRef → Any
  40. var traceMem: Boolean

  41. def updatePass(ipass: Int): Unit

    Definition Classes
    Model
  42. var updatemats: Array[Mat]

    Definition Classes
    Model
  43. var useDouble: Boolean

    Definition Classes
    Model
  44. var useGPU: Boolean

    Definition Classes
    Model
  45. def uupdate(sdata: Mat, user: Mat, ipass: Int): Unit

    Updates user according to the variational EM update process in the original (2003) LDA Paper.

    Updates user according to the variational EM update process in the original (2003) LDA Paper.

    This can be a bit tricky to understand. See Equation 2.2 in Huasha Zhao's PhD from UC Berkeley for details on the math and cross-reference it with the 2003 LDA journal paper.

    sdata

    The word x document input data. Has dimension (# words x opts.batchSize), where batchSize is typically much smaller than the total number of documents, so sdata is usually a portion of the full input.

    user

    An (opts.dim x opts.batchSize) matrix that stores some intermediate/temporary data and gets left- multiplied by modelmats(0) to form sdata.

    ipass

    Index of the pass over the data (0 = first pass, 1 = second pass, etc.).

    Definition Classes
    LDAFactorModel
  46. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from FactorModel

Inherited from Model

Inherited from AnyRef

Inherited from Any

Ungrouped