hughperkins / DeepCL

OpenCL library to train deep convolutional neural networks
Mozilla Public License 2.0
866 stars 200 forks source link

CrossEntropyLoss.cpp #62

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi,

line:67 gradInput[i] = (input[i] - expectedOutput[i]) / input[i] / (1.0f - input[i]); is this correct? In https://github.com/nyanp/tiny-cnn/blob/master/tiny_cnn/lossfunctions/loss_function.h gradInput[i] = (input[i] - expectedOutput[i]) / (input[i] * (1.0f - input[i])); is used.

thanks, filip

hughperkins commented 8 years ago

the brackets are differnet, you can test eg:

wcalc "1 / 3 / 5"
wcalc "1 / (3*5)"

... will give the same answer

ghost commented 8 years ago

Oh, I see, stupid of me!

hughperkins commented 8 years ago

:-)