edu.arizona.sista.utils

MathUtils

Related Doc: package utils

object MathUtils

Math utility methods useful for stats and ML User: mihais, dfried Date: 4/23/13

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

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. val LogTolerance: Double

    If a difference is bigger than this in log terms, then the sum or difference of them will just be the larger (to 12 or so decimal places for double, and 7 or 8 for float).

  5. val LogToleranceFloat: Float

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def denseSoftmax(vector: Array[Double], gamma: Double = 1.0): Array[Double]

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    vector

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

    returns

  9. def denseSoftmaxFloat(vector: Array[Float], gamma: Float = 1.0f): Array[Float]

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    vector

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

    returns

  10. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. def histogram(xs: Traversable[Double], numBuckets: Int): Map[(Double, Double), Int]

  16. def histogram(xs: Traversable[Double], boundaries: Seq[Double]): Map[(Double, Double), Int]

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def logSum(logInputs: Array[Float], fromIndex: Int, toIndex: Int): Float

  19. def logSum(logInputs: Array[Double], fromIndex: Int, toIndex: Int): Double

    Returns the log of the portion between fromIndex, inclusive, and toIndex, exclusive, of an array of numbers, which are themselves input in log form.

    Returns the log of the portion between fromIndex, inclusive, and toIndex, exclusive, of an array of numbers, which are themselves input in log form. This is all natural logarithms. Reasonable care is taken to do this as efficiently as possible (under the assumption that the numbers might differ greatly in magnitude), with high accuracy, and without numerical overflow. Throws an IllegalArgumentException if logInputs is of length zero. Otherwise, returns Double.NegativeInfinity if fromIndex >= toIndex.

    logInputs

    Numbers in log form

    fromIndex

    Start offset (inclusive)

    toIndex

    End offset (exclusive)

    returns

    log(x1 + ... + xn)

  20. def logSum(logInputs: Array[Float]): Float

  21. def logSum(logInputs: Array[Double]): Double

  22. def nBest[T](scoringFunction: (T) ⇒ Double)(xs: Iterable[T], howMany: Int)(implicit arg0: Manifest[T]): List[(T, Double)]

  23. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  26. def randomize[T](l: Array[T], rand: Random): Array[T]

  27. def sampleStream[T](xs: Iterable[T], howMany: Int)(implicit arg0: Manifest[T]): List[T]

    sample howMany elements uniformly from xs.

    sample howMany elements uniformly from xs. Doesn't retain order of xs

  28. def softmax(scores: Iterable[Double], gamma: Double = 1.0): List[Double]

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    scores

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

    returns

  29. def softmaxFloat(scores: Iterable[Float], gamma: Float = 1.0f): List[Float]

    Puts a softmax layer over a collection of scores, so they look like probabilities

    Puts a softmax layer over a collection of scores, so they look like probabilities

    scores

    A collection of unnormalized scores

    gamma

    Indicates how spiked the probability distribution should be

    returns

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

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped