lib/newral/networks/sigmoid.rb
def adjust_weights( expected: nil, learning_rate:0.5, layer: :output, weights_at_output_nodes: nil, output: nil )
        error_delta = layer.to_sym == :output ?  delta_rule( expected: expected ) : delta_rule_hidden( output: output, expected: expected, weights_at_output_nodes: weights_at_output_nodes )
        @weights.each_with_index do |weight,idx|
          @weights[idx] = @weights[idx]-error_delta[ idx ]*learning_rate
        end 
      end
# depending on where the neuron is placed we need other infos to adjust the weights 
# on output we just need the expected results
# for hidden neurons we also need to know the weights at the output nodes 
# and the actual output of the network
depending on where the neuron is placed we need other infos to adjust the weights
on output we just need the expected results
for hidden neurons we also need to know the weights at the output nodes
and the actual output of the network
depending on where the neuron is placed we need other infos to adjust the weights on output we just need the expected results for hidden neurons we also need to know the weights at the output nodes and the actual output of the network
def adjust_weights( expected: nil, learning_rate:0.5, layer: :output, weights_at_output_nodes: nil, output: nil )
        error_delta = layer.to_sym == :output ?  delta_rule( expected: expected ) : delta_rule_hidden( output: output, expected: expected, weights_at_output_nodes: weights_at_output_nodes )
        @weights.each_with_index do |weight,idx|
          @weights[idx] = @weights[idx]-error_delta[ idx ]*learning_rate
        end 
      end
def adjust_weights ( expected : nil , learning_rate : 0.5 , layer : :output , weights_at_output_nodes : nil , output : nil ) error_delta = layer . to_sym == :output ? delta_rule ( expected : expected ) : delta_rule_hidden ( output : output , expected : expected , weights_at_output_nodes : weights_at_output_nodes ) @weights . each_with_index do | weight , idx | @weights [ idx ] = @weights [ idx ] - error_delta [ idx ] * learning_rate end end
depending on where the neuron is placed we need other infos to adjust the weights
on output we just need the expected results
for hidden neurons we also need to know the weights at the output nodes
and the actual output of the network
depending on where the neuron is placed we need other infos to adjust the weights on output we just need the expected results for hidden neurons we also need to know the weights at the output nodes and the actual output of the network
expected
learning_rate
layer
weights_at_output_nodes
output