That'd be fantastic. Thanks for the quick response time.
In case anyone else finds it useful, I made a quick work around that relies on FANN's save-to-disk call. (Not shown is how you figure out which connections belong to which neuron, but that's not too hard.)
class RubyFann::Standard
# returns an array of { :src_node, :weight } elements
def get_connections
# ruby-fann doesn't let you get at the raw weights -- as far as I can tell. So
# this is a workaround that saves the network to a file and parses the weights out
# of it.
self.save("/tmp/test.fann")
connections_str = `grep connections /tmp/test.fann`# read the saved network from file
connections_str.gsub!(/.*=/,"") # get rid of some boilerplate at beginning of line
connections = connections_str.split("(") # turn string of repeated "(src_node, weight)" elements into an array
connections.shift # get rid of the bogus first element
connections = connections.map { |x| x.split(",") } # split each (src_node, weight) pairs into an array
connections = connections.map{ |x| { :src_node => Integer( x[0] ),
:weight => Float( x[1].gsub(/\).*/, "") ) } }
dummy = `rm /tmp/test.fann`
return connections
end
end