Introduction

LaFoMo is a package for building Latent Force Models in Python. LaFoMo supports exact and variational inference for linear and non-linear LFMs respectively using PyTorch. In addition, we also support MCMC models for a full Bayesian treatment, and this uses TensorFlow. LaFoMo was originally created and is managed by Jacob Moss. The full list of contributors is Jacob Moss, Bianca Dumitrascu, Felix Opolka, Jeremy England, and Pietro Lio. If you are interested in contributing your Latent Force Models to this library please feel free to submit pull requests or contact us.

Install

LaFoMo can be installed running pip install lafomo. This also installs required dependencies including PyTorch and TensorFlow.

Getting Started

Get started with our examples and tutorials.

Which models are implemented?

LaFoMo implements both linear and non-linear Latent Force Models in both the temporal setting (ODE-based) and spatio-temporal (PDE-based). Given that there are a number of methods for dealing with approximate inference, we provide a variational inference module in addition to a number of MCMC samplers. The options are currently:

Linear ODE

Dependencies:

Linear ODEs can have exact solutions for the GP covariance. LaFoMo has a full implementation of the model by Lawrence et al. [1] using the lafomo.models.ExactLFM class. See the notebook here for the example implementation.

Non-linear ODE

Dependencies:

For non-linear ODEs which result in non-Gaussian likelihoods, we have two devoted modules. For variational inference, the lafomo.VariationalLFM superclass is the main building block for such models. The implementation of the GP uses the method of Hensman et al. [3]. See the notebook here for a linear implementation, and here for an implementation of a non-linear version of the Lawrence et al. [1] model.

The lafomo.mcmc module is currently a work-in-progress, and implements several MCMC samplers suited for LFMs, such as the lafomo.mcmc.samplers.LatentGPSampler which jointly samples the posterior GP in addition to the covariance kernel parameters. In addition, LaFoMo has a full implementation of such a non-linear LFM based on Titsias et al. [2]: lafomo.mcmc.modules.TranscriptionRegulationLFM .

Non-linear PDE

Dependencies:

Citing LaFoMo

To cite LaFoMo, please reference the arxiv paper. Sample BibTeX is given below:

@article{moss2020gene,
  title={Gene Regulatory Network Inference with Latent Force Models},
  author={Moss, Jacob and Li{\'o}, Pietro},
  journal={arXiv preprint arXiv:2010.02555},
  year={2020}
}

References

[1] Modelling transcriptional regulation using Gaussian processes Lawrence, N.D., Sanguinetti, G., and Rattray, M. Advances in Neural Information Processing Systems, 1639-1647, 2006.

[2] Identifying targets of multiple co-regulating transcription factors from expression time-series by Bayesian model comparison. Titsias, M.K., Honkela, A., Lawrence, N.D. and Rattray, M. BMC systems biology, 6(1), pp.1-21, 2012.

[3] Scalable Variational Gaussian Process Classification J Hensman, A G de G Matthews, Z Ghahramani Proceedings of AISTATS 18, 2015.

Acknowledgements

Jacob Moss is supported by a GlaxoSmithKline grant.