{"id":20581166,"url":"https://github.com/peterakande/multilayerperceptron","last_synced_at":"2025-08-26T09:07:52.531Z","repository":{"id":158123722,"uuid":"311305545","full_name":"PeterAkande/MultilayerPerceptron","owner":"PeterAkande","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-24T19:39:07.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T12:16:10.708Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterAkande.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":"2020-11-09T10:41:20.000Z","updated_at":"2021-11-20T07:11:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"69e05145-2604-4d25-b3d4-99777216b35f","html_url":"https://github.com/PeterAkande/MultilayerPerceptron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PeterAkande/MultilayerPerceptron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterAkande%2FMultilayerPerceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterAkande%2FMultilayerPerceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterAkande%2FMultilayerPerceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterAkande%2FMultilayerPerceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterAkande","download_url":"https://codeload.github.com/PeterAkande/MultilayerPerceptron/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterAkande%2FMultilayerPerceptron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272200572,"owners_count":24890816,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"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":[],"created_at":"2024-11-16T06:27:21.096Z","updated_at":"2025-08-26T09:07:52.484Z","avatar_url":"https://github.com/PeterAkande.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# MultilayerPerceptron\nJust Got up and Decided to clear the drought of repositories on my GitHub page.\nIt Works on the principle of Back Propagation (All MLPs Do 😂), the ouput layer is Made up of Stacked Sigmoids...Lazy to adapt it to Softmax 😪.\nThe network is initialized with the training set and the accompanying labels and  list, whose length connotes the amount of layers and the value of each layer index in the list denotes the amount of nodes that particular  layer should have,also a one_hot parameter ,that is by  default  set  to false...But can be Set to True if labels are already one_hot_encoded.\nThe first layer of the list to be passed should be the Number of features and the last item of the list should be the amount of classes.\n\n```python\n#Example usage\n\n#Import class\n\nfrom MultilayerPerceptron import MLP\n\n...\n...\n\n#Your preferred\n\n#Preprocessing Technique\n#And Loading Of Data\n\n\nLayers=[60,40,20,10]\n\n\n\"\"\"The MLP\nhas 2 hidden Layers,len(Layers)-2.\nfirst item of Layers,60,is the amount of\nfeatures in each instance of training data\nLast item of Layers\n10, is number of classes\"\"\"\n\n\nn=MLP(Layers)\n\nn.train(data,labels, epochs,batchsize,l_r,one_hot=True)\n\n#l_r is the learning_rate\n\n#save weights with save_weights function\n\nn.save_weights(weights_path,bias_path)\n\nn.load_weights(weights_path,bias_path)\n\n\"\"\"\nLoad weights from disk. load_weights is\nwrapped with classmethod decorator\nso after weights and bias has been\nsaved with n.save_weights(...) ....The weights can\nthen be used to make predictions for a later time\nWithout initializing the layers...E.g \nn=MLP.load_weights(...)\"\"\"\n\nn.predict(data)\n\"\"\"\nn.predict(data) can then be used to\nmake predictions...\n\n😄\"\"\"\n```\n\nThe utils function is mainly for preprocessing\nSome functions included are:\n\n(1). Standardization :::utils.norm(mat), it returns the transformed dataset, the std learned and the mean\n,Which can then be used on the test set by using utils.norm_test(mat,std,mean)\n\n(2). Min-Max Scaling::utils.min_max(mat),it returns the transformed dataset,the min, and the range.\n,Which can then be used on the test set by using utils.min_max_test(mat,mins,_range)\n\n###PCA and whitening should be added soon\n\n\n\nWould write a blog post on how MLPs work, using this repo as reference, soon..\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterakande%2Fmultilayerperceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterakande%2Fmultilayerperceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterakande%2Fmultilayerperceptron/lists"}