lib/newral/networks/backpropagation_network.rb
# gets the weights of the output neurons this input feeds to 
# this of course can be done much simpler (as its always the nth weight of the output neuron)
# however we want to stay explicit 
gets the weights of the output neurons this input feeds to
this of course can be done much simpler (as its always the nth weight of the output neuron)
however we want to stay explicit
gets the weights of the output neurons this input feeds to this of course can be done much simpler ( as its always the nth weight of the output neuron ) however we want to stay explicit
def output_weights( neuron )
        raise Errors::OnlyPossibleForHidden unless @layers["hidden"].neurons.member?( neuron )
        weights = []
        @layers["output"].neurons.each do |output_neuron|
          output_neuron.inputs.each_with_index do |input,idx| 
            weights << output_neuron.weights[ idx ] if input == neuron
          end 
        end 
       weights 
      end
def output_weights ( neuron ) raise Errors :: OnlyPossibleForHidden unless @layers [ "hidden" ] . neurons . member? ( neuron ) weights = [ ] @layers [ "output" ] . neurons . each do | output_neuron | output_neuron . inputs . each_with_index do | input , idx | weights << output_neuron . weights [ idx ] if input == neuron end end weights end
gets the weights of the output neurons this input feeds to
this of course can be done much simpler (as its always the nth weight of the output neuron)
however we want to stay explicit
gets the weights of the output neurons this input feeds to this of course can be done much simpler ( as its always the nth weight of the output neuron ) however we want to stay explicit
neuron