{"id":16756339,"url":"https://github.com/mmz33/capsnet","last_synced_at":"2026-04-19T05:35:29.309Z","repository":{"id":112322881,"uuid":"152721210","full_name":"mmz33/CapsNet","owner":"mmz33","description":"A Tensorflow Implementation of Capsule Network","archived":false,"fork":false,"pushed_at":"2020-02-22T22:33:15.000Z","size":114389,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T17:28:12.528Z","etag":null,"topics":["capsule-network","cnn","computer-vision","neural-networks","tensorflow"],"latest_commit_sha":null,"homepage":"https://mmz33.github.io/Capsule-Networks/","language":"Python","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/mmz33.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,"zenodo":null}},"created_at":"2018-10-12T08:47:07.000Z","updated_at":"2020-07-11T01:58:27.000Z","dependencies_parsed_at":"2023-05-13T05:30:35.604Z","dependency_job_id":null,"html_url":"https://github.com/mmz33/CapsNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmz33/CapsNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmz33%2FCapsNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmz33%2FCapsNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmz33%2FCapsNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmz33%2FCapsNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmz33","download_url":"https://codeload.github.com/mmz33/CapsNet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmz33%2FCapsNet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31996445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["capsule-network","cnn","computer-vision","neural-networks","tensorflow"],"created_at":"2024-10-13T03:25:33.398Z","updated_at":"2026-04-19T05:35:29.304Z","avatar_url":"https://github.com/mmz33.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capsule Network\n\nThis repository represents a TensorFlow implementation of capsule network (CapsNet). For more details about CapsNet, you can check my [blog post](https://mmz33.github.io/Capsule-Networks/). you can also find [here](https://github.com/mmz33/CapsNet/blob/master/report/capsnet_seminar_report.pdf) a detailed report about this topic.\n\n## Files\n- `dataset.py`: loads the MNIST dataset using keras API\n- `capsnet.py`: represents CapsNet architecture and contains function to build it\n- `capsule_layer.py`: represents CapsNet layers which are mainly PrimaryCaps and DigitCaps layers\n- `engine.py`: it extracts parameters from the config, set up training and testing configuration, and implements them\n- `config.py`: represents a dict of parameters with a getter function\n- `main.py`: the main entry point\n- `utils.py`: contians some helping functions\n- `run_kaggle.py`: a script to run digit recognizer competition from kaggle\n\n## Training\n\nFor training, run `python3 main.py --train`. In `config.py`, you can specify your hyperparameters. `checkpoint_path` is the location where models/checkpoints are saved. `log` is the location where TensorFlow summaries are saved to be used later in Tensorboard for example. \n\n## Testing\n\nFor testing, you just need to run `python3 main.py --test`. This will load the model corresponding to the latest saved checkpoint.\n\n#### Kaggle Digit Recognizer\n\nIn addition, the code was tested on the test data provided in digit recognizer competition from Kaggle, which is also MNIST data. The score achieved was: `0.99500` which is `99.5%` accuracy.\n\n## Tensorboard\n\n#### Train\n\n\u003cimg width=\"1322\" alt=\"Screenshot 2020-02-21 at 22 51 21\" src=\"https://user-images.githubusercontent.com/17355283/75074810-c3b2fb00-54fc-11ea-8494-12f8f63e2466.png\"\u003e\n\n\n#### Reconstructed Images\n\n##### During training\n\u003cimg width=\"180\" height=\"180\" alt=\"train_3\" src=\"https://user-images.githubusercontent.com/17355283/75075144-7b480d00-54fd-11ea-8b7c-7944defaea93.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"train_9\" src=\"https://user-images.githubusercontent.com/17355283/75075457-235dd600-54fe-11ea-8dd7-fa6acc581fcc.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"train_0\" src=\"https://user-images.githubusercontent.com/17355283/75075461-23f66c80-54fe-11ea-9561-473408ed2a58.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"train_8\" src=\"https://user-images.githubusercontent.com/17355283/75075465-25c03000-54fe-11ea-8e9c-840665609289.png\"\u003e\n\n##### During validation\n\n\u003cimg width=\"180\" height=\"180\" alt=\"valid_1\" src=\"https://user-images.githubusercontent.com/17355283/75075578-6c158f00-54fe-11ea-98b1-a2c7cadf1396.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"valid_2\" src=\"https://user-images.githubusercontent.com/17355283/75075579-6cae2580-54fe-11ea-8de5-d6465bc0296d.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"valid_8\" src=\"https://user-images.githubusercontent.com/17355283/75075582-6f107f80-54fe-11ea-8810-19dd0ca7866f.png\"\u003e \u003cimg width=\"180\" height=\"180\" alt=\"valid_9\" src=\"https://user-images.githubusercontent.com/17355283/75075584-6fa91600-54fe-11ea-8e95-bb3992e00e98.png\"\u003e\n\n\n#### TF Graph\n![capsnet-tf-graph](https://user-images.githubusercontent.com/17355283/75074459-09bb8f00-54fc-11ea-9add-2e9830624da3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmz33%2Fcapsnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmz33%2Fcapsnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmz33%2Fcapsnet/lists"}