class CooCoo::CostFunctions::MeanSquare
Implements the mean square cost function. Its derivative is a simple difference between the target and actual output.
Public Class Methods
call(target, x)
click to toggle source
# File lib/coo-coo/cost_functions.rb, line 47 def self.call(target, x) d = derivative(target, x) d * d * 0.5 end
derivative(target, x, y = nil)
click to toggle source
# File lib/coo-coo/cost_functions.rb, line 52 def self.derivative(target, x, y = nil) x - target end