Skip to content

Commit 55ce7c6

Browse files
Update README.rst
1 parent d4f494a commit 55ce7c6

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

README.rst

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Scope
2424
==========
2525

2626
We plan to implement the following distributions in our library:
27+
2728
- `Gaussian normal distribution`
2829
- `Dirichlet distribution (Beta distributions)`
2930
- `Sampling from a mixture of distributions`
@@ -38,23 +39,24 @@ We plan to inherit from the torch.distribution.Distribution class, so we need to
3839
Usage
3940
==========
4041

41-
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.
42-
```
43-
>>> import torch.distributions.implicit as irt
44-
>>> params = Encoder(inputs)
45-
>>> gauss = irt.Normal(*params)
46-
>>> deviated = gauss.rsample()
47-
>>> outputs = Decoder(deviated)
48-
```
49-
In this example, we demonstrate the use of a mixture of distributions using our library.
50-
```
51-
>>> import irt
52-
>>> params = Encoder(inputs)
53-
>>> mix = irt.Mixture([irt.Normal(*params), irt.Dirichlet(*params)])
54-
>>> deviated = mix.rsample()
55-
>>> outputs = Decoder(deviated)
56-
```
57-
58-
## Links
59-
- [LinkReview](https://github.com/intsystems/implitic-reparametrization-trick/blob/main/linkreview.md)
60-
- [Plan of project](https://github.com/intsystems/implitic-reparametrization-trick/blob/main/planning.md)
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

Comments
 (0)