lib/ruby_brain/network.rb in ruby_brain-0.1.3 vs lib/ruby_brain/network.rb in ruby_brain-0.1.4

- old
+ new

@@ -1,10 +1,7 @@ module RubyBrain class Network - extend Forwardable - def_delegators :@weights_set, :overwrite_weights, :get_weights_as_array - attr_accessor :learning_rate # Constructor of Network class # # @example network structure Array(num_units_list) @@ -136,10 +133,10 @@ # @param monitoring_channels [Array<Symbol>] Specify which log should be reported. Now you can select only `:best_params_training` def learn(inputs_set, outputs_set, max_training_count=50, tolerance=0.0, monitoring_channels=[]) raise RubyBrain::Exception::TrainingDataError if inputs_set.size != outputs_set.size # raise "inputs_set and outputs_set has different size!!!!" if inputs_set.size != outputs_set.size - best_error = 9999999999999 + best_error = Float::INFINITY best_weights_array = [] max_training_count.times do |i_training| accumulated_errors = 0.0 # for rms inputs_set.zip(outputs_set).each do |t_input, t_output| forward_outputs = get_forward_outputs(t_input)