Skip to content

add vonmises and edit readme #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .ipynb_checkpoints/README-checkpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Implicit Reparametrization Trick

<div align="center">
<img src="images/implicit.webp" width="500px" />
</div>


<table>
<tr>
<td align="left"> <b> Title </b> </td>
<td> Implicit Reparametrization Trick for BMM </td>
</tr>
<tr>
<td align="left"> <b> Authors </b> </td>
<td> Matvei Kreinin, Maria Nikitina, Petr Babkin, Iryna Zabarianska </td>
</tr>
<tr>
<td align="left"> <b> Consultant </b> </td>
<td> Oleg Bakhteev, PhD </td>
</tr>
</table>


![Testing](https://github.com/intsystems/implicit-reparameterization-trick/actions/workflows/testing.yml/badge.svg)
![Docs](https://github.com/intsystems/implicit-reparameterization-trick/actions/workflows/docs.yml/badge.svg)


## Description

This repository implements an educational project for the Bayesian Multimodeling course. It implements algorithms for sampling from various distributions, using the implicit reparameterization trick.

## Scope
We plan to implement the following distributions in our library:
- [x] Gaussian normal distribution (*)
- [x] Dirichlet distribution (Beta distributions)(\*)
- [x] Mixture of the same family distributions (**)
- [x] Student's t-distribution (**) (\*)
- [x] VonMises distribution (***)
- [ ] Sampling from an arbitrary factorized distribution (***)

(\*) - this distribution is already implemented in torch using the explicit reparameterization trick, we will implement it for comparison

(\*\*) - this distribution is added as a backup, their inclusion is questionable

(\*\*\*) - this distribution is not very clear in implementation, its inclusion is questionable

## Stack

We plan to inherit from the torch.distribution.Distribution class, so we need to implement all the methods that are present in that class.

## Usage
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.
```
>>> import torch.distributions.implicit as irt
>>> params = Encoder(inputs)
>>> gauss = irt.Normal(*params)
>>> deviated = gauss.rsample()
>>> outputs = Decoder(deviated)
```
In this example, we demonstrate the use of a mixture of distributions using our library.
```
>>> import irt
>>> params = Encoder(inputs)
>>> mix = irt.Mixture([irt.Normal(*params), irt.Dirichlet(*params)])
>>> deviated = mix.rsample()
>>> outputs = Decoder(deviated)
```

## Links
- [LinkReview](https://github.com/intsystems/implitic-reparametrization-trick/blob/main/linkreview.md)
- [Plan of project](https://github.com/intsystems/implitic-reparametrization-trick/blob/main/planning.md)
- [BlogPost](blogpost/Blog_post_sketch.pdf)
- [Documentation](https://intsystems.github.io/implicit-reparameterization-trick/)
- [Matvei Kreinin](https://github.com/kreininmv), [Maria Nikitina](https://github.com/NikitinaMaria), [Petr Babkin](https://github.com/petr-parker), [Iryna Zabarianska](https://github.com/Akshiira)

18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Implicit Reparametrization Trick

<div align="center">
<img src="images/implicit.webp" width="500px" />
</div>


<table>
<tr>
<td align="left"> <b> Title </b> </td>
Expand All @@ -15,6 +20,7 @@
</tr>
</table>


![Testing](https://github.com/intsystems/implicit-reparameterization-trick/actions/workflows/testing.yml/badge.svg)
![Docs](https://github.com/intsystems/implicit-reparameterization-trick/actions/workflows/docs.yml/badge.svg)

Expand All @@ -25,11 +31,12 @@ This repository implements an educational project for the Bayesian Multimodeling

## Scope
We plan to implement the following distributions in our library:
- Gaussian normal distribution (*)
- Dirichlet distribution (Beta distributions)(\*)
- Sampling from a mixture of distributions
- Sampling from the Student's t-distribution (**) (\*)
- Sampling from an arbitrary factorized distribution (***)
- [x] Gaussian normal distribution (*)
- [x] Dirichlet distribution (Beta distributions)(\*)
- [x] Mixture of the same family distributions (**)
- [x] Student's t-distribution (**) (\*)
- [x] VonMises distribution (***)
- [ ] Sampling from an arbitrary factorized distribution (***)

(\*) - this distribution is already implemented in torch using the explicit reparameterization trick, we will implement it for comparison

Expand Down Expand Up @@ -64,4 +71,5 @@ In this example, we demonstrate the use of a mixture of distributions using our
- [Plan of project](https://github.com/intsystems/implitic-reparametrization-trick/blob/main/planning.md)
- [BlogPost](blogpost/Blog_post_sketch.pdf)
- [Documentation](https://intsystems.github.io/implicit-reparameterization-trick/)
- [Matvei Kreinin](https://github.com/kreininmv), [Maria Nikitina](https://github.com/NikitinaMaria), [Petr Babkin](https://github.com/petr-parker), [Iryna Zabarianska](https://github.com/Akshiira)

Loading
Loading