layered.cost module

class Cost[source]

Bases: object

__call__(prediction, target)[source]
delta(prediction, target)[source]
class SquaredError[source]

Bases: layered.cost.Cost

Fast and simple cost function.

__call__(prediction, target)[source]
delta(prediction, target)[source]
class CrossEntropy(epsilon=1e-11)[source]

Bases: layered.cost.Cost

Logistic cost function used for classification tasks. Learns faster in the beginning than SquaredError because large errors are penalized exponentially. This makes sense in classification since only the best class will be the predicted one.

__call__(prediction, target)[source]
delta(prediction, target)[source]