{"id":25314897,"url":"https://github.com/viliusluneckas/brainz","last_synced_at":"2025-07-04T21:34:24.614Z","repository":{"id":2641249,"uuid":"3630683","full_name":"ViliusLuneckas/brainz","owner":"ViliusLuneckas","description":"Artificial Neural Network library written in Ruby","archived":false,"fork":false,"pushed_at":"2019-07-12T18:30:53.000Z","size":34,"stargazers_count":10,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-18T16:19:46.187Z","etag":null,"topics":["artificial-neural-networks","neural-network","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ViliusLuneckas.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}},"created_at":"2012-03-05T19:44:28.000Z","updated_at":"2023-05-03T19:38:12.000Z","dependencies_parsed_at":"2022-08-29T06:50:46.322Z","dependency_job_id":null,"html_url":"https://github.com/ViliusLuneckas/brainz","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViliusLuneckas%2Fbrainz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViliusLuneckas%2Fbrainz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViliusLuneckas%2Fbrainz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ViliusLuneckas%2Fbrainz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ViliusLuneckas","download_url":"https://codeload.github.com/ViliusLuneckas/brainz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238701686,"owners_count":19516203,"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":["artificial-neural-networks","neural-network","ruby"],"created_at":"2025-02-13T17:38:59.312Z","updated_at":"2025-02-13T17:38:59.996Z","avatar_url":"https://github.com/ViliusLuneckas.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brainz\n\nArtificial Neural Network Library written in Ruby.\n\n## Supported training algorithms\n\n* Backpropagation\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'brainz'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install brainz\n\n## Usage\n\n### Simple example, logical AND operation\n\n    require 'brainz'\n    \n    brainz = Brainz::Brainz.new\n    \n    brainz.teach do |iteration, error|\n      that(1, 1).is(1)\n      that(1, 0).is(0)\n      that(0, 1).is(0)\n      that(0, 0).is(0)\n      p \"error_rate = #{'%.3f' % error || 0 } after #{iteration} iterations\" if iteration % 10 == 0\n    end\n    \n    puts \"0 and 0 = #{brainz.guess(a: 0, b: 0)}\"\n    puts \"0 and 1 = #{brainz.guess(a: 0, b: 1)}\"\n    puts \"1 and 1 = #{brainz.guess(a: 1, b: 1)}\"\n    puts \"1 and 0 = #{brainz.guess(a: 1, b: 0)}\"\n\n### Advanced usage, ligical XOR operation\n\n    require 'brainz'\n\n    brainz = Brainz::Brainz.new\n    \n    # specify number of hidden layers\n    # 3 hidden layers with 4, 7 and 3 neurons\n    brainz.num_hidden = [4, 7, 3]\n    \n    # tune learning parameters: learning_rate, momentum, wanted_error (mse)\n    brainz.teach(learning_rate: 0.2, momentum: 0.05, wanted_error: 0.01) do |iteration, error|\n      that(1, 1).is(0)\n      that(1, 0).is(1)\n      that(0, 1).is(1)\n      that(0, 0).is(0)\n    end\n\n    puts \"Learning took #{brainz.last_iterations}, error: #{brainz.error}, time: #{brainz.learning_time} s.\"\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n6. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviliusluneckas%2Fbrainz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviliusluneckas%2Fbrainz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviliusluneckas%2Fbrainz/lists"}