Robustness Analysis and Improvement in Neural Networks and Neuromorphic Computing