Class: CooCoo::CostFunctions::Base Abstract
- Defined in:
- lib/coo-coo/cost_functions.rb
Overview
This class is abstract.
Defines and documents the cost functions’ interface.
Be sure to call CostFunctions.register inside your subclass.
Direct Known Subclasses
Class Method Summary collapse
-
.call(target, x) ⇒ Vector
Returns the cost between the target output and actual output.
-
.derivative(target, x, y = nil) ⇒ Vector
Returns the derivative of the cost function,
#call
.
Class Method Details
.call(target, x) ⇒ Vector
Returns the cost between the target output and actual output.
26 27 28 |
# File 'lib/coo-coo/cost_functions.rb', line 26 def self.call(target, x) raise NotImplementedError.new end |
.derivative(target, x, y = nil) ⇒ Vector
Returns the derivative of the cost function, #call
. This is what gets fed into the network to determine the changes.
37 38 39 |
# File 'lib/coo-coo/cost_functions.rb', line 37 def self.derivative(target, x, y = nil) raise NotImplementedError.new end |