Documentation
Support
Team
|
|
Infer.NET user guide
Frequently Asked Questions
Common questions and answers about the Infer.NET framework.
General
Modelling
-
What models can Infer.NET handle?
Infer.NET can handle Bayesian networks and undirected models (Markov Random Fields) containing both discrete and continuous variables.
-
What models can Infer.NET not handle?
The following are not handled in the beta, but are likely to be supported in the full release. - Gaussian processes
The following are not planned to be supported in the full release but may be supported in future releases: - Efficient support for chain and grid models (they can be constructed inefficiently in the beta). - Non-parametric models (e.g. Dirichlet process).
-
Does Infer.NET support Hidden Markov Models (HMMs)?
Infer.NET 2.3 beta does support Hidden Markov Models, except that they need to be 'unrolled' i.e. you cannot have random variable arrays for the variables along the HMM, they need to be separate variables.This unrolling means that compiling very large HMMs will be costly in both memory and time, and that also the resultant inference will be slightly slower.
The click through model is a customised form of HMM, which is implemented as an unrolled set of variables.In this case, the number of variables is small and so the unrolling is not a problem.
In future, we will be looking into support for rolled-up HMM models, which will make HMMs and similar chain-like models more efficient and allow them to be used for larger data sets. However, this is unlikely to be implemented for the full release.
Inference
-
What inference algorithms does Infer.NET support?
Infer.NET supports expectation propagation (including belief propagation as a special case), variational message passing (also known as variational Bayes, variational EM) and block Gibbs sampling. Support for Power EP is planned for a future release.
-
-
How can I change the inference schedule?
-
At present, the only supported mechanism for changing the automatically generated inference schedule is to provide initial values for particular messages which will then indirectly affect the schedule. If you have examples where the scheduler is giving a poor schedule, please let us know.
-
It is also possible to change the schedule manually by editing the generated code to re-order the message computations.
-
You can also affect the schedule by partitioning your model and using the concept of shared variables. The automatic schedule will run on each piece, but you have control over scheduling the submodels.
-
Finally, you can bypass the Infer.NET schedule altogether and call directly into the operator message methods.
-
How memory efficient is Infer.NET?
Infer.NET pre-allocates memory for all messages being passed during inference. In some circumstances, this means that more memory is required than is strictly necessary. This can also be particularly severe when running models with large message type such as Dirichlet or Discrete messages. It is possible to reduce the memory footprint by breaking the model into several submodels. We plan to investigate mechanisms for improving memory efficiency in future releases.
-
Does Infer.NET scale to large models/data sets?
Infer.NET has been designed from the ground up to be computationally efficient. The compiler architecture means that the generated inference code often approaches the efficiency of hand-written code. Infer.NET also supports batch-processing of large datasets by sharing variables between models and you can implement customised message operators to overcome particular performance bottlenecks. However, there will always be cases where hand-coded solutions can exploit special cases to improve efficiency. If you have an example where Infer.NET generated code is significantly less efficient than hand-written code, please let us know.
Note that the model compiler in the beta is not itself particularly efficient. We have focused our efforts so far on making the generated code efficient, rather than the generation process itself. Hence you should ensure that you are only invoking the compiler once or, at most, a small number of times (i.e. not inside a loop). Methods for doing this are presented in the tutorials.
-
My inference is running very slowly.
This is normally caused by the inference compiler running inside a loop. You can avoid recompilation using observed values as described in this tutorial. If this does not help, try reading the section on improving the speed and accuracy of inference.
Slow inference might also be because you are hitting memory limits on your system. Refer to the earlier bullet on memory efficiency for strategies to deal with that.
-
Obtaining ImproperDistributionException during inference
To avoid this, depending on your model, use initialization (for an example of initialization, see the Mixture of Gaussians tutorial), try changing priors or reorder the data.
|
|
|
|
 |