Sha256: 0f0bd10a78db82a9143027dfc3fb02c01c0a6f36c699f1369e62b8edd2571745

Contents?: true

Size: 551 Bytes

Versions: 10

Compression:

Stored size: 551 Bytes

Contents

require File.dirname(__FILE__) + '/../../lib/ai4r/som/som'
require File.dirname(__FILE__) + '/som_data'
require 'benchmark'

som = Ai4r::Som::Som.new 4, 8, Ai4r::Som::TwoPhaseLayer.new(10)
som.initiate_map

som.nodes.each do |node|
  p node.weights
end

puts "global error distance: #{som.global_error(SOM_DATA)}"
puts "\ntraining the som\n"

times = Benchmark.measure do
  som.train SOM_DATA
end

som.nodes.each do |node|
  p node.weights
end

puts "Elapsed time for training: #{times}"
puts "global error distance: #{som.global_error(SOM_DATA)}\n\n"

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
nirvdrum-ai4r-1.9.1 examples/som/som_single_example.rb
ai4r-1.13 examples/som/som_single_example.rb
ai4r-1.12 examples/som/som_single_example.rb
ai4r-1.11 examples/som/som_single_example.rb
ai4ruby-1.14 examples/som/som_single_example.rb
ai4ruby-1.13 examples/som/som_single_example.rb
ai4ruby-1.12 examples/som/som_single_example.rb
ai4ruby-1.11 examples/som/som_single_example.rb
ai4r-1.9 examples/som/som_single_example.rb
ai4r-1.8 examples/som/som_single_example.rb