{"id":21281220,"url":"https://github.com/m-rishab/monotype-assignment","last_synced_at":"2025-10-17T12:30:15.314Z","repository":{"id":252382254,"uuid":"840276849","full_name":"m-rishab/Monotype-Assignment","owner":"m-rishab","description":"This project implements a Generative Adversarial Network (GAN) to generate images of cats. The GAN architecture consists of a Generator and a Discriminator, both implemented using PyTorch. The model is trained on a dataset of cat images, and the performance is monitored through the convergence of the training and validation loss.","archived":false,"fork":false,"pushed_at":"2024-08-09T11:00:06.000Z","size":24852,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T04:21:46.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-rishab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T10:50:08.000Z","updated_at":"2024-08-09T11:00:09.000Z","dependencies_parsed_at":"2024-08-09T12:16:33.999Z","dependency_job_id":"53536eb8-80ab-4bc6-894f-e9f081a6f1ea","html_url":"https://github.com/m-rishab/Monotype-Assignment","commit_stats":null,"previous_names":["m-rishab/monotype-assignment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-rishab%2FMonotype-Assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-rishab%2FMonotype-Assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-rishab%2FMonotype-Assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-rishab%2FMonotype-Assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-rishab","download_url":"https://codeload.github.com/m-rishab/Monotype-Assignment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243738968,"owners_count":20340003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T10:46:07.458Z","updated_at":"2025-10-17T12:30:15.240Z","avatar_url":"https://github.com/m-rishab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monotype-Assignment\nThis project implements a Generative Adversarial Network (GAN) to generate images of cats. The GAN architecture consists of a Generator and a Discriminator, both implemented using PyTorch. The model is trained on a dataset of cat images, and the performance is monitored through the convergence of the training and validation loss.\n\n## Dataset\n\nThe model is trained on a dataset of cat images. You can use the [Cat Dataset from Kaggle](https://www.kaggle.com/datasets/spandan2/cats-faces-64x64-for-generative-models/data), or any other dataset of your choice.\nThe dataset should be structured in a way that the images are stored in folders, which is suitable for the `ImageFolder` class in PyTorch.\n\n## Model Architecture\n\n### Generator\n\nThe Generator is designed to take random noise as input and generate a 64x64 RGB image. The architecture includes several transposed convolutional layers, batch normalization, and ReLU activation.\n\n### Discriminator\n\nThe Discriminator is a binary classifier that takes an image as input and outputs a probability that the image is real or fake. The architecture includes several convolutional layers, batch normalization, and LeakyReLU activation.\n\n### Enhancements\n\n- **Spectral Normalization**: Applied to the Discriminator to stabilize training.\n- **Dropout**: Added to the Generator to prevent overfitting and improve the diversity of generated images.\n- **Label Smoothing**: Used for the real labels to make the Discriminator less confident, helping the Generator learn more effectively.\n\n## Training\n\nThe model is trained for a maximum of 10 epochs. The training process involves alternating updates to the Discriminator and Generator. Losses for both models are monitored and plotted to evaluate the performance.\n\n## Generated Images\n\u003cimg width=\"695\" alt=\"Screenshot 2024-08-09 at 4 29 02 PM\" src=\"https://github.com/user-attachments/assets/6794c1e3-312d-43ed-8c8f-72547fa28f94\"\u003e\n\n\n```python\n# Key Training Parameters\nbatch_size = 128\nimage_size = 64\nnz = 100  # Size of the latent z vector (input to generator)\nngf = 64  # Size of feature maps in generator\nndf = 64  # Size of feature maps in discriminator\nnum_epochs = 11\nlr = 0.0002\nbeta1 = 0.5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-rishab%2Fmonotype-assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-rishab%2Fmonotype-assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-rishab%2Fmonotype-assignment/lists"}