Infer.NET user guide

Frequently Asked Questions

Common questions and answers about the Infer.NET framework.

General

  • What is Infer.NET ?

    Infer.NET is a framework for running Bayesian inference in graphical models. It provides the state-of-the-art message-passing algorithms, graph algorithms, and linear algebra routines needed by modern machine learning applications (read more).

  • Who is behind Infer.NET?

    Infer.NET is being developed in the Machine Learning and Perception group at Microsoft Research Cambridge by Tom Minka, John Winn, John Guiver and Anitha Kannan.

  • How do I cite Infer.NET?

    Please cite using the following text:

    T. Minka, J. Winn, J. Guiver, and A. Kannan
    Infer.NET 2.3, Microsoft Research Cambridge, 2009.
    http://research.microsoft.com/infernet

    or using the following BibTeX:

    @misc{InferNET09,   
      author = "Minka, T. and Winn, J.M. and Guiver, J.P. and Kannan, A.",
      title = {{Infer.NET 2.3}},
      year = 2009,
      note = {Microsoft Research Cambridge. http://research.microsoft.com/infernet}
    }
  • Do I have to use C#?

    No. You can use Infer.NET from any .NET language such as C#, Managed C++, F#, IronPython, and others. Examples of using Infer.NET from several of these languages are included in the user guide.

    The code generated by Infer.NET is in C#, but it can be invoked from any .NET language.

  • Can I use Infer.NET in a commercial application?

    At this time, commercial use of Infer.NET is limited to Microsoft. No other commercial licenses are available.

Running the examples

  • I get a Security Exception when running the example solutions

    The examples are installed into your personal Documents folder. If this is on a network drive, you may get Security exceptions running these. The easiest solution is for you to copy the example folders to a local drive.

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 improve the speed/accuracy of inference with Infer.NET?

    Read the section on improving the speed and accuracy of inference.

  • 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.

Troubleshooting

  • 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.

Last modified at 11/12/2009 9:44 AM  by John Guiver 
©2009 Microsoft Corporation. All rights reserved.  Terms of Use | Trademarks | Privacy Statement