|
| 1 | +Implicit Reparametrization Trick |
| 2 | +========== |
| 3 | + |
| 4 | +|test| |codecov| |docs| |
| 5 | + |
| 6 | +.. |test| image:: https://github.com/intsystems/ProjectTemplate/workflows/test/badge.svg |
| 7 | + :target: https://github.com/intsystems/ProjectTemplate/tree/master |
| 8 | + :alt: Test status |
| 9 | + |
| 10 | +.. |codecov| image:: https://img.shields.io/codecov/c/github/intsystems/ProjectTemplate/master |
| 11 | + :target: https://app.codecov.io/gh/intsystems/ProjectTemplate |
| 12 | + :alt: Test coverage |
| 13 | + |
| 14 | +.. |docs| image:: https://github.com/intsystems/ProjectTemplate/workflows/docs/badge.svg |
| 15 | + :target: https://intsystems.github.io/implicit-reparameterization-trick/ |
| 16 | + :alt: Docs status |
| 17 | + |
| 18 | +Description |
| 19 | +========== |
| 20 | + |
| 21 | +This repository implements an educational project for the Bayesian Multimodeling course. It implements algorithms for sampling from various distributions, using the implicit reparameterization trick. |
| 22 | + |
| 23 | +Scope |
| 24 | +========== |
| 25 | + |
| 26 | +We plan to implement the following distributions in our library: |
| 27 | + |
| 28 | +- `Gaussian normal distribution` |
| 29 | +- `Dirichlet distribution (Beta distributions)` |
| 30 | +- `Sampling from a mixture of distributions` |
| 31 | +- `Sampling from the Student's t-distribution` |
| 32 | +- `Sampling from an arbitrary factorized distribution` |
| 33 | + |
| 34 | +Stack |
| 35 | +========== |
| 36 | + |
| 37 | +We plan to inherit from the torch.distribution.Distribution class, so we need to implement all the methods that are present in that class. |
| 38 | + |
| 39 | +Usage |
| 40 | +========== |
| 41 | + |
| 42 | +In this example, we demonstrate the application of our library using a Variational Autoencoder (VAE) model, where the latent layer is modified by a normal distribution.:: |
| 43 | + |
| 44 | + import torch.distributions.implicit as irt |
| 45 | + params = Encoder(inputs) |
| 46 | + gauss = irt.Normal(*params) |
| 47 | + deviated = gauss.rsample() |
| 48 | + outputs = Decoder(deviated) |
| 49 | + |
| 50 | +In this example, we demonstrate the use of a mixture of distributions using our library.:: |
| 51 | + |
| 52 | + import irt |
| 53 | + params = Encoder(inputs) |
| 54 | + mix = irt.Mixture([irt.Normal(*params), irt.Dirichlet(*params)]) |
| 55 | + deviated = mix.rsample() |
| 56 | + outputs = Decoder(deviated) |
| 57 | + |
| 58 | +Links |
| 59 | +========== |
| 60 | + |
| 61 | +- `LinkReview <https://github.com/intsystems/implitic-reparametrization-trick/blob/main/linkreview.md>`_ |
| 62 | +- `Plan of project <https://github.com/intsystems/implitic-reparametrization-trick/blob/main/planning.md>`_ |
0 commit comments