{"id":15757946,"url":"https://github.com/johnlk/multi_perceptron","last_synced_at":"2025-03-31T08:41:43.192Z","repository":{"id":91012774,"uuid":"185910560","full_name":"johnlk/Multi_Perceptron","owner":"johnlk","description":"Learning the NMIST dataset with a multilayered perceptron instead of the conventional CNN. ","archived":false,"fork":false,"pushed_at":"2019-05-13T02:57:53.000Z","size":25001,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T13:17:28.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnlk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-05-10T03:12:51.000Z","updated_at":"2019-06-01T21:49:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a188526-328d-435e-908f-4bb95ec97839","html_url":"https://github.com/johnlk/Multi_Perceptron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlk%2FMulti_Perceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlk%2FMulti_Perceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlk%2FMulti_Perceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlk%2FMulti_Perceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnlk","download_url":"https://codeload.github.com/johnlk/Multi_Perceptron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443435,"owners_count":20778244,"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-10-04T09:41:08.988Z","updated_at":"2025-03-31T08:41:43.169Z","avatar_url":"https://github.com/johnlk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MNIST Classifier with Multilayered Perceptron\nFor those of us who don't know, MNIST is a huge dataset of 60k handwritten digits all labeled. The trick is to give a computer a new handwritten digit and see if it can identify the digit it was given.\n\n![mnist-pic](https://upload.wikimedia.org/wikipedia/commons/2/27/MnistExamples.png)\n\n# Why Perceptron\n\n![rick-and-morty-meme](./img/rick-and-morty-meme.jpg)\n\nThe state of the art says a CNN can learn this dataset with something like \u003c 1% error. In fact, there is a tensorflow getting started tutorial where you build such a model. Using their models doesn't feel much like learning, but more like extra credit. \n\n![spongebob-meme](./img/spongebob-meme.jpg)\n\nThis is in part why I chose a perceptron. I know that I can manually implement such a model and see what's going on under the hood. I have followed the backpropogation example given by [3 blue 1 brown](https://youtu.be/Ilg3gGewQ5U) and built my model to have two hidden layers each with 16 neurons. The input layer are the grayscale images flattened out to a one dimensional 784 vector. Each image is 28 by 28 pixel so 784 pixels in total which have some sort of darkness to them from 0-1. \n\n![model-image](./img/model.png)\n\n# Success\nThe model, despite being a vanilla mulitilayered perceptron with sigmoid activations, learned this dataset with 89% accuracy after just 1500 epochs. Not bad.\n\nYou can run this program youself with this command:\n```\n$ python3.7 net.py\n```\nand can expect output like:\n\n![output](./img/output.png)\n\n# Future Work\nMaybe I'll experiment with simpler models with less hidden layer neurons. But this project seems like its wrapped up in a neat little bow. Make an issue if you feel like you'd like to see something else implemented. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlk%2Fmulti_perceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnlk%2Fmulti_perceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlk%2Fmulti_perceptron/lists"}