class ParameterizedSelect[T] extends Select[Double, T] with SingleParameterized[T]
A distribution in which the probabilities are learnable parameters and the outcomes are values.
- Alphabetic
- By Inheritance
- ParameterizedSelect
- SingleParameterized
- Parameterized
- HasDensity
- Select
- Cacheable
- Element
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ParameterizedSelect(name: Name[T], parameter: AtomicDirichlet, outcomes: List[T], collection: ElementCollection)
Type Members
-
type
Condition = (T) ⇒ Boolean
The type of conditions on the element.
The type of conditions on the element. A condition is a function from a value to a Boolean.
- Definition Classes
- Element
-
type
Constraint = (T) ⇒ Double
The type of soft constraints on the element.
The type of soft constraints on the element. A constraint is a function from a value to a Double.
- Definition Classes
- Element
-
type
Randomness = Double
The type of randomness content of the element.
-
type
Value = T
The type of values over which the element is defined.
The type of values over which the element is defined.
- Definition Classes
- Element
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
!==(that: Element[Value])(implicit universe: Universe): Neq[Value]
The element that tests inequality of this element with another element.
The element that tests inequality of this element with another element.
- Definition Classes
- Element
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
===(that: Value)(implicit universe: Universe): Apply1[T, Boolean]
The element that tests whether the value of this element is equal to a particular value.
The element that tests whether the value of this element is equal to a particular value.
- Definition Classes
- Element
-
def
===(that: Element[Value])(implicit universe: Universe): Eq[Value]
The element that tests equality of this element with another element.
The element that tests equality of this element with another element.
- Definition Classes
- Element
-
def
activate(): Unit
Activate the element in its universe.
Activate the element in its universe.
- Definition Classes
- Element
-
var
active: Boolean
Flag indicating whether the element is currently active in its universe.
Flag indicating whether the element is currently active in its universe.
- Definition Classes
- Element
-
def
addCondition(condition: Condition, contingency: Contingency = List()): Unit
Add the given condition to the existing conditions of the element.
Add the given condition to the existing conditions of the element. By default, the contingency is empty.
- Definition Classes
- Element
-
def
addConstraint(constraint: Constraint, contingency: Contingency = List()): Unit
Add a contingent constraint to the element.
Add a contingent constraint to the element. By default, the contingency is empty.
- Definition Classes
- Element
-
def
addLogConstraint(constraint: Constraint, contingency: Contingency = List()): Unit
Add a log contingent constraint to the element.
Add a log contingent constraint to the element. By default, the contingency is empty.
- Definition Classes
- Element
-
def
addPragma(pragma: Pragma[Value]): Unit
Add a pragma to the element.
Add a pragma to the element.
- Definition Classes
- Element
-
def
allConditions: List[(Condition, Contingency)]
All the conditions defined on this element.
All the conditions defined on this element.
- Definition Classes
- Element
-
def
allConstraints: List[(Constraint, Contingency)]
The current soft constraints on the element.
The current soft constraints on the element.
- Definition Classes
- Element
-
def
args: List[Element[_]]
The arguments on which the element depends.
The arguments on which the element depends.
- Definition Classes
- ParameterizedSelect → Element
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
clauses: List[(Double, T)]
- Definition Classes
- Select
-
def
clearContext(): Unit
Clears all the temporary elements associated with this element (all elements created in it's context).
Clears all the temporary elements associated with this element (all elements created in it's context).
- Definition Classes
- Element
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
collection: ElementCollection
- Definition Classes
- Element
-
def
condition(value: Any): Boolean
Tests whether all the element's contingent conditions are satisfied for the given value.
Tests whether all the element's contingent conditions are satisfied for the given value.
- Definition Classes
- Element
-
def
conditionSatisfied: Boolean
Determines whether the condition on the element is satisfied by the current value.
Determines whether the condition on the element is satisfied by the current value.
- Definition Classes
- Element
-
def
constraint(value: Any): Double
Gets the result of all the element's contingent constraints for the given value.
Gets the result of all the element's contingent constraints for the given value.
- Definition Classes
- Element
-
def
constraintValue: Double
Determines the value of the constraint on the element applied to the current value.
Determines the value of the constraint on the element applied to the current value.
- Definition Classes
- Element
-
def
context: List[Element[_]]
The elements on which the existence of this element depends.
The elements on which the existence of this element depends.
- Definition Classes
- Element
-
def
deactivate(): Unit
Deactivate the element in its universe.
Deactivate the element in its universe.
- Definition Classes
- Element
-
def
density(value: T): Double
The probability density of a value.
The probability density of a value.
- Definition Classes
- ParameterizedSelect → HasDensity
-
def
directContextContents: Set[Element[_]]
Returns the set of elements directly created in the context of this element.
Returns the set of elements directly created in the context of this element.
- Definition Classes
- Element
-
def
distributionToStatistics(distribution: Stream[(Double, T)]): Seq[Double]
Convert a distribution from this element into sufficient statistics
Convert a distribution from this element into sufficient statistics
- Definition Classes
- ParameterizedSelect → SingleParameterized
-
def
distributionToStatistics(p: Parameter[_], distribution: Stream[(Double, T)]): Seq[Double]
Convert a distribution from this element into sufficient statistics for the specified parameter
Convert a distribution from this element into sufficient statistics for the specified parameter
- Definition Classes
- SingleParameterized → Parameterized
-
def
elementsIAmContingentOn: Set[Element[_]]
Returns the elements that this element is contingent on.
Returns the elements that this element is contingent on. These are elements that are required to have a certain value for a condition or constraint to be relevant to this element. The contingency is required because conditions and constraints can be applied to references that are uncertain. Every possible element that could be pointed to by a reference must be given the condition or constraint, but the condition or constraint only applies if the elements earlier in the reference have the required value.
Figaro takes care of handling all this under the hood. However, some algorithms may need to know which elements an element is contingent on. For example, sampling algorithms may need to sample those other elements first. This method is supplied to support this use case.
- Definition Classes
- Element
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[U](fn: (Value) ⇒ Element[U])(implicit name: Name[U], collection: ElementCollection): Element[U]
- Definition Classes
- Element
-
final
def
generate(): Unit
First generate the randomness, then generate the value given the randomness.
First generate the randomness, then generate the value given the randomness. Store the results in randomness and value.
- Definition Classes
- Element
-
def
generateRandomness(): Double
Generate the randomness content.
-
def
generateValue(rand: Randomness): T
Generate the value of the element deterministically given its randomness and the values of its arguments.
Generate the value of the element deterministically given its randomness and the values of its arguments.
- Definition Classes
- ParameterizedSelect → Element
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
val
hashCode: Int
- Definition Classes
- Element
-
def
intervene(v: Value): Unit
- Definition Classes
- Element
-
def
isCachable(): Boolean
The cacheability of the element.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTemporary: Boolean
Returns true if this element is temporary, that is, was created in the context of another element.
Returns true if this element is temporary, that is, was created in the context of another element.
- Definition Classes
- Element
-
def
map[U](fn: (Value) ⇒ U)(implicit name: Name[U], collection: ElementCollection): Element[U]
- Definition Classes
- Element
-
val
name: Name[T]
- Definition Classes
- Element
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nextRandomness(oldRandomness: Randomness): (Randomness, Double, Double)
Generate the next randomness given the current randomness.
Generate the next randomness given the current randomness. Returns three values: The next randomness, the Metropolis-Hastings proposal probability ratio, which is:
P(new -> old) / P(old -> new)
and the model probability ratio, which is:
P(new) / P(old)
This implementation produces a sample using generateRandomness, which means that:
P(new -> old) / P(old -> new) = P(old) / P(new)
We use the fact that this element can compute densities for values to compute P(new) and P(old) explicitly. Note that the two returned ratios will still multiply to 1. This does not affect normal Metropolis-Hastings, but helps the Metropolis-Hastings annealer find maxima.
- Definition Classes
- HasDensity → Element
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
observe(observation: Value): Unit
Condition the element by observing a particular value.
Condition the element by observing a particular value. Propagates the effect to dependent elements and ensures that no other value for the element can be generated.
- Definition Classes
- Element
-
val
parameter: AtomicDirichlet
- Definition Classes
- ParameterizedSelect → SingleParameterized
-
val
parameters: Set[Parameter[_]]
The parameter for this element.
The parameter for this element.
- Definition Classes
- SingleParameterized → Parameterized
-
def
pragmas: List[Pragma[Value]]
The pragmas attached to the element.
The pragmas attached to the element.
- Definition Classes
- Element
-
var
randomness: Randomness
The current randomness content of the element.
The current randomness content of the element.
- Definition Classes
- Element
-
def
removeConditions(contingency: Contingency = List()): Unit
Remove all conditions associated with the given contingency.
Remove all conditions associated with the given contingency. By default, the contingency is empty.
- Definition Classes
- Element
-
def
removeConstraint(constraint: Constraint, contingency: Contingency = List()): Unit
- Attributes
- protected
- Definition Classes
- Element
-
def
removeConstraints(contingency: Contingency = List()): Unit
Remove all constraints associated with the given contingency.
Remove all constraints associated with the given contingency. By default, the contingency is empty.
- Definition Classes
- Element
-
def
removePragma(pragma: Pragma[Value]): Unit
Remove a pragma from the element.
Remove a pragma from the element.
- Definition Classes
- Element
-
def
score(oldValue: Value, newValue: Value): Double
Compute the constraints on the new value divided by the constraints on the old value.
Compute the constraints on the new value divided by the constraints on the old value.
- Definition Classes
- Element
-
def
set(newValue: Value): Unit
Set the value of this element and propagate the effects to elements that depend on it without changing their randomness.
Set the value of this element and propagate the effects to elements that depend on it without changing their randomness. Also disallows the value of the element to change until unobserve or unset is called.
- Definition Classes
- Element
-
def
setCondition(newCondition: Condition, contingency: Contingency = List()): Unit
Set the condition associated with the contingency.
Set the condition associated with the contingency. Removes previous conditions associated with the contingency. By default, the contingency is empty.
- Definition Classes
- Element
-
def
setConstraint(newConstraint: Constraint, contingency: Contingency = List()): Unit
Set the constraint associated with the contingency.
Set the constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.
- Definition Classes
- Element
-
def
setLogConstraint(newConstraint: Constraint, contingency: Contingency = List()): Unit
Set the log constraint associated with the contingency.
Set the log constraint associated with the contingency. Removes previous constraints associated with the contingency. By default, the contingency is empty.
- Definition Classes
- Element
-
def
setRandomness(newRandomness: Randomness): Unit
Set the randomness of this element.
Set the randomness of this element.
Will generate its value using the new randomness and propagate the effects to elements that depend on it without changing their randomness.
- Definition Classes
- Element
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toNameString: String
A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString.
A string that is the element's name, if it has a non-empty one, otherwise the result of the element's toString.
- Definition Classes
- Element
-
def
toString(): String
- Definition Classes
- Select → AnyRef → Any
-
def
unintervene(): Unit
- Definition Classes
- Element
-
val
universe: Universe
The universe in which the element is defined.
The universe in which the element is defined.
- Definition Classes
- Element
-
def
unobserve(): Unit
Removes conditions on the element and allows different values of the element to be generated.
Removes conditions on the element and allows different values of the element to be generated.
- Definition Classes
- Element
-
def
unset(): Unit
Allows different values of the element to be generated.
Allows different values of the element to be generated.
- Definition Classes
- Element
-
var
value: Value
The current value of the element.
The current value of the element.
- Definition Classes
- Element
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )