fixed gradient test
Fixed small math error in nntrainer.py