Gradients are not the only valuable attribute of a cost function
HolgerPeters opened this issue · 0 comments
HolgerPeters commented
Currently, the Cost
trait can be defined by just specifying fn gradient(prediction, truth, gradient_by_error_coefficient)
. Probably, a library user will also want to be able to obtain absolute costs as a complement to the gradient. I think this is feasible, since I cannot imagine a cost function where we can give the gradient, but not an absolute value.
Another benefit of this would be, that at the moment when implementing the Cost
trait, the actual cost function is not documented in code (in doc comments at best). So when reading https://github.com/blue-yonder/vikos/blob/master/src/cost.rs#L38 it is not obvious what the cost function actually calculates.