{"id":25794239,"url":"https://github.com/generic-matrix/neuron","last_synced_at":"2026-06-09T02:33:17.756Z","repository":{"id":150440305,"uuid":"179805595","full_name":"generic-matrix/Neuron","owner":"generic-matrix","description":"This is a neuron made using PHP -Reinforcement learning, weights and accuracy visualization ","archived":false,"fork":false,"pushed_at":"2019-11-26T06:53:53.000Z","size":242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T17:41:35.414Z","etag":null,"topics":["neuron","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/generic-matrix.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":"2019-04-06T08:05:57.000Z","updated_at":"2019-11-26T06:54:15.000Z","dependencies_parsed_at":"2023-04-09T03:00:22.439Z","dependency_job_id":null,"html_url":"https://github.com/generic-matrix/Neuron","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/generic-matrix/Neuron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generic-matrix%2FNeuron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generic-matrix%2FNeuron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generic-matrix%2FNeuron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generic-matrix%2FNeuron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generic-matrix","download_url":"https://codeload.github.com/generic-matrix/Neuron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generic-matrix%2FNeuron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34089328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["neuron","php"],"created_at":"2025-02-27T13:56:58.893Z","updated_at":"2026-06-09T02:33:17.750Z","avatar_url":"https://github.com/generic-matrix.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Neuron\nThis is a neuron made using PHP .\nthe linear.php will be made as a linear model , I encourage you to fork it .\nI have even attached canvasJS to get to visualize weights and the training accuracy in each neuron.\n\nRefer the functions :\n```$x_json=json_decode( '[\n  {\"input\": [0,1,0,1,0,1,0,1,0,0,1,0,1,0,1]},\n  {\"input\": [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1]},\n  {\"input\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\n  {\"input\": [0,1,0,1,0,1,0,1,0,1,0,1,0,1,0]},\n  {\"input\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},\n  {\"input\": [1,1,0,1,1,0,1,1,0,1,1,0,1,1,0]}\n]');\n\n$y_json=json_decode('[\n  {\"output\": 0},\n  {\"output\": 1},\n  {\"output\": 0},\n  {\"output\": 1},\n  {\"output\": 0},\n  {\"output\": 1}\n]');\n\n$mat=json_decode('{\n  \"input\": [2,2,2,2,2,0,0,0,0,0,0,0,0,0,0]\n}');\n\n$mat1=json_decode('{\n  \"input\": [1,1,0,1,1,0,1,1,0,1,1,0,1,1,0]\n}');\n\n$mat2=json_decode('{\n  \"input\": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n}');\n\n\n\n#New neuron \n$n1=new Neuron($x_json,0,1,\"sigmoid\");\n\n\n$n1-\u003elearn($x_json,$y_json,120,0);\n\nvar_dump(\"1 ---\u003e \".$n1-\u003epredict($mat-\u003einput));\nvar_dump(\"1 ---\u003e \".$n1-\u003epredict($mat1-\u003einput));\nvar_dump(\"0 ---\u003e \".$n1-\u003epredict($mat2-\u003einput));\n\n#We can get the weight's in the form of JSON ..very essencial for reinforcement learning.\n\nvar_dump($n1-\u003eget_image());\n\n\n$n1-\u003eplot_training();\n\n$n1-\u003eplot_weight();\n```\nISSUE:\n\n1) In neuron.php have a look at line 174 \n\n2)Linear model is not working as expected due to logical error for now.I encourage to fork it.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneric-matrix%2Fneuron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneric-matrix%2Fneuron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneric-matrix%2Fneuron/lists"}