 # Factor

#### trait Factor extends Ordered[Factor]

A single factor in a factor graph. From a Factor you can get its neighboring variables, the factor's score using the neighboring variable's current values, the factor's score using some Assignment to the the neighboring variable's values, sufficient statistics,

Linear Supertypes
Ordered[Factor], Comparable[Factor], AnyRef, Any
Ordering
1. Alphabetic
2. By inheritance
Inherited
1. Factor
2. Ordered
3. Comparable
4. AnyRef
5. Any
1. Hide All
2. Show all
Visibility
1. Public
2. All

### Abstract Value Members

1. #### abstract def assignmentScore(a: variable.Assignment): Double

This factor's score, using the neighbors' values from the given assignment, not necessarily their current values.

This factor's score, using the neighbors' values from the given assignment, not necessarily their current values..

2. #### abstract def currentAssignment: variable.Assignment

Return a record of the current values of this Factor's neighbors.

3. #### abstract def currentScore: Double

This factor's contribution to the unnormalized log-probability of the current possible world.

4. #### abstract def numVariables: Int

The number of variables neighboring this factor.

5. #### abstract def variable(index: Int): variable.Var

The Nth neighboring variable of this factor.

6. #### abstract def variables: Seq[variable.Var]

Returns the collection of variables neighboring this factor.

### Concrete Value Members

1. #### final def !=(arg0: AnyRef): Boolean

Definition Classes
AnyRef
2. #### final def !=(arg0: Any): Boolean

Definition Classes
Any
3. #### final def ##(): Int

Definition Classes
AnyRef → Any
4. #### def <(that: Factor): Boolean

Definition Classes
Ordered
5. #### def <=(that: Factor): Boolean

Definition Classes
Ordered
6. #### final def ==(arg0: AnyRef): Boolean

Definition Classes
AnyRef
7. #### final def ==(arg0: Any): Boolean

Definition Classes
Any
8. #### def >(that: Factor): Boolean

Definition Classes
Ordered
9. #### def >=(that: Factor): Boolean

Definition Classes
Ordered

11. #### final def asInstanceOf[T0]: T0

Definition Classes
Any

13. #### def assignmentStatistics(a: variable.Assignment): StatisticsType

Return this Factor's sufficient statistics for the values in the Assignment.

14. #### def clone(): AnyRef

Attributes
protected[java.lang]
Definition Classes
AnyRef
Annotations
@throws( ... )
15. #### def compare(that: Factor): Int

Return an object that can iterate over all value assignments to the neighbors of this Factor

Return an object that can iterate over all value assignments to the neighbors of this Factor

Definition Classes
Factor → Ordered
16. #### def compareTo(that: Factor): Int

Definition Classes
Ordered → Comparable
17. #### def currentScoreAndStatistics: (Double, StatisticsType)

Return the score and statistics of the current neighbor values; this method enables special cases in which it is more efficient to calculate them together.

18. #### def currentStatistics: StatisticsType

Return this Factor's sufficient statistics of the current values of the Factor's neighbors.

19. #### final def eq(arg0: AnyRef): Boolean

Definition Classes
AnyRef
20. #### def equalityPrerequisite: AnyRef

In order to two Factors to satisfy "equals", the value returned by this method for each Factor must by "eq".

In order to two Factors to satisfy "equals", the value returned by this method for each Factor must by "eq". This method is overridden in Family to deal with Factors that are inner classes.

21. #### def equals(other: Any): Boolean

Definition Classes
Factor → AnyRef → Any

23. #### def finalize(): Unit

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

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

Definition Classes
Factor → AnyRef → Any
26. #### final def isInstanceOf[T0]: Boolean

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

Definition Classes
AnyRef
28. #### final def notify(): Unit

Definition Classes
AnyRef
29. #### final def notifyAll(): Unit

Definition Classes
AnyRef
30. #### def statisticsAreValues: Boolean

True iff the statistics are the values (without transformation), e.

True iff the statistics are the values (without transformation), e.g. valuesStatistics simply returns its argument.

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

Definition Classes
AnyRef
32. #### def toString(): String

Definition Classes
Factor → AnyRef → Any
33. #### def touches(variable: variable.Var): Boolean

Does this Factor have the given variable among its neighbors?

34. #### def touchesAny(variables: Iterable[variable.Var]): Boolean

Does this Factor have any of the given variables among its neighbors?

35. #### def valuesScore(tensor: Tensor): Double

Return the score for Factors whose values can be represented as a Tensor, otherwise throw an Error.

Return the score for Factors whose values can be represented as a Tensor, otherwise throw an Error. For Factors/Family in which the Statistics are the values, this method simply calls statisticsScore(Tensor).

37. #### def valuesStatistics(tensor: Tensor): Tensor

Given a Tensor representation of the values, return a Tensor representation of the statistics.

Given a Tensor representation of the values, return a Tensor representation of the statistics. We assume that if the values have Tensor representation that the StatisticsType does also. Note that (e.g. in BP) the Tensor may represent not just a single value for each neighbor, but a distribution over values

38. #### final def wait(): Unit

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

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

Definition Classes
AnyRef
Annotations
@throws( ... )