← all repositories
tangledpath/ruby-fann

Neural nets for Rubyists who'd rather not write C

A thin, friendly wrapper around FANN that keeps the native speed while letting you stay in Ruby syntax.

506 stars C ML Frameworks
ruby-fann
Velocity · 7d
+0.1
★ / day
Trend
steady
star history

What it does

RubyFann is a Ruby gem that binds to FANN (Fast Artificial Neural Network), a C library for multilayer neural networks. You define your network, train it, save it to disk, and run inference—all without leaving Ruby. The heavy lifting stays in native code; your code stays readable.

The interesting bit

The callback hook is the quiet gem here. Subclass RubyFann::Standard, implement training_callback, and you get an epoch-by-epoch hook that can log progress, update a GUI, or abort training early by returning -1. It’s a small door that opens into custom training loops without dropping down to C.

Key highlights

  • Supports fully-connected and sparsely-connected networks
  • Save/load both training data and trained networks to disk
  • Custom training callbacks via subclassing
  • No Rails dependency; plain Ruby gem
  • Underlying FANN library handles the native computation

Caveats

  • The README is sparse on architecture details; you’ll need to read the FANN docs to understand what network types and training algorithms are available
  • Last major activity appears to be around 2013 based on the referenced conference talk
  • The ruby-fann.png “eye candy” is the only visual; no architecture diagrams or benchmark charts

Verdict

Worth a look if you’re already in Ruby and need a neural net without the TensorFlow weight. Skip it if you need modern features like GPU acceleration, automatic differentiation, or extensive pre-built layer types—this is a binding to a classic C library, not a contemporary framework.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.