{"id":27641274,"url":"https://github.com/felixsoderstrom/perceptron-for-ocr","last_synced_at":"2025-04-23T23:43:03.093Z","repository":{"id":288392964,"uuid":"967243210","full_name":"FelixSoderstrom/Perceptron-for-OCR","owner":"FelixSoderstrom","description":"Training an AI model to recognize handwritten digits","archived":false,"fork":false,"pushed_at":"2025-04-17T07:49:14.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"part-1","last_synced_at":"2025-04-17T22:28:00.544Z","etag":null,"topics":["ai","backpropagation","machine-learning","neural-network","numpy","pytorch"],"latest_commit_sha":null,"homepage":"","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/FelixSoderstrom.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":"2025-04-16T06:41:47.000Z","updated_at":"2025-04-17T07:49:18.000Z","dependencies_parsed_at":"2025-04-23T23:43:00.636Z","dependency_job_id":null,"html_url":"https://github.com/FelixSoderstrom/Perceptron-for-OCR","commit_stats":null,"previous_names":["felixsoderstrom/perceptron-for-ocr"],"tags_count":null,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixSoderstrom%2FPerceptron-for-OCR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixSoderstrom%2FPerceptron-for-OCR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixSoderstrom%2FPerceptron-for-OCR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixSoderstrom%2FPerceptron-for-OCR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FelixSoderstrom","download_url":"https://codeload.github.com/FelixSoderstrom/Perceptron-for-OCR/tar.gz/refs/heads/part-1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535062,"owners_count":21446503,"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":["ai","backpropagation","machine-learning","neural-network","numpy","pytorch"],"created_at":"2025-04-23T23:42:57.220Z","updated_at":"2025-04-23T23:43:02.470Z","avatar_url":"https://github.com/FelixSoderstrom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Perceptron for OCR\n\n### Overview\nThis repository holds the entire perceptron project.\nThe plan is to build a neural network that can identify handwritten digits (the MNIST dataset).\nIn order to reach the final level of this project it has been divided into three parts.\nEach part representing an increase in complexity with their own respective branch.\nWe start out small with a single neuron built in a basic python class.\nWe end up with a neural network that can solve the \"Hello World\" of machine learning!\n\n\n## Part 1 (branch: part-1)\n\n### Single Neuron\n\nClass that represents a single neuron.\nUpon instantialization, the neuron will automatically set random weights and bias.\nThe neuron defaults to sigmoid activation but covers relu, leaky relu and tanh aswell.\nWhen using the main/pipeline scripts, all activations will be outputted on the same instance.\nWhile we could indeed do machine learning on a single neuron, it wouldnt be able to tell me what digit it is.\nIt could only tell me if the inputted image was the number we trained it on.\nThis is why I wont be applying any form of back propagation to this version.\nBut I might come back and do that actually, just because it seems like a really dumb thing to do!\n\n### Numpy\n\nThis, like the single neuron class, is a basic implementation of a perceptron.\nThis class however is a network consisting of several layers that represents the flattened image.\nThis class therefore takes a test image from the dataset as an input for prediction.\nSince the network is not learned it will more or less output random numbers.\nBut this implementation shows that the image passes through the network and comes out as a prediction.\n\n### PyTorch\n\nThis implementation takes the previous numpy implementation and converts it into a pytorch model.\nWe still feed it one image from the test set and the model spits out a prediction.\nThe difference here is that this version allows for backprop and can actually learn.\nThe program comes with a pre-learned model. To re-learn the model, delete the '/checkpoints/checkpoint_epoch_10.pth' file and then simply run 'python main.py' in the terminal.\nAll variables for the machine learning process are configurable through the 'pytorch_pipeline.py' file.\nThe current config:\n- 10 Epochs\n- ADAM Optimizer\n- 0.001 Learning Rate\n- Cross Entropy Loss\n- Prioritizes GPU usage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixsoderstrom%2Fperceptron-for-ocr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixsoderstrom%2Fperceptron-for-ocr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixsoderstrom%2Fperceptron-for-ocr/lists"}