# Developer API

Documentation for ForneyLab.jl's developer API.

## Extended rules registration

ForneyLab.@expectationPropagationRuleMacro

@expectationPropagationRule registers a expectation propagation update rule by defining the rule type and the corresponding methods for the outboundType and isApplicable functions. If no name (type) for the new rule is passed, a unique name (type) will be generated. Returns the rule type.

source
ForneyLab.@marginalRuleMacro

@marginalRule registers a marginal update rule for a (joint) marginal by defining the rule type and the corresponding methods for the isApplicable function. If no name (type) for the new rule is passed, a unique name (type) will be generated. Returns the rule type.

source
ForneyLab.@naiveVariationalRuleMacro

@naiveVariationalRule registers a variational update rule for the naive (mean-field) factorization by defining the rule type and the corresponding methods for the outboundType and isApplicable functions. If no name (type) for the new rule is passed, a unique name (type) will be generated. Returns the rule type.

source
ForneyLab.@structuredVariationalRuleMacro

@structuredVariationalRule registers a variational update rule for the structured factorization by defining the rule type and the corresponding methods for the outboundType and isApplicable functions. If no name (type) for the new rule is passed, a unique name (type) will be generated. Returns the rule type.

source
ForneyLab.@sumProductRuleMacro

@sumProductRule registers a sum-product update rule by defining the rule type and the corresponding methods for the outboundType and isApplicable functions. If no name (type) for the new rule is passed, a unique name (type) will be generated. Returns the rule type.

source

## Graph (low-level)

ForneyLab.InterfaceType

An Interface belongs to a FactorNode and represents a half-edge. An Interface has at most one partner interface, with wich it forms an edge.

source
ForneyLab.TerminalType

Description:

Terminal is a special type of node that is only used in the internal
graph of a CompositeFactor. A Terminal is used to terminate an Edge in the
internal graph that is linked to an interface of the CompositeFactor.

A Terminal is linked to an interface of the
CompositeFactor containing the Terminal.

Interfaces:

1. out

Construction:

Terminal(id=:some_id)
source

## Scheduler (low-level)

ForneyLab.MarginalEntryType

A MarginalEntry defines a marginal computation. The marginal_update_rule <: MarginalUpdateRule defines the rule that is used to calculate the (joint) marginal over target.

source
ForneyLab.MessageUpdateRuleType

A MessageUpdateRule specifies how a Message is calculated from the node function and the incoming messages. Use subtypes(MessageUpdateRule) to list the available rules.

source
ForneyLab.PosteriorFactorType

A PosteriorFactor specifies the subset of variables that comprise a joint factor in the posterior factorization. A PosteriorFactor can be defined by a (selection of) variable(s), or on the complete graph.

source
ForneyLab.ScheduleEntryType

A ScheduleEntry defines a message computation. The message_update_rule <: MessageUpdateRule defines the rule that is used to calculate the message coming out of interface.

source