Trait/Object

com.cra.figaro.algorithm.factored.factors

Factor

Related Docs: object Factor | package factors

Permalink

trait Factor[T] extends AnyRef

Definition of Factor

A factor is associated with a set of variables and specifies a value for every combination of assignments to those variables.

Factors are parameterized by the type of the Variables they contain and contain a semiring that defines the mathematical operation to be performed on the values Parent variables are distinguished from the output variable.

Refactored by

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Factor
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def combination(that: Factor[T], op: (T, T) ⇒ T): Factor[T]

    Permalink

    Combination function for factors.

    Combination function for factors. By default, this is product, but other operations (such as divide that is a valid operation for some semirings) can use this

  2. abstract def contentsContains(index: List[Int]): Boolean

    Permalink

    Test whether a factor contains a value for a specific index

  3. abstract def createFactor[T](parents: List[Variable[_]], output: List[Variable[_]], _semiring: Semiring[T] = semiring): Factor[T]

    Permalink

    Creates a new factor of the same type

  4. abstract def deDuplicate(): Factor[T]

    Permalink

    Returns a new Factor with duplicate variable(s) removed

  5. abstract def fillByRule(rule: (List[Extended[_]]) ⇒ T): Factor[T]

    Permalink

    Fill the contents of this factor by applying a rule to every combination of values.

  6. abstract def get(indices: List[Int]): T

    Permalink

    Get the value associated with a row.

    Get the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.

  7. abstract def getContents(): Traversable[T]

    Permalink

    Get the contents of a factor as a traversable (note: no indicies provided)

  8. abstract def mapTo[U](fn: (T) ⇒ U, _semiring: Semiring[U] = semiring): Factor[U]

    Permalink

    Fill the contents of the target by applying the given function to all elements of this factor.

  9. abstract def marginalizeToWithSum(sum: (T, T) ⇒ T, targets: Variable[_]*): Factor[T]

    Permalink

    Returns the marginalization of the factor to a variable according to the given addition function.

    Returns the marginalization of the factor to a variable according to the given addition function. Unlike marginalizeTo, this uses the provided sum function. This is useful e.g. to easily switch between max-product and sum-product operations when the data within are unchanged and the product operation is the same.

    The returned factor uses the semiring associated with this factor; it does not override the sum function of the semiring with the function given here.

  10. abstract def output: List[Variable[_]]

    Permalink
  11. abstract def parents: List[Variable[_]]

    Permalink
  12. abstract def product(that: Factor[T]): Factor[T]

    Permalink

    Returns the product of this factor with another factor according to a given multiplication function.

    Returns the product of this factor with another factor according to a given multiplication function. The product is associated with all variables in the two inputs, and the value associated with an assignment is the product of the values in the two inputs.

  13. abstract def recordArgMax[U](variable: Variable[U], comparator: (T, T) ⇒ Boolean, _semiring: Semiring[U] = semiring.asInstanceOf[Semiring[U]]): Factor[U]

    Permalink

    Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function.

    Returns a factor that maps values of the other variables to the value of the given variable that maximizes the entry associated with that value, according to some maximization function. comparator defines the maximization. It returns true iff its second argument is greater than its first.

    U

    The type of element whose value is being recorded. The resulting factor maps values of other variables in this factor to this type.

  14. abstract def semiring: Semiring[T]

    Permalink
  15. abstract def set(indices: List[Int], value: T): Factor[T]

    Permalink

    Set the value associated with a row.

    Set the value associated with a row. The row is identified by an list of indices into the ranges of the variables over which the factor is defined.

  16. abstract def stringContents(): String

    Permalink

    Return the contents of a factor as a string

  17. abstract def sumOver(variable: Variable[_], sum: (T, T) ⇒ T = semiring.sum): Factor[T]

    Permalink

    Returns the summation of the factor over a variable according to an addition function.

    Returns the summation of the factor over a variable according to an addition function. The result is associated with all the variables in the input except for the summed over variable and the value for a set of assignments is the sum of the values of the corresponding assignments in the input.

    If no funciton is provided, this defaults to the sum function in this factor's semiring.

  18. abstract def toReadableString: String

    Permalink

    Produce a readable string representation of the factor

Concrete Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def contains(index: List[Int]): Boolean

    Permalink
  7. def convertIndicesToValues(indices: List[Int]): List[Extended[_]]

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def foldLeft(initial: T, fn: (T, T) ⇒ T): T

    Permalink

    Fold the given function through the contents of the factor, beginning with the given initial values

  12. def generateIndices: Indices

    Permalink
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getIndices: Indices

    Permalink
  15. def hasStar: Boolean

    Permalink

    Indicates if any of this Factor's variables has Star

  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. val isConstraint: Boolean

    Permalink

    Indicates if this Factor is condition/constrained

  18. def isEmpty: Boolean

    Permalink

    Indicates if this Factor has any variables

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def marginalizeTo(targets: Variable[_]*): Factor[T]

    Permalink

    Returns the marginalization of the factor to a variable according to the addition function in this factor's semiring.

    Returns the marginalization of the factor to a variable according to the addition function in this factor's semiring. This involves summing out all other variables.

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

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. lazy val numVars: Int

    Permalink
  25. val size: Int

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

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink

    Description that includes the variable list and conditional probabilities

    Description that includes the variable list and conditional probabilities

    Definition Classes
    Factor → AnyRef → Any
  28. def variables: List[Variable[_]]

    Permalink
  29. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped