Class: CooCoo::CostFunctions::SoftMaxCrossEntropy
- Inherits:
-
CrossEntropy
- Object
- Base
- CrossEntropy
- CooCoo::CostFunctions::SoftMaxCrossEntropy
- Defined in:
- lib/coo-coo/cost_functions.rb
Overview
Combines a SoftMax activation with CrossEntropy. Due to math this is more optimal than having a SoftMax layer and doing CrossEntropy seperately.
Class Method Summary collapse
Class Method Details
.call(target, x) ⇒ Object
82 83 84 |
# File 'lib/coo-coo/cost_functions.rb', line 82 def self.call(target, x) super(target, ActivationFunctions::ShiftedSoftMax.call(x)) end |
.derivative(target, x) ⇒ Object
86 87 88 |
# File 'lib/coo-coo/cost_functions.rb', line 86 def self.derivative(target, x) x - target end |