Using methods from ReactiveMP

In the Julia programming language (in contrast to Python for example) the most common way of loading a module is:

using ReactiveMP

A nice explanation about how modules/packages work in Julia can be found in the official documentation.

In a nutshell, Julia automatically resolves all name collisions and there is no a lot of benefit of importing specific names, e.g.:

import ReactiveMP: mean

One of the reasons for that is that Julia uses multiple-dispatch capabilities to merge names automatically and will indicate (with a warning) if something went wrong or names have unresolvable collisions on types. As a small example of this feature consider the following small import example:

import ReactiveMP: mean as mean_from_reactivemp
import Distributions: mean as mean_from_distributions

mean_from_reactivemp === mean_from_distributions
true

Even though we import mean function from two different packages they actually refer to the same object. Worth noting that this is not always the case - Julia will print a warning in case it finds unresolvable conflicts and usage of such functions will be disallowed unless user import them specifically. Read more about this in the section of the Julia's documentation.

# It is easier to let Julia resolve names automatically
# Julia will not overwrite `mean` that is coming from both packages
using ReactiveMP, Distributions
mean(Normal(0.0, 1.0)) # `Normal` is an object from `Distributions.jl`
0.0
mean(NormalMeanVariance(0.0, 1.0)) # `NormalMeanVariance` is an object from `ReactiveMP.jl`
0.0

List of available methods

Below you can find a list of exported methods from ReactiveMP.jl. All methods (even private) can be always accessed with ReactiveMP. prefix, e.g ReactiveMP.mean.

Note

Some exported names are (for legacy reasons) intended for private usage only. As a result some of these methods do not have a proper associated documentation with them. We constantly improve ReactiveMP.jl library and continue to add better documentation for many exported methods, but a small portion of these methods could be removed from this list in the future.

