Update README.md
Browse files
README.md
CHANGED
|
@@ -2,8 +2,70 @@
|
|
| 2 |
tags:
|
| 3 |
- model_hub_mixin
|
| 4 |
- pytorch_model_hub_mixin
|
|
|
|
| 5 |
---
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 8 |
- Library: [More Information Needed]
|
| 9 |
- Docs: [More Information Needed]
|
|
|
|
| 2 |
tags:
|
| 3 |
- model_hub_mixin
|
| 4 |
- pytorch_model_hub_mixin
|
| 5 |
+
license: mit
|
| 6 |
---
|
| 7 |
|
| 8 |
+
# ImageGenerationTAU: Autoencoder for MNIST Image Generation
|
| 9 |
+
|
| 10 |
+
## Model Details
|
| 11 |
+
|
| 12 |
+
- **Model Architecture:** Convolutional Autoencoder
|
| 13 |
+
- **Framework:** PyTorch
|
| 14 |
+
- **Input Shape:** (1, 28, 28) (Grayscale MNIST Images)
|
| 15 |
+
- **Latent Dimension:** User-defined (`hidden_dim`)
|
| 16 |
+
- **Dataset:** [MNIST Handwritten Digits](http://yann.lecun.com/exdb/mnist/)
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
The **ImageGenerationTAU** model is a **convolutional autoencoder** designed for **image generation and feature extraction** from MNIST. It consists of:
|
| 21 |
+
- An **encoder** that compresses the input image into a **low-dimensional representation**.
|
| 22 |
+
- A **decoder** that reconstructs the original image from the compressed representation.
|
| 23 |
+
|
| 24 |
+
This model can be used for **image denoising, feature learning, and generative tasks**.
|
| 25 |
+
|
| 26 |
+
## Training Details
|
| 27 |
+
|
| 28 |
+
- **Loss Function:** Smooth L1 Loss
|
| 29 |
+
- **Optimizer:** Adam
|
| 30 |
+
- **Batch Size:** 512
|
| 31 |
+
- **Number of Epochs:** TBD
|
| 32 |
+
- **Regularization:** Batch Normalization
|
| 33 |
+
|
| 34 |
+
### Model Architecture
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
class ImageGenerationTAU(nn.Module, PyTorchModelHubMixin):
|
| 38 |
+
def __init__(self, hidden_dim):
|
| 39 |
+
super(ImageGenerationTAU, self).__init__()
|
| 40 |
+
self.encoder = nn.Sequential(
|
| 41 |
+
nn.Conv2d(1, 64, kernel_size=3, stride=1, padding=1),
|
| 42 |
+
nn.MaxPool2d(kernel_size=2, stride=2),
|
| 43 |
+
nn.ReLU(),
|
| 44 |
+
nn.BatchNorm2d(64),
|
| 45 |
+
nn.Conv2d(64, 32, kernel_size=3, stride=1, padding=1),
|
| 46 |
+
nn.MaxPool2d(kernel_size=2, stride=2),
|
| 47 |
+
nn.ReLU(),
|
| 48 |
+
nn.BatchNorm2d(32),
|
| 49 |
+
nn.Flatten(),
|
| 50 |
+
nn.Linear(32 * 7 * 7, hidden_dim),
|
| 51 |
+
)
|
| 52 |
+
self.decoder = nn.Sequential(
|
| 53 |
+
nn.Linear(hidden_dim, 32 * 7 * 7),
|
| 54 |
+
nn.ReLU(),
|
| 55 |
+
nn.Unflatten(1, (32, 7, 7)),
|
| 56 |
+
nn.ConvTranspose2d(32, 64, kernel_size=2, stride=2),
|
| 57 |
+
nn.ReLU(),
|
| 58 |
+
nn.BatchNorm2d(64),
|
| 59 |
+
nn.ConvTranspose2d(64, 1, kernel_size=2, stride=2),
|
| 60 |
+
nn.Sigmoid(),
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
def forward(self, x):
|
| 64 |
+
x = self.encoder(x)
|
| 65 |
+
x = self.decoder(x)
|
| 66 |
+
return x
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
|
| 70 |
- Library: [More Information Needed]
|
| 71 |
- Docs: [More Information Needed]
|