Update README.md
Browse files
README.md
CHANGED
|
@@ -9,33 +9,43 @@ language:
|
|
| 9 |
|
| 10 |
tags:
|
| 11 |
- autoencoder
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
tags:
|
| 11 |
- autoencoder
|
| 12 |
+
---
|
| 13 |
|
| 14 |
+
# VAE trained on Banking 77 Open Intent Classification Dataset
|
| 15 |
+
This is a Variational Autoencoder (VAE) trained on the [PolyAI/banking77](https://huggingface.co/datasets/PolyAI/banking77) dataset.
|
| 16 |
+
|
| 17 |
+
### Architecture
|
| 18 |
+
- **input_dim**: 768
|
| 19 |
+
- **hidden_dim**: 256
|
| 20 |
+
- **latent_dim**: 64
|
| 21 |
+
|
| 22 |
+
#### Encoder
|
| 23 |
+
The encoder maps the input to a latent space distribution.
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
encoder = nn.Sequential(
|
| 27 |
+
nn.Linear(input_dim, hidden_dim),
|
| 28 |
+
nn.ReLU()
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
+
mu = nn.Linear(hidden_dim, latent_dim)
|
| 32 |
+
logvar = nn.Linear(hidden_dim, latent_dim)
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
#### Decoder
|
| 36 |
+
The decoder reconstructs the input from a sample of the latent space.
|
| 37 |
+
|
| 38 |
+
```python
|
| 39 |
+
decoder = nn.Sequential(
|
| 40 |
+
nn.Linear(latent_dim, hidden_dim),
|
| 41 |
+
nn.ReLU(),
|
| 42 |
+
nn.Linear(hidden_dim, input_dim)
|
| 43 |
+
)
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
#### Metrics
|
| 47 |
+
The model was trained and evaluated using the following metrics:
|
| 48 |
+
1. Training set: VAE Loss
|
| 49 |
+
* 50% reconstruction loss between original input vs reconstructed output
|
| 50 |
+
* 50% KL divergence between Latent Z vs standard normal distribution
|
| 51 |
+
2. Validation set: 100% reconstruction loss -> used to find the best model (with the lowest reconstruction loss)
|