{"id":13484228,"url":"https://github.com/tangledpath/ruby-fann","last_synced_at":"2025-05-15T17:01:29.685Z","repository":{"id":7674026,"uuid":"9036378","full_name":"tangledpath/ruby-fann","owner":"tangledpath","description":"Ruby library for interfacing with FANN (Fast Artificial Neural Network)","archived":false,"fork":false,"pushed_at":"2024-03-25T08:19:23.000Z","size":2568,"stargazers_count":502,"open_issues_count":2,"forks_count":42,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-03T06:08:09.530Z","etag":null,"topics":["ai","c","fann","machine-learning","native","neural-network","neural-networks","nn","ruby-fann","ruby-gem","rubygems"],"latest_commit_sha":null,"homepage":"https://github.com/tangledpath/ruby-fann","language":"C","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/tangledpath.png","metadata":{"files":{"readme":"README.md","changelog":"History.txt","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2013-03-26T17:44:46.000Z","updated_at":"2025-03-12T11:21:56.000Z","dependencies_parsed_at":"2024-01-08T17:14:27.058Z","dependency_job_id":"e4ad476a-9e90-44c7-8ce8-dd1a6a3d5eb2","html_url":"https://github.com/tangledpath/ruby-fann","commit_stats":{"total_commits":41,"total_committers":8,"mean_commits":5.125,"dds":0.3414634146341463,"last_synced_commit":"dcb00f1df80b7d55929934cfc0604dc2590ed101"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledpath%2Fruby-fann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledpath%2Fruby-fann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledpath%2Fruby-fann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tangledpath%2Fruby-fann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tangledpath","download_url":"https://codeload.github.com/tangledpath/ruby-fann/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489049,"owners_count":21112490,"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","c","fann","machine-learning","native","neural-network","neural-networks","nn","ruby-fann","ruby-gem","rubygems"],"created_at":"2024-07-31T17:01:21.009Z","updated_at":"2025-04-11T22:28:18.713Z","avatar_url":"https://github.com/tangledpath.png","language":"C","funding_links":[],"categories":["C","Scientific","Machine Learning","Machine Learning Libraries"],"sub_categories":["Text-to-Speech-to-Text","Neural networks"],"readme":"# RubyFann\n_Fast_ **AI**\n\n\n---\nNeural Networks in `ruby`\n\n[![Gem Version](https://badge.fury.io/rb/ruby-fann.png)](http://badge.fury.io/rb/ruby-fann)\n\n![NN eye candy](ruby-fann.png)\n\n\nRubyFann, or \"ruby-fann\" is a Ruby Gem (no Rails required) that binds to FANN (Fast Artificial Neural Network) from within a ruby/rails environment.  FANN is a is a free native open source neural network library, which implements multilayer artificial neural networks, supporting both fully-connected and sparsely-connected networks.  It is easy to use, versatile, well documented, and fast.  `RubyFann` makes working with neural networks a breeze using `ruby`, with the added benefit that most of the heavy lifting is done natively.\n\nA talk given by our friend Ethan from Big-Oh Studios at Lone Star Ruby 2013: http://confreaks.com/videos/2609-lonestarruby2013-neural-networks-with-rubyfann\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'ruby-fann'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install ruby-fann\n\n## Usage\n\nFirst, Go here \u0026 read about FANN. You don't need to install it before using the gem, but understanding FANN will help you understand what you can do with the ruby-fann gem:\nhttp://leenissen.dk/fann/\n\n## Documentation:\n*ruby-fann documentation:*\nhttp://tangledpath.github.io/ruby-fann/index.html\n\n\n\n### Example training \u0026 subsequent execution:\n\n```ruby\n  require 'ruby-fann'\n  train = RubyFann::TrainData.new(:inputs=\u003e[[0.3, 0.4, 0.5], [0.1, 0.2, 0.3]], :desired_outputs=\u003e[[0.7], [0.8]])\n  fann = RubyFann::Standard.new(:num_inputs=\u003e3, :hidden_neurons=\u003e[2, 8, 4, 3, 4], :num_outputs=\u003e1)\n  fann.train_on_data(train, 1000, 10, 0.1) # 1000 max_epochs, 10 errors between reports and 0.1 desired MSE (mean-squared-error)\n  outputs = fann.run([0.3, 0.2, 0.4])\n```\n\n### Save training data to file and use it later (continued from above)\n\n```ruby\n  train.save('verify.train')\n  train = RubyFann::TrainData.new(:filename=\u003e'verify.train')\n  # Train again with 10000 max_epochs, 20 errors between reports and 0.01 desired MSE (mean-squared-error)\n  # This will take longer:\n  fann.train_on_data(train, 10000, 20, 0.01)\n```\n\n### Save trained network to file and use it later (continued from above)\n\n```ruby\n  fann.save('foo.net')\n  saved_nn = RubyFann::Standard.new(:filename=\u003e\"foo.net\")\n  saved_nn.run([0.3, 0.2, 0.4])\n```\n\n### Custom training using a callback method\n\nThis callback function can be called during training when using train_on_data, train_on_file or cascadetrain_on_data.\n\nIt is very useful for doing custom things during training.  It is recommended to use this function when implementing custom training procedures, or when visualizing the training in a GUI etc.  The args which the callback function takes is the parameters given to the train_on_data, plus an epochs parameter which tells how many epochs the training have taken so far.\n\nThe callback method should return an integer, if the callback function returns -1, the training will terminate.\n\nThe callback (training_callback) will be automatically called if it is implemented on your subclass as follows:\n\n```ruby\nclass MyFann \u003c RubyFann::Standard\n  def training_callback(args)\n    puts \"ARGS: #{args.inspect}\"\n    0\n  end\nend\n```\n### A sample project using RubyFann to play tic-tac-toe\nhttps://github.com/bigohstudios/tictactoe\n\n## Contributors\n1. Steven Miers\n2. Ole Krüger\n3. dignati\n4. Michal Pokorny\n5. Scott Li (locksley)\n6. alex.slotty\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 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangledpath%2Fruby-fann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftangledpath%2Fruby-fann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftangledpath%2Fruby-fann/lists"}