foreach(println, names(ReactiveMP))
@average_energy
@call_marginalrule
@call_rule
@marginalrule
@node
@rule
@symmetrical
AND
AR
ARMeta
ARsafe
ARunsafe
AbstractApproximationMethod
AbstractFormConstraint
AbstractInterfaceLocalConstraint
AbstractMessage
AbstractModelSpecification
AbstractPipelineStage
AbstractVariable
Adam
AdditiveCouplingLayer
AsyncPipelineStage
AutoVar
Autoregressive
AverageEnergy
BIFM
BIFMHelper
BIFMMeta
Bernoulli
Beta
BetheFreeEnergy
BetheFreeEnergyCheckInfs
BetheFreeEnergyCheckNaNs
BetheFreeEnergyDefaultChecks
BetheFreeEnergyDefaultMarginalSkipStrategy
Categorical
ClampEigenValuesCorrection
CompanionMatrix
CompanionMatrixTransposed
CompiledFlowModel
CompositeFormConstraint
CompositePipelineStage
ConstVariable
ConstraintsSpecification
Contingency
ContinuousMultivariateLogPdf
ContinuousUnivariateLogPdf
CustomProdStrategy
DataVariable
DefaultConstraints
DefaultFunctionalDependencies
Deterministic
DifferentialEntropy
Dirichlet
DiscontinuePipelineStage
DistProduct
EmptyPipelineStage
ExponentialLinearQuadratic
FactorBoundFreeEnergy
FactorGraphModel
FactorNode
FactorNodeCreationOptions
FixedCorrection
FixedMarginalFormConstraint
Flow
FlowMeta
FlowModel
FoldLeftProdStrategy
FoldRightProdStrategy
FormConstraintCheckEach
FormConstraintCheckLast
FormConstraintCheckPickDefault
FullFactorisation
GCV
GCVMetadata
Gamma
GammaDistributionsFamily
GammaMixture
GammaMixtureNode
GammaShapeRate
GammaShapeScale
GaussHermiteCubature
GaussLaguerreQuadrature
GaussianDistributionsFamily
GaussianMeanPrecision
GaussianMeanVariance
GaussianMixture
GaussianMixtureNode
GaussianWeighteMeanPrecision
GenericLogPdfVectorisedProduct
HugeNumber
IMPLY
ImportanceSamplingApproximation
IncludeAll
IndexedNodeInterface
InferenceResult
InitVaguePipelineStage
InputLayer
InverseWishart
KeepEach
KeepLast
KernelGCV
KernelGCVMetadata
LaplaceApproximation
LeftProposal
Linearization
LoggerPipelineStage
Marginal
Marginalisation
MatrixDirichlet
MeanField
Message
Model
ModelOptions
MomentMatching
MultivariateGaussianDistributionsFamily
MultivariateNormalDistributionsFamily
MvGaussianMeanCovariance
MvGaussianMeanPrecision
MvGaussianWeightedMeanPrecision
MvNormalMeanCovariance
MvNormalMeanPrecision
MvNormalWeightedMeanPrecision
NOT
NoCorrection
NodeInterface
NormalDistributionsFamily
NormalMeanPrecision
NormalMeanVariance
NormalMixture
NormalMixtureNode
NormalWeightedMeanPrecision
OR
PermutationLayer
PermutationMatrix
PlanarFlow
PointMass
PointMassFormConstraint
Poisson
Probit
ProbitMeta
ProdAnalytical
ProdAnalyticalRuleAvailable
ProdAnalyticalRuleUnknown
ProdFinal
ProdGeneric
ProdPreserveType
ProdPreserveTypeLeft
ProdPreserveTypeRight
RadialFlow
RandomVariable
RandomVariableCreationOptions
ReactiveMP
RequireEverythingFunctionalDependencies
RequireMarginalFunctionalDependencies
RequireMessageFunctionalDependencies
RightProposal
SampleList
SampleListFormConstraint
SampleListMeta
ScoreActor
SkipClamped
SkipClampedAndInitial
SkipInitial
StandardBasisVector
Stochastic
TinyCorrection
TinyNumber
Transition
UndefinedNodeFunctionalForm
Uniform
Uninformative
UnivariateGaussianDistributionsFamily
UnivariateNormalDistributionsFamily
Unscented
UnspecifiedFormConstraint
ValidNodeFunctionalForm
VariableBoundEntropy
VariationalMessage
Wishart
activate!
apply_pipeline_stage
approximation_name
approximation_short_name
as_marginal
as_message
as_node_functional_form
as_variable
call_optimizer
call_starting_point
cholinv
cholsqrt
clusterindex
clusters
collect_factorisation
compile
connect!
constrain_form
constvar
convert_eltype
cov
datavar
default_form_check_strategy
default_prod_constraint
degree
diageye
dot
entropy
factorisation
functional_dependencies
functionalform
getapproximation
getconst
getconstant
getconstraints
getdata
getinterface
getlayers
getmarginal
getmarginals
getmeta
getmodel
getnodes
getoptions
getpointmass
getrandom
getstats
ghcubature
huge
inference
interfaces
invcov
is_clamped
is_initial
is_marginalisation
is_moment_matching
is_point_mass_form_constraint
isconnected
iscontain
isdeterministic
isfactorised
isstochastic
laplace
localmarginalnames
localmarginals
logdetcov
logpdf
make_form_constraint
make_node
marginalrule
mean
mean_cov
mean_invcov
mean_precision
mean_std
mean_var
median
messagein
messageout
metadata
mode
model_options
multiply_messages
name
nr_params
pdf
probvec
prod_analytical_rule
promote_variate_type
randomvar
rate
resolve_prod_constraint
rule
scale
score
sdtype
setmarginal!
setmarginals!
setmessage!
setmessages!
shape
skipindex
srcubature
std
tag
tiny
update!
vague
value_support
var
variate_form
weightedmean
weightedmean_cov
weightedmean_invcov
weightedmean_precision
weightedmean_std
weightedmean_var