LatentLego is a python library for building autoencoders for single-cell genomics. It is build on top of TensorFlow and Keras and provides modular components to build common single-cell autoencoder architectures. All individual comonents are valid Keras Layer
or Model
objects and therefore support model construction using the standard Keras (functional/sequential) API. There is also a model zoo of preconstructed models that understand builtin Keras methods like .fit()
or .predict()
and .compile()
with custom loss functions.
You can install LatentLego from PyPI using pip
pip install latent
or install the development version from GitHub
pip install git+https://github.com/quadbio/latent-lego
LatentLego is like a lego box with building blocks for autoencoders. Here's an overview:
-
latent.models
- Here you can find Keras-compatible implementations of common single-cell autoencoder architectures, such as theZINBAutoencoder
(Erslan 2019) or theNegativeBinomialVAE
(Lopez 2018). I also implemented some more experimental architectures like theTopologicalAutoencoder
(Moor 2019). -
latent.modules
- Here live the lower level building blocks of autoencoders, namelyencoder
anddecoder
models that can be freely assembled to produce autoencoder models. E.g., using aVariationalEncoder
with aPoissonDecoder
produces aPoissonVAE
, a variational autoencoder with a poisson reconstruction loss. -
latent.layers
- These are the most basic building blocks ofencoder
anddecoder
models. In addition to theDenseBlock
/DenseStack
layers that are the core component of encoders and decoders, I implemeneted some other useful utility layers. -
latent.losses
,latent.activations
,latent.callbacks
- Keras-style components that are useful for single-cell data, like aNegativeBinomial
loss or aKLDivergenceScheduler
callback function. All of these should work nicely within the TensorFlow/Keras framework.
If you want to find out more, check out the Documentation.