attractivechaos / kann

A lightweight C library for artificial neural networks
Other
678 stars 117 forks source link

kann_class_error() is broken for KANN_C_CEB #34

Open grahamgower opened 4 years ago

grahamgower commented 4 years ago

kann_class_error() always returns 0 for networks with KANN_C_CEB cost.

attractivechaos commented 4 years ago

kann_class_error() doesn't work with binary cross-entropy KANN_C_CEB. With this cost, there can be multiple 1s, but kann_class_error() assumes there is only one 1.

grahamgower commented 4 years ago

Yep, thanks. I wasn't sure if this was intentional or not. The mnist-cnn.c example uses KANN_C_CEB with kann_train_fnn1(), which then outputs 0% class error.

grahamgower commented 4 years ago

Oh, wait. I'm an idiot. :) Sorry for the noise.