joaopauloschuler / neural-api

CAI NEURAL API - Pascal based deep learning neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA.
GNU Lesser General Public License v2.1
371 stars 198 forks source link

Loss function #121

Open gwiesenekker opened 1 year ago

gwiesenekker commented 1 year ago

The Hypotenuse output shows an Accuracy, an Error and a Loss. In Tensorflow the 'loss function' is used to train the neural network, but as the Loss is zero I guess Error is used? Accuracy and Loss are for information only? The default error is abs(desired_output - neural_network_output)? How can I define another loss function like RMSE or percentile so that I can compare the neural-api output to previous TensorFlow runs?

joaopauloschuler commented 1 year ago

"but as the Loss is zero I guess Error is used?" You are correct.

In this API, ATM, loss in calculated only for classification tasks where the last layer is SoftMax.

As I work a lot with classification problems, classification accuracy is the metric that I use for comparison more frequently. Other metrics are: number of epochs for convergence, validation/test accuracy, price/performance on certain hardware and speed to process one sample.

Regarding RMSE, I'll treat this as a feature request (it's a good idea - thank you).

Any function that is calculated on the top of the predicted and the desired output could be calculated as you can get the NN raw output with GetOuput method.

In the case that you compare this API with tensorflow, please share your results good or bad.