André
unread,Nov 16, 2008, 9:05:27 AM11/16/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ruby_fann
Hello all,
I'm trying to run the simpe test sample given on the Ruby-fann install
page.
It runs fine when I run the script with ruby, I get a segfault when I
run it through irb.
I installed (manually) libfann v2.1 and the ruby_fann gem.
Linux Debian testing.
Is this an irb bug, a ruby-fann bug? I don't quite know to whom I
should report it.
Log below.
-----------------------------------------------------------------------------------------------------------------------------
13:56 andre@LonLT093 ~/Desktop/Fann/fann-2.1.0/examples% irb <
sample_ruby.rb
require 'rubygems'
true
require 'ruby_fann/neural_network'
Initialized Ruby Bindings for FANN.
true
# Create Training data with 2 each of inputs(array of 3) & desired
outputs(array of 1).
training_data = RubyFann::TrainData.new(
:inputs=>[[0.3, 0.4, 0.5], [0.1, 0.2, 0.3]],
:desired_outputs=>[[0.7], [0.8]])
#<RubyFann::TrainData:0xb7c230f0>
# Create FANN Neural Network to match appropriate training data:
fann = RubyFann::Standard.new(
:num_inputs=>3,
:hidden_neurons=>[2, 8, 4, 3, 4],
:num_outputs=>1)
initializing
Created RubyFann::Standard [164195704].
Checking for callback...none found.
#<RubyFann::Standard:0xb7c67c28>
# Training using data created above:
fann.train_on_data(training_data, 1000, 1, 0.1)
Max epochs 1000. Desired error: 0.1000000015.
Epochs 1. Current error: 0.0848674923. Bit fail 0.
/usr/lib/ruby/1.8/irb.rb:302: [BUG] Segmentation fault
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
[2] 31844 abort irb < sample_ruby.rb
-----------------------------------------------------------------------------------------------------------------------------
13:57 andre@LonLT093 ~/Desktop/Fann/fann-2.1.0/examples% ruby
sample_ruby.rb
Initialized Ruby Bindings for FANN.
initializing
Created RubyFann::Standard [163977352].
Checking for callback...none found.
Max epochs 1000. Desired error: 0.1000000015.
Epochs 1. Current error: 0.0611918829. Bit fail 0.
Hello there
Destroyed FANN network [163977352].
Destroyed Training data [163977032].
-----------------------------------------------------------------------------------------------------------------------------
13:58 andre@LonLT093 ~/Desktop/Fann/fann-2.1.0/examples% cat
sample_ruby.rb
require 'rubygems'
require 'ruby_fann/neural_network'
# Create Training data with 2 each of inputs(array of 3) & desired
outputs(array of 1).
training_data = RubyFann::TrainData.new(
:inputs=>[[0.3, 0.4, 0.5], [0.1, 0.2, 0.3]],
:desired_outputs=>[[0.7], [0.8]])
# Create FANN Neural Network to match appropriate training data:
fann = RubyFann::Standard.new(
:num_inputs=>3,
:hidden_neurons=>[2, 8, 4, 3, 4],
:num_outputs=>1)
# Training using data created above:
fann.train_on_data(training_data, 1000, 1, 0.1)
puts "Hello there"
# Run with different input data:
outputs = fann.run([0.7, 0.9, 0.2])
14:02 andre@LonLT093 ~/Desktop/Fann/fann-2.1.0/examples%