{"id":15667770,"url":"https://github.com/holsee/nnex","last_synced_at":"2025-03-30T04:26:40.099Z","repository":{"id":68408973,"uuid":"42721812","full_name":"holsee/NNex","owner":"holsee","description":"Neural Network in Elixir","archived":false,"fork":false,"pushed_at":"2015-09-18T12:49:33.000Z","size":116,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T06:44:46.087Z","etag":null,"topics":["elixir","neural-network"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/holsee.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}},"created_at":"2015-09-18T12:49:22.000Z","updated_at":"2017-06-16T20:39:08.000Z","dependencies_parsed_at":"2023-03-04T01:11:01.034Z","dependency_job_id":null,"html_url":"https://github.com/holsee/NNex","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/holsee%2FNNex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holsee%2FNNex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holsee%2FNNex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holsee%2FNNex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holsee","download_url":"https://codeload.github.com/holsee/NNex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277299,"owners_count":20751545,"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":["elixir","neural-network"],"created_at":"2024-10-03T14:05:16.094Z","updated_at":"2025-03-30T04:26:40.081Z","avatar_url":"https://github.com/holsee.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"NNex\n====\n\nA Neural Network prototype in Elixir (Under development)\n\n\nUsed as part of my [Transcendence in Erlang Talk](https://docs.google.com/presentation/d/1AGYBEL8Ng3VWc_WiHhjs4MrMFdn3gGsuNxYShS1BxL0/edit?usp=sharing), to demonstrate how Erlang processes can represent Neurons in an elegant way.\n\nAll Neurons (nodes) at present are ```GenServers``` with  ```SimpleNeuron``` struct state.\n\n- Input Nodes: detected as they do not have any registered in connections therefore forward sensor input.\n- Hidden Nodes: use hyperbolic tangent activation function + wait for 1 input from each in node before becoming activated.\n- Output Nodes (not implemented): can be detected the same way as input neurons are, but will apply Softmax activation function.\n\n## Example\n\nSimple Feed Forward Demo:\n\n``` elixir\n# Create our neurons\n{:ok, n1} = SimpleNeuron.start_link()\n{:ok, n2} = SimpleNeuron.start_link()\n{:ok, n3} = SimpleNeuron.start_link()\n{:ok, n4} = SimpleNeuron.start_link([bias: 0.13])\n# Create the synaptic connections\nSimpleNeuron.connect(n1, n4, 0.01)\nSimpleNeuron.connect(n2, n4, 0.05)\nSimpleNeuron.connect(n3, n4, 0.09)\n# Trigger input neurons\nSimpleNeuron.signal(n1, 1)\nSimpleNeuron.signal(n2, 2)\nSimpleNeuron.signal(n3, 3)\n```\n\n``` shell\n$ iex -S mix \n\nex(1)\u003e Nnex.example\n\n13:41:07.418 [debug] Creating node with bias: 0.13\n\n13:41:07.418 [info]  \u003c0.91.0\u003e Received signal 1 from \u003c0.89.0\u003e input sensor\n\n13:41:07.421 [info]  \u003c0.92.0\u003e Received signal 2 from \u003c0.89.0\u003e input sensor\n\n13:41:07.426 [info]  \u003c0.93.0\u003e Received signal 3 from \u003c0.89.0\u003e input sensor\n\n13:41:07.426 [info]  \u003c0.91.0\u003e sending value 1 to [\u003c0.94.0\u003e]\n\n13:41:07.430 [info]  \u003c0.92.0\u003e sending value 2 to [\u003c0.94.0\u003e]\n\n13:41:07.430 [info]  \u003c0.93.0\u003e sending value 3 to [\u003c0.94.0\u003e]\n\n13:41:07.430 [info]  \u003c0.94.0\u003e Received signal 1 from \u003c0.91.0\u003e with connection weight 0.01\n\n13:41:07.430 [info]  \u003c0.94.0\u003e Received signal 2 from \u003c0.92.0\u003e with connection weight 0.05\n\n13:41:07.430 [info]  \u003c0.94.0\u003e Received signal 3 from \u003c0.93.0\u003e with connection weight 0.09\n\n13:41:07.430 [info]  \u003c0.94.0\u003e ACTIVATED!\n\n13:41:07.430 [info]  Apply weight: 0.09 to value: 3\n\n13:41:07.430 [info]  Apply weight: 0.05 to value: 2\n\n13:41:07.430 [info]  Apply weight: 0.01 to value: 1\n\n13:41:07.430 [info]  Apply weight: 1 to value: 0.13\n\n13:41:07.431 [info]  \u003c0.94.0\u003e sending value 0.46994519893303766 to []\n```\n\n```0.46994519893303766``` represents the value node 4 computed from 3 input nodes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholsee%2Fnnex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholsee%2Fnnex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholsee%2Fnnex/lists"}