Vectorized Calculation for Neural Network
-reduced run time significantly