levithomason / anny

Anny is an artificial neural network, yo!
http://levithomason.github.io/anny/
17 stars 3 forks source link

Create Network.Error class or factory #89

Open levithomason opened 8 years ago

levithomason commented 8 years ago

Just as with Neuron activations in #88, there are Network error functions in an ERROR namespace. We should do the same thing and pull these into a class or factory. For better cohesion, it should live on as a static on the Network class. You should be able to create new error functions with validation. When created, they should be added to the Network.ERROR namespace.

ckcollab commented 8 years ago

What different kinds of errors are there?

levithomason commented 8 years ago

Anny currently includes crossEntropy, meanSquared, rootMeanSquared, and arcTan. You can define any error function you like. An error function takes the Network's actual output (array of the output value of every Neuron in the output Layer) and the expected output and returns a number. See here.

There are different error functions for different use cases. For example, classification problems are best served by the "cross entropy" error function. Some material I've read of late suggests only to use cross entropy and soft max activations for most problems, including object recognition.