added sigmoid_deriv and tanh_deriv to cudamat;
moved the specialized fprop/backprop logic into the DenseWeights class