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

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


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