Backpropagation algorithm in CUBLAS

Hey guys, I’m writing a backprop algo in CUBLAS/CUDA and the cost just becomes NaN when it decreases to around ~10000, any one got any ideas?

The code is at https://github.com/HenryJia/CUBLAS-ML/blob/backprop/cublasNN.cpp

I know this isn’t supposed to happen because my prototype matlab code which I’m using as reference doesn’t do this.

Thanks

Solved it, turns out I wasn’t computing the function sigmoidGradVecGPU correctly.