class CooCoo::CostFunctions::Base
@abstract Defines and documents the cost functions' interface. Be sure to call {CostFunctions.register} inside your subclass.
Public Class Methods
call(target, x)
click to toggle source
Returns the cost between the target output and actual output.
@param target [Vector] Desired value @param x [Vector] A network's actual output @return [Vector] The cost of the target for this output
# File lib/coo-coo/cost_functions.rb, line 26 def self.call(target, x) raise NotImplementedError.new end
derivative(target, x, y = nil)
click to toggle source
Returns the derivative of the cost function, #call
. This is what gets fed into the network to determine the changes.
@param target [Vector] Desired value @param x [Vector] A network's actual output @param y [Vector] The results from a previous #call
@return [Vector]
# File lib/coo-coo/cost_functions.rb, line 37 def self.derivative(target, x, y = nil) raise NotImplementedError.new end