Change closestByDotProduct to use pre-built numpy arrays and array norms to accelerate training and testing