Sha256: ecbfac5b54ce497aed3cd5c6ceb5475a7146afe03ef67e34ec91244772aaaf6f

Contents?: true

Size: 633 Bytes

Versions: 10

Compression:

Stored size: 633 Bytes

Contents

# this example shows the impact of the size of a som on the global error distance
require File.dirname(__FILE__) + '/../../lib/ai4r/som/som'
require File.dirname(__FILE__) + '/som_data'
require 'benchmark'

10.times do |t|
  t += 3 # minimum number of nodes

  puts "Nodes: #{t}"
  som = Ai4r::Som::Som.new 4, 8, Ai4r::Som::TwoPhaseLayer.new(t)
  som.initiate_map

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

  times = Benchmark.measure do
    som.train SOM_DATA
  end

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

Version data entries

10 entries across 10 versions & 3 rubygems

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