ai4r 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/neural_network/backpropagation.rb +5 -0
- metadata +2 -2
@@ -124,6 +124,9 @@ module NeuralNetwork
|
|
124
124
|
# input: Networks input
|
125
125
|
#
|
126
126
|
# output: Expected output for the given input.
|
127
|
+
#
|
128
|
+
# This method returns the network error (not an absolut amount,
|
129
|
+
# the difference between real output and the expected output)
|
127
130
|
def train(input, output)
|
128
131
|
#Eval input
|
129
132
|
eval(input)
|
@@ -139,6 +142,8 @@ module NeuralNetwork
|
|
139
142
|
@neurons.each do |layer|
|
140
143
|
layer.each {|neuron| neuron.change_weights }
|
141
144
|
end
|
145
|
+
#return net error
|
146
|
+
return @neurons.last.collect { |x| x.calc_error }
|
142
147
|
end
|
143
148
|
|
144
149
|
private
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ai4r
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "1.
|
7
|
-
date: 2008-
|
6
|
+
version: "1.1"
|
7
|
+
date: 2008-03-14 00:00:00 +00:00
|
8
8
|
summary: ruby implementations of algorithms covering several Artificial intelligence fields, including Genetic algorithms, Neural Networks, and machine learning.
|
9
9
|
require_paths:
|
10
10
|
- lib
